Skip to content

Conversation

@3alpha
Copy link
Collaborator

@3alpha 3alpha commented Sep 29, 2025

ON HOLD until Blake hashing is implemented.

Usage related changes

Faster devnet startup

Development related changes

To recap, following changes are made, as diffs are bit unreliable in some parts

  • From OZ 1.0.0. Account.sierra there was removed around 10k lines of formatted JSON debug data
  • Build script was added for starknet-devnet-types crate which generates modules which has precompiled most used contracts (specified inside precompiled/inputs of same crate)
  • In core crate, there was added mapping between contract classes and casm hashes that do similar thing.
  • As consequence, all operations now calculate hashes of inputs for lookup, which may be a bit wasteful

Resolves #804.

TODOs:

  • decide on amount of caching to keep code reasonably readable
  • create comprehensive tests which ensure that precalculated mappings are correct
  • maybe automate decision making process when deciding what to precompile or precalculate

Checklist:

  • Checked out the contribution guidelines
  • Applied formatting - ./scripts/format.sh
  • No linter errors - ./scripts/clippy_check.sh
  • No unused dependencies - ./scripts/check_unused_deps.sh
  • No spelling errors - ./scripts/check_spelling.sh
  • Performed code self-review
  • Rebased to the latest commit of the target branch (or merged it into my branch)
    • Once you make the PR reviewable, please avoid force-pushing
  • Updated the docs if needed - ./website/README.md
  • Linked the issues resolvable by this PR - linking info
  • Updated the tests if needed; all passing - execution info

@coderabbitai
Copy link

coderabbitai bot commented Sep 29, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test-fast-startup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be minified

serde_json = { workspace = true }
blake3 = "1.5"
usc = { workspace = true }
serde_json_canonicalizer = "0.3.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be in the root Cargo.toml? Applies to L26 and L61.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does removing debug data affect behavior on error and the available stack trace?

sierra_contract_json: serde_json::Value,
sierra_contract_json: Value,
) -> DevnetResult<CasmContractClass> {
#[cfg(not(clippy))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this line necessary?

@3alpha 3alpha changed the title Speed up startup by precalculating hashes and precompiling contracts [ON HOLD] Speed up startup by precalculating hashes and precompiling contracts Sep 30, 2025
@3alpha 3alpha force-pushed the main branch 8 times, most recently from 9f1da3e to a3e975f Compare October 18, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Devnet spawning is slowed down after introduction of another ERC20 artifact

3 participants