starkware-libs / blockifier

Blockifier is a Rust implementation for the transaction-executing component in the StarkNet sequencer, in charge of creating state diffs and blocks.
Apache License 2.0
169 stars 97 forks source link

fix(transaction): disable cairo0 redeclaration #2014

Closed meship-starkware closed 5 days ago

meship-starkware commented 1 week ago

…e in declare V0 and V1


This change is Reviewable

meship-starkware commented 1 week ago

I still need to add a test to see that it works.

codecov-commenter commented 1 week ago

Codecov Report

Attention: Patch coverage is 85.29412% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.20%. Comparing base (9e9a26c) to head (724f34d). Report is 37 commits behind head on main.

Files Patch % Lines
crates/blockifier/src/transaction/transactions.rs 82.75% 3 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2014 +/- ## ========================================== + Coverage 80.17% 80.20% +0.03% ========================================== Files 69 69 Lines 9739 9762 +23 Branches 9739 9762 +23 ========================================== + Hits 7808 7830 +22 - Misses 1471 1473 +2 + Partials 460 459 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

meship-starkware commented 1 week ago

crates/blockifier/src/versioned_constants.rs line 54 at r7 (raw file):

Previously, barak-b-starkware wrote…
I would guess that the default, in this case, is `false`, that's true? Is that what what we want?

It's true by default, which surprised me as well. I have tried writing #[serde(default="true")] but I got an error

barak-b-starkware commented 1 week ago

crates/blockifier/src/transaction/transactions.rs line 218 at r11 (raw file):

                        // is set to zero. Here, we take advantage of this fact and set
                        // the CCH to zero in the writes compiled class hashes, so it will not
                        // affect the diff between the initial and the writes.

Suggestion:

                        // For undeclared contract classes, when trying to get the compiled contract class, the initial compiled class hash
                        // is set to zero. Here, we take advantage of this fact and set
                        // the compiled class hash to zero to match the compiled class hashes writes and reads, so it will not
                        // affect the state diff.