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

chore: upgrade papyrus commit to ca83fd42 and blockifier to 0.8.0-dev.1 #393

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

MohammadNassar1
Copy link
Contributor

@MohammadNassar1 MohammadNassar1 commented Jul 8, 2024

This change is Reviewable

Copy link
Contributor Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @ayeletstarkware, @elintul, and @giladchase)


crates/tests-integration/src/state_reader.rs line 61 at r1 (raw file):

    let account_contract_cairo1 = FeatureContract::AccountWithoutValidations(CairoVersion::Cairo1);
    let test_contract_cairo1 = FeatureContract::TestContract(CairoVersion::Cairo1);
    let erc20_cairo1 = FeatureContract::ERC20(CairoVersion::Cairo1);

@ArniStarkware/@Yael-Starkware , can you please approve the change I made in this file?

Code quote:

let erc20_cairo1 = FeatureContract::ERC20(CairoVersion::Cairo1);

@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.86%. Comparing base (2c7b230) to head (7711799).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #393   +/-   ##
=======================================
  Coverage   83.86%   83.86%           
=======================================
  Files          35       36    +1     
  Lines        1667     1717   +50     
  Branches     1667     1717   +50     
=======================================
+ Hits         1398     1440   +42     
- Misses        196      204    +8     
  Partials       73       73           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 7 files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware, @elintul, and @giladchase)

a discussion (no related file):
I have bumped both Papyrus and Blockifier versions.
Blockifier: 0.8.0-dev.1.
Papyrus: ca83fd42.

The main changes in Mempool are related to the Blockifier code.


Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 7 files at r1.
Reviewable status: 5 of 7 files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware, @elintul, @giladchase, and @MohammadNassar1)


crates/gateway/src/stateful_transaction_validator_test.rs line 61 at r1 (raw file):

                    max_amount: VALID_L1_GAS_MAX_AMOUNT,
                    max_price: VALID_L1_GAS_MAX_PRICE_PER_UNIT,
                    balance: num_bigint::BigUint::default(),

This is zero - right?
Please make it explicitly zero.

Code quote:

balance: num_bigint::BigUint::default(),

crates/tests-integration/src/state_reader.rs line 61 at r1 (raw file):

Previously, MohammadNassar1 (mohammad-starkware) wrote…

@ArniStarkware/@Yael-Starkware , can you please approve the change I made in this file?

:lgtm:

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @ayeletstarkware, @giladchase, and @MohammadNassar1)

a discussion (no related file):

Previously, MohammadNassar1 (mohammad-starkware) wrote…

I have bumped both Papyrus and Blockifier versions.
Blockifier: 0.8.0-dev.1.
Papyrus: ca83fd42.

The main changes in Mempool are related to the Blockifier code.

Please change the commit message to also include the Blockifier bump (so it's clear in git tree).



crates/gateway/Cargo.toml line 21 at r1 (raw file):

cairo-vm.workspace = true
hyper.workspace = true
num-bigint.workspace = true

If only used in tests, please move to [dev-dependencies] section.

Code quote:

num-bigint.workspace = true

crates/gateway/src/stateful_transaction_validator_test.rs line 61 at r1 (raw file):

                    max_amount: VALID_L1_GAS_MAX_AMOUNT,
                    max_price: VALID_L1_GAS_MAX_PRICE_PER_UNIT,
                    balance: num_bigint::BigUint::default(),

I think the convention is not to use the fuily-qualified name; please make sure?

Code quote:

num_bigint::BigUint

crates/tests-integration/src/state_reader.rs line 220 at r1 (raw file):

        | FeatureContract::FaultyAccount(version)
        | FeatureContract::TestContract(version) => *version,
        FeatureContract::ERC20 => CairoVersion::Cairo0,

Looks like the ERC20 was Cairo 0 until now? What's the version we have in the repo.?

Code quote:

FeatureContract::ERC20 => CairoVersion::Cairo0

@ArniStarkware ArniStarkware requested a review from elintul July 8, 2024 07:14
Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @ayeletstarkware, @elintul, @giladchase, and @MohammadNassar1)


crates/tests-integration/src/state_reader.rs line 220 at r1 (raw file):

Previously, elintul (Elin) wrote…

Looks like the ERC20 was Cairo 0 until now? What's the version we have in the repo.?

It was, but:

  1. this specific function is correct (fn cairo_version(contract: &FeatureContract)).
  2. The logic indeed changed in this PR - it made it so prepare_state_diff used to use FeatureContract::ERC20(CairoVersion::Cairo0) and now uses: FeatureContract::ERC20(CairoVersion::Cairo1).

This is fine from the test's perspective.

@ArniStarkware
Copy link
Contributor

crates/tests-integration/src/state_reader.rs line 104 at r1 (raw file):

    fund_accounts: Vec<ContractAddress>,
) -> ThinStateDiff {
    let erc20 = FeatureContract::ERC20(CairoVersion::Cairo1);

This changes the logic of the test (Used to use the Cairo0 contract).
This is fine by us.

Code quote:

let erc20 = FeatureContract::ERC20(CairoVersion::Cairo1);

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @ayeletstarkware, @giladchase, and @MohammadNassar1)


crates/tests-integration/src/state_reader.rs line 104 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

This changes the logic of the test (Used to use the Cairo0 contract).
This is fine by us.

How would it work?


crates/tests-integration/src/state_reader.rs line 220 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

It was, but:

  1. this specific function is correct (fn cairo_version(contract: &FeatureContract)).
  2. The logic indeed changed in this PR - it made it so prepare_state_diff used to use FeatureContract::ERC20(CairoVersion::Cairo0) and now uses: FeatureContract::ERC20(CairoVersion::Cairo1).

This is fine from the test's perspective.

Why do we need it? Doesn't it exist in Blockifier?

@MohammadNassar1 MohammadNassar1 force-pushed the mohammad/upgrade-papyrus-version/ca83fd42 branch from 93e467f to 7711799 Compare July 8, 2024 07:41
@MohammadNassar1 MohammadNassar1 changed the title chore: upgrade papyrus commit to ca83fd42 chore: upgrade papyrus commit to ca83fd42 and blockifier to 0.8.0-dev.1 Jul 8, 2024
Copy link
Contributor Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 7 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @ayeletstarkware, @elintul, and @giladchase)

a discussion (no related file):

Previously, elintul (Elin) wrote…

Please change the commit message to also include the Blockifier bump (so it's clear in git tree).

Done



crates/gateway/src/stateful_transaction_validator_test.rs line 61 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

This is zero - right?
Please make it explicitly zero.

Done.


crates/tests-integration/src/state_reader.rs line 61 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…
:lgtm:

Thanks!


crates/tests-integration/src/state_reader.rs line 104 at r1 (raw file):

Previously, elintul (Elin) wrote…

How would it work?

Changed back to Cairo0.


crates/tests-integration/src/state_reader.rs line 220 at r1 (raw file):

Previously, elintul (Elin) wrote…

Why do we need it? Doesn't it exist in Blockifier?

Changed back to Cairo0.

@ArniStarkware
Copy link
Contributor

crates/tests-integration/src/state_reader.rs line 212 at r2 (raw file):

}

// TODO (Yael 19/6/2024): make this function public in Blockifier and remove it from here.

As discussed - this function can be deleted (This PR allows it).

Code quote:

// TODO (Yael 19/6/2024): make this function public in Blockifier and remove it from here.

@ArniStarkware ArniStarkware requested a review from elintul July 8, 2024 07:44
Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 7 files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware, @elintul, @giladchase, and @MohammadNassar1)

Copy link
Contributor

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 7 files reviewed, 1 unresolved discussion (waiting on @ayeletstarkware, @elintul, and @giladchase)


crates/tests-integration/src/state_reader.rs line 212 at r2 (raw file):

}

// TODO (Yael 19/6/2024): make this function public in Blockifier and remove it from here.

As discussed - this function can be deleted (This PR allows it).

Code quote:

// TODO (Yael 19/6/2024): make this function public in Blockifier and remove it from here.

Copy link
Collaborator

@elintul elintul left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ayeletstarkware and @giladchase)

@ArniStarkware ArniStarkware requested a review from elintul July 8, 2024 07:52
Copy link
Contributor Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ayeletstarkware, @elintul, and @giladchase)


crates/tests-integration/src/state_reader.rs line 212 at r2 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

As discussed - this function can be deleted (This PR allows it).

Correct.
@Yael-Starkware , can you delete it please?

@MohammadNassar1 MohammadNassar1 merged commit 29d3e19 into main Jul 8, 2024
13 checks passed
@MohammadNassar1 MohammadNassar1 deleted the mohammad/upgrade-papyrus-version/ca83fd42 branch July 8, 2024 07:54
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