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

feat(starknet_state_sync_types): add BlockInfo to SyncBlock #2927

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

eitanm-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@eitanm-starkware eitanm-starkware force-pushed the eitan/add_blockinfo_to_syncblock branch 2 times, most recently from cf77aa9 to f14d7fe Compare December 24, 2024 14:38
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 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @eitanm-starkware)


crates/starknet_state_sync_types/src/state_sync_types.rs line 19 at r1 (raw file):

#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SyncBlock {
    pub state_diff: ThinStateDiff,

Put this at the bottom, or put transaction_hashes at the top right below state_diff


crates/papyrus_p2p_sync/src/client/header.rs line 136 at r1 (raw file):

                    timestamp: sync_block.block_timestamp,
                    l1_da_mode: sync_block.l1_da_mode,
                    sequencer: sync_block.sequencer_address,

Call this sequencer if in starknet api it's called sequencer


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

    fn get_block(&self, block_number: BlockNumber) -> StateSyncResult<Option<SyncBlock>> {
        let txn = self.storage_reader.begin_ro_txn()?;
        let block_header = txn.get_block_header(block_number)?;

Nice. I see you looked at the video I sent this morning :)


crates/starknet_batcher/src/batcher.rs line 388 at r1 (raw file):

        }

        let SyncBlock { state_diff, transaction_hashes, block_number, .. } = sync_block;

Add a TODO on @alonh5 to use the extra data

@eitanm-starkware eitanm-starkware force-pushed the eitan/add_blockinfo_to_syncblock branch from f14d7fe to d9bfa2e Compare December 24, 2024 14:52
Copy link
Contributor Author

@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.

Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @alon and @ShahakShama)


crates/papyrus_p2p_sync/src/client/header.rs line 136 at r1 (raw file):

Previously, ShahakShama wrote…

Call this sequencer if in starknet api it's called sequencer

Done.


crates/starknet_batcher/src/batcher.rs line 388 at r1 (raw file):

Previously, ShahakShama wrote…

Add a TODO on @alonh5 to use the extra data

Done.


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

Previously, ShahakShama wrote…

Nice. I see you looked at the video I sent this morning :)

;)

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 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alon and @eitanm-starkware)


crates/papyrus_p2p_sync/src/client/header.rs line 136 at r1 (raw file):

Previously, eitanm-starkware wrote…

Done.

I don't see it. Forgot to push?


crates/starknet_batcher/src/batcher.rs line 388 at r1 (raw file):

Previously, eitanm-starkware wrote…

Done.

I don't see it. Forgot to push?

@eitanm-starkware eitanm-starkware force-pushed the eitan/add_blockinfo_to_syncblock branch from d9bfa2e to b056c47 Compare December 24, 2024 15:23
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 5 of 5 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @eitanm-starkware)

Copy link
Collaborator

@alonh5 alonh5 left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 5 files at r1, 3 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @eitanm-starkware)


crates/starknet_batcher/src/batcher_test.rs line 529 at r1 (raw file):

        block_number: INITIAL_HEIGHT.unchecked_next(),
        state_diff: Default::default(),
        transaction_hashes: Default::default(),

crates/starknet_state_sync_types/src/state_sync_types.rs line 23 at r3 (raw file):

    pub transaction_hashes: Vec<TransactionHash>,

    pub block_number: BlockNumber,

Why not use the BlockInfo struct that contains all of these?

@eitanm-starkware eitanm-starkware force-pushed the eitan/add_blockinfo_to_syncblock branch from b056c47 to b575e4b Compare December 24, 2024 16:06
Copy link
Contributor Author

@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.

Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @alonh5 and @ShahakShama)


crates/starknet_state_sync_types/src/state_sync_types.rs line 23 at r3 (raw file):

Previously, alonh5 (Alon Haramati) wrote…

Why not use the BlockInfo struct that contains all of these?

Currently, because of the nonzerogasprice - blockinfo uses it while storage and sync dont. @ShahakShama had some longer term reasons as well from what i gathered.

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 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5)


crates/starknet_state_sync_types/src/state_sync_types.rs line 23 at r3 (raw file):

Previously, eitanm-starkware wrote…

Currently, because of the nonzerogasprice - blockinfo uses it while storage and sync dont. @ShahakShama had some longer term reasons as well from what i gathered.

Yes. We want to be able to return zero gas prices if the header has zero gas prices
long term - SyncBlock should contain the entire header

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.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5)

Copy link
Collaborator

@alonh5 alonh5 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 @eitanm-starkware)


crates/starknet_state_sync_types/src/state_sync_types.rs line 23 at r3 (raw file):

Previously, ShahakShama wrote…

Yes. We want to be able to return zero gas prices if the header has zero gas prices
long term - SyncBlock should contain the entire header

After talking f2f, please check if we can use gas price 1.

@eitanm-starkware eitanm-starkware force-pushed the eitan/add_blockinfo_to_syncblock branch from b575e4b to 368475b Compare December 25, 2024 14:28
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 6 of 6 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @eitanm-starkware)

Copy link
Contributor

@matan-starkware matan-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 6 of 6 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @eitanm-starkware)

Copy link
Collaborator

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

@ShahakShama ShahakShama added this pull request to the merge queue Dec 26, 2024
Merged via the queue into main with commit 8bc7599 Dec 26, 2024
15 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 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.

5 participants