-
Notifications
You must be signed in to change notification settings - Fork 332
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: Block type migrated to BlockResponse from Network trait (alloy) #492
Conversation
In certain functions, alloy return type was different from current implementation, so I did a temporary workaround, to convert the type from alloy, as changing our implementation includes further changes across the code If we want to be close to alloy, then we can add these changes as well |
ethereum/src/spec.rs
Outdated
@@ -36,6 +36,10 @@ impl NetworkSpec for Ethereum { | |||
} | |||
} | |||
|
|||
fn hash_block(block: &Self::BlockResponse) -> revm::primitives::B256 { | |||
block.header.hash_slow() |
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.
For this step we need to be a bit more careful than this to ensure that the header is consistent with the other values in the block. For example, are the transactions consistent with the transactions root? I think there may be some other things as well that could be out of sync.
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.
Have added the txs & withdrawal root verification now for both ethereum
& op-stack
opstack/src/spec.rs
Outdated
@@ -67,6 +69,10 @@ impl NetworkSpec for OpStack { | |||
} | |||
} | |||
|
|||
fn hash_block(block: &Self::BlockResponse) -> revm::primitives::B256 { | |||
block.header.hash_slow() |
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.
Same issue here on the consistency of the header with the rest of the block
…ement extra checks on the block
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.
LGTM
This PR migrates the custom
Block
type in core code to alloyBlockResponse
to make implementation generic over Block type, and enable integrations with L2s with custom fields to the block.Changes:
Block
andTransactions
removedBlockResponse
incore
crateTransactions
replaced withBlockTransactions
from alloyhash_block
on network trait for the networks to implement itethereum
&op-stack
to work with the new type and the method