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(starknet_state_sync): verify contract deployed at get storage/nonce #2963

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

noamsp-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

noamsp-starkware commented Dec 25, 2024

Copy link
Contributor

@eitanm-starkware eitanm-starkware 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 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ShahakShama)

Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noamsp-starkware)


crates/starknet_state_sync/src/lib.rs line 111 at r1 (raw file):

        let state_number = StateNumber::unchecked_right_after_block(block_number);
        let state_reader = txn.get_state_reader()?;

add newline between creating the state reader and running the call to get_storage_at


crates/starknet_state_sync/src/lib.rs line 113 at r1 (raw file):

        let state_reader = txn.get_state_reader()?;
        let res = state_reader.get_storage_at(state_number, &contract_address, &storage_key)?;
        verify_contract_deployed(&state_reader, state_number, contract_address)?;

Move this before the call to get_storage_at


crates/starknet_state_sync/src/lib.rs line 128 at r1 (raw file):

        let state_number = StateNumber::unchecked_right_after_block(block_number);
        let state_reader = txn.get_state_reader()?;
        let res = state_reader

Same as above


crates/starknet_state_sync/src/lib.rs line 131 at r1 (raw file):

            .get_nonce_at(state_number, &contract_address)?
            .ok_or(StateSyncError::ContractNotFound(contract_address))?;
        verify_contract_deployed(&state_reader, state_number, contract_address)?;

Same as above

@noamsp-starkware noamsp-starkware force-pushed the noam.s/state_sync_verify_contract_deployed branch from c2267ac to 367bc61 Compare December 26, 2024 11:52
@noamsp-starkware noamsp-starkware changed the base branch from noam.s/state_sync_fix_compiled_class_marker_verify to main December 26, 2024 11:52
Copy link

Artifacts upload workflows:

Copy link
Contributor

@ShahakShama ShahakShama 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 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noamsp-starkware)

@noamsp-starkware noamsp-starkware added this pull request to the merge queue Dec 26, 2024
Merged via the queue into main with commit 4a95470 Dec 26, 2024
21 of 27 checks passed
@noamsp-starkware noamsp-starkware deleted the noam.s/state_sync_verify_contract_deployed branch December 26, 2024 13:14
@noamsp-starkware noamsp-starkware restored the noam.s/state_sync_verify_contract_deployed branch December 26, 2024 13:17
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2024
@noamsp-starkware noamsp-starkware deleted the noam.s/state_sync_verify_contract_deployed branch December 31, 2024 09:08
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.

4 participants