Merged main#9
Open
prkpndy wants to merge 46 commits into
Open
Conversation
…orTransactionBatchStage`
…ncies, add edge cases
…le `executing` flag tracking for proposals
CASM hashes are now not unique by Sierra class hash alone, but by the combination of class hash and block number. This migration updates the database schema to reflect this change. CASM class hashes are no longer stored in the `casm_definitions` table, but are split out to their own `casm_class_hashes` table. In this table (class_hash, block_number) is a unique key.
This change adds support for migrated compiled classes (effectively CASM hash updates) to the following parts of our code: * storage: CASM class hash / definition insertion and lookup * gateway client: parsing of migrated compiled classes from feeder gateway response * common: core state update data structures * pathfinder/state: CASM hashes are now updated both in storage and the classes Merkle tree
Hash and length calculation should now include migrated compiled classes.
For JSON-RPC 0.10.0 we have to include migrated compiled classes in the response.
…s hashes Migrated CASM class hashes have to be included in the reverse diff calculation. The schema change actually makes this query simpler, as we now have a single table with all the information required: class hash, CASM class hash and block number.
Our StateReader needs to implement the new method `get_compiled_class_hash_v2` to support Starknet 0.14.1 execution. We now use the "default" implementation that is always re-computing the CASM class hash. Ideally we'll implement some optimization later to either pre-compute or cache these values.
…-migration feat: add support for migrated CASM class hashes
…jections test(consensus): add more failure injection points
Blockifier on Starknet 0.14.1 requires being able to look up Blake2 CASM class hashes for all CASM hashes that are executed. Unfortunately, computing these Blake2 hashes on-the-fly is quite expensive, so we add a pre-computed mapping from class hashes to Blake2 CASM class hashes to the storage layer. This migration step uses two binary files containing the pre-computed mappings for a subset of mainnet and Sepolia testnet respectively. These files were generated using the `recompute_casm_class_hashes` example. The files contain a mapping of (ClassHash, CasmHash) pairs and are used to avoid parsing the CASM class definitions and computing the Blake2 CASM class hash for all classes for which we already have the result for.
e2 CASM class hashes
And store in storage so that during execution we can look up the pre-computed hash and fall back to computing it only if not present.
This seems to be a pretty common operation during execution, so even doing a storage lookup could hurt performance.
…re-computation feat: implement pre-computation of Blake2 CASM class hashes
…timization refactor(validator): move to single `Executor` architecture
…sactionsfin fix(validator): handle deferred `TransactionsFin` properly
…posals fix(validator): executor not required on empty proposals
chore: bump version to 0.21.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short description of what this PR does.
A longer description, include motivation and intent if possible. Detail any caveats or follow-up steps still required.
Consider motivating any new dependencies.
Delete once completed:
CHANGELOG.md