Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(katana): commitment fields in block header #2560
feat(katana): commitment fields in block header #2560
Changes from 2 commits
b10f124
c1618a7
b3fe894
fb55875
6e2a8de
d022ef1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Suggestion: Rename
PartialHeader
toPendingHeader
for ConsistencyOhayo, sensei! The documentation comment at line 41 refers to a "pending block header," but the struct is still named
PartialHeader
. To maintain consistency and clarity, consider renaming the struct toPendingHeader
.Apply this diff to rename the struct:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
🚨 Issues Found: Missing Initialization of New
Header
FieldsOhayo, sensei! It looks like there are several instances where the new fields in the
Header
struct aren't being initialized properly. Please review and update the following locations to include all required fields:crates/saya/provider/src/rpc/mod.rs: header: Header {
crates/katana/storage/provider/tests/utils.rs: let header = Header { parent_hash, number: i, ..Default::default() };
crates/katana/storage/provider/tests/fixtures.rs: header: Header { number: i, ..Default::default() },
crates/katana/storage/provider/src/providers/db/mod.rs: let header = Header { parent_hash: 199u8.into(), number: 0, ..Default::default() };
crates/katana/core/src/backend/mod.rs: let header = Header { parent_hash, l1_gas_prices, l1_data_gas_prices, state_root: Felt::ZERO, number: block_env.number, timestamp: block_env.timestamp, l1_da_mode: L1DataAvailabilityMode::Calldata, sequencer_address: block_env.sequencer_address, protocol_version: self.chain_spec.version.clone(), };
crates/katana/core/src/backend/storage.rs: header: Header { parent_hash: Felt::ZERO, number: 1, l1_gas_prices: GasPrices::default(), l1_data_gas_prices: GasPrices::default(), l1_da_mode: L1DataAvailabilityMode::Calldata, timestamp: 123456, ..Default::default() }
crates/katana/executor/tests/fixtures/mod.rs: header: PartialHeader { protocol_version: protocol_version.clone(), number: 1, timestamp: 100, sequencer_address, parent_hash: 123u64.into(), l1_gas_prices: gas_prices.clone(), l1_data_gas_prices: gas_prices.clone(), l1_da_mode: L1DataAvailabilityMode::Calldata, },
crates/katana/executor/tests/fixtures/mod.rs: header: PartialHeader { protocol_version: protocol_version.clone(), number: 2, timestamp: 200, sequencer_address, parent_hash: 1234u64.into(), l1_gas_prices: gas_prices.clone(), l1_data_gas_prices: gas_prices.clone(), l1_da_mode: L1DataAvailabilityMode::Calldata, },
crates/katana/executor/tests/fixtures/mod.rs: header: PartialHeader { protocol_version: protocol_version, number: 3, timestamp: 300, sequencer_address, parent_hash: 12345u64.into(), l1_gas_prices: gas_prices.clone(), l1_data_gas_prices: gas_prices.clone(), l1_da_mode: L1DataAvailabilityMode::Calldata, },
Please ensure that all
Header
initializations include the new fields to maintain consistency and avoid potential runtime issues.🔗 Analysis chain
Verify Initialization of New Fields in
Header
Ohayo, sensei! The added fields in the
Header
struct enhance the block header's data representation. Please ensure that these new fields are properly initialized and computed throughout the codebase whereHeader
is used.To check for proper initialization and usage of the new fields, you can run:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 22799
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Appropriate Default Values for New Fields
Ohayo, sensei! In the
Default
implementation forHeader
, the new fields are initialized with default values. Please confirm that these defaults align with the expected initial state to prevent any unintended behavior.If necessary, adjust the default values to match the intended use cases of these fields.