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

fix(blockifier_reexecution): bug in get storage at #1698

Closed

Conversation

AvivYossef-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.90%. Comparing base (e3165c4) to head (25ae07d).
Report is 193 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1698      +/-   ##
==========================================
+ Coverage   40.10%   41.90%   +1.79%     
==========================================
  Files          26      197     +171     
  Lines        1895    23140   +21245     
  Branches     1895    23140   +21245     
==========================================
+ Hits          760     9696    +8936     
- Misses       1100    12988   +11888     
- Partials       35      456     +421     

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

@AvivYossef-starkware AvivYossef-starkware marked this pull request as ready for review October 30, 2024 14:43
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_reexecution_map_declare_sn_api_tx_to_blockifier_tx branch from 9ccc5ba to 50739a6 Compare October 31, 2024 08:54
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from c284c62 to 45c1c08 Compare October 31, 2024 08:54
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_reexecution_map_declare_sn_api_tx_to_blockifier_tx branch 2 times, most recently from 494a7f0 to e9b484e Compare October 31, 2024 12:00
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from 45c1c08 to cc6159d Compare October 31, 2024 12:01
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_reexecution_map_declare_sn_api_tx_to_blockifier_tx branch from e9b484e to 9b4dc89 Compare October 31, 2024 14:24
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch 2 times, most recently from ee896e2 to 65e5785 Compare October 31, 2024 14:30
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @aner-starkware and @AvivYossef-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

                Ok(Felt::default())
            }
            Err(e) => panic!("Unexpected error in get_storage_at: {:?}", e),

this isn't a bug in rpc state reader?

Code quote:

            Ok(value) => Ok(value),
            // If the contract address is not found, The blockifier expect to get the default value
            // of felt.
            Err(e) if e.to_string().contains("Contract address not found for request") => {
                Ok(Felt::default())
            }
            Err(e) => panic!("Unexpected error in get_storage_at: {:?}", e),

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_reexecution_map_declare_sn_api_tx_to_blockifier_tx branch from 9b4dc89 to a1245bd Compare October 31, 2024 15:18
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from 65e5785 to fc3e25f Compare October 31, 2024 15:18
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_reexecution_map_declare_sn_api_tx_to_blockifier_tx branch from a1245bd to 63e0d12 Compare October 31, 2024 15:19
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from fc3e25f to 067762c Compare October 31, 2024 15:19
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_reexecution_map_declare_sn_api_tx_to_blockifier_tx branch from 63e0d12 to f61947f Compare October 31, 2024 15:19
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from 067762c to 8d20b7f Compare October 31, 2024 15:20
Copy link
Contributor Author

@AvivYossef-starkware AvivYossef-starkware 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, 1 unresolved discussion (waiting on @aner-starkware and @dorimedini-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, dorimedini-starkware wrote…

this isn't a bug in rpc state reader?

My guess is that the gateway group is using papyrus. So they just receive 0 instead of an error when doing this request

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware 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, 1 unresolved discussion (waiting on @aner-starkware and @AvivYossef-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

My guess is that the gateway group is using papyrus. So they just receive 0 instead of an error when doing this request

who - other than us - is using the RPC reader, then?

Copy link
Contributor Author

@AvivYossef-starkware AvivYossef-starkware 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, 1 unresolved discussion (waiting on @aner-starkware and @dorimedini-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, dorimedini-starkware wrote…

who - other than us - is using the RPC reader, then?

The gateway group

@AvivYossef-starkware AvivYossef-starkware changed the base branch from aviv/blockifier_reexecution_map_declare_sn_api_tx_to_blockifier_tx to graphite-base/1698 October 31, 2024 15:53
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from 8d20b7f to 23ebe4a Compare October 31, 2024 16:18
@AvivYossef-starkware AvivYossef-starkware changed the base branch from graphite-base/1698 to main October 31, 2024 16:18
Copy link

Artifacts upload triggered. View details here

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @aner-starkware and @AvivYossef-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

The gateway group

no, you said the gateway group is using papyrus state reader. not the rpc reader...

  1. if the GW group are using the rpc reader, why do they allow the error behavior instead of returning zero like papyrus?
  2. if they are not using the rpc reader, who is?

Copy link
Contributor Author

@AvivYossef-starkware AvivYossef-starkware 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, 1 unresolved discussion (waiting on @aner-starkware and @dorimedini-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, dorimedini-starkware wrote…

no, you said the gateway group is using papyrus state reader. not the rpc reader...

  1. if the GW group are using the rpc reader, why do they allow the error behavior instead of returning zero like papyrus?
  2. if they are not using the rpc reader, who is?

The gateway group uses the RPC reader. Papyrus is also an RPC server, so they tested their RPC reader with Papyrus while we use the link to other RPC server

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from 23ebe4a to 8b1cceb Compare November 3, 2024 11:07
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @aner-starkware and @AvivYossef-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

The gateway group uses the RPC reader. Papyrus is also an RPC server, so they tested their RPC reader with Papyrus while we use the link to other RPC server

so the remote RPC returns an error where the papyrus reader returns zero?

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware 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, 1 unresolved discussion (waiting on @aner-starkware and @AvivYossef-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, dorimedini-starkware wrote…

so the remote RPC returns an error where the papyrus reader returns zero?

the papyrus server does not behave like the RPC server we use?

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from 8b1cceb to 7c85aac Compare November 3, 2024 11:31
Copy link
Contributor Author

@AvivYossef-starkware AvivYossef-starkware 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 1 files reviewed, 1 unresolved discussion (waiting on @aner-starkware and @dorimedini-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, dorimedini-starkware wrote…

the papyrus server does not behave like the RPC server we use?

That is what I thought at the beginning, but after first looking at the papyrus_rpc crate, I think that the papyrus RPC server returns an Error as well. I have a meeting with Yael tomorrow to understand it

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @aner-starkware and @AvivYossef-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

That is what I thought at the beginning, but after first looking at the papyrus_rpc crate, I think that the papyrus RPC server returns an Error as well. I have a meeting with Yael tomorrow to understand it

OK, keeping this blocked for now, because it changes the behavior of the client - I would like to understand why (if) we need it

Copy link
Contributor Author

@AvivYossef-starkware AvivYossef-starkware 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, 1 unresolved discussion (waiting on @aner-starkware and @dorimedini-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 59 at r1 (raw file):

Previously, dorimedini-starkware wrote…

OK, keeping this blocked for now, because it changes the behavior of the client - I would like to understand why (if) we need it

It changes the behavior of our wrapper; I didn't touch the gateway`s code

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/blockifier_fix_rpc_get_storage_bug branch from 9607af3 to 25ae07d Compare November 4, 2024 10:55
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @aner-starkware and @AvivYossef-starkware)


crates/blockifier_reexecution/src/state_reader/test_state_reader.rs line 75 at r5 (raw file):

            Err(e) if e.to_string().contains("Contract address not found for request") => {
                Ok(Felt::default())
            }

Suggestion:

            // TODO: Once the RPC state reader bug is fixed (CONTRACT_NOT_FOUND error should cause the
            //   reader to return the default felt), remove this `match` arm.
            Err(e) if e.to_string().contains("Contract address not found for request") => {
                Ok(Felt::default())
            }

@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants