Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Expose private class hashing functionality #2465

Closed

Conversation

notlesh
Copy link

@notlesh notlesh commented Jan 3, 2025

This PR exposes Pathfinder's class hashing internals for use in SNOS.


Class hashing is very nuanced, and Pathfinder is one of the only public implementations in rust that provides this functionality. However, it was kept private, so we have been using a fork of Pathfinder in which we exposed this functionality for our use and have been maintaining it since.

However, for projects which use SNOS as a dependency, this creates conflicting/duplicated Pathfinder crates in the dependency tree which is tricky to solve. If possible, it would be great to include this in the main codebase so that SNOS can depend on official crates through crates.io and avoid such conflicts.


Delete once completed:

  • link any issues closed by this pull-request
  • add all user-facing changes to CHANGELOG.md
  • new dependencies were added to the workspace toml

odesenfans and others added 2 commits December 30, 2024 16:33
Problem: we require a way to compute the "hinted class hash" used in the
Cairo 0 class hashing procedure for the Starknet OS. Pathfinder computes
this value but does not expose the computation.

Solution: extract the hash computation in a new public function
`compute_cairo_hinted_class_hash()`. Make the `json` module and the JSON
parsing function public as well to give callers access to the types
required to compute this hash.
@t00ts
Copy link
Contributor

t00ts commented Jan 6, 2025

Hi! Thanks for bringing this to our attention.

We've created an issue to tackle this. Feel free to subscribe to it to receive updates as we move forward with this request.

@t00ts t00ts closed this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants