chore: Block type migrated to BlockResponse from Network trait (alloy)#492
chore: Block type migrated to BlockResponse from Network trait (alloy)#492ncitron merged 3 commits intoa16z:masterfrom
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
| } | ||
|
|
||
| fn hash_block(block: &Self::BlockResponse) -> revm::primitives::B256 { | ||
| block.header.hash_slow() |
There was a problem hiding this comment.
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.
Have added the txs & withdrawal root verification now for both ethereum & op-stack
opstack/src/spec.rs
Outdated
| } | ||
|
|
||
| fn hash_block(block: &Self::BlockResponse) -> revm::primitives::B256 { | ||
| block.header.hash_slow() |
There was a problem hiding this comment.
Same issue here on the consistency of the header with the rest of the block
…ement extra checks on the block
This PR migrates the custom
Blocktype in core code to alloyBlockResponseto make implementation generic over Block type, and enable integrations with L2s with custom fields to the block.Changes:
BlockandTransactionsremovedBlockResponseincorecrateTransactionsreplaced withBlockTransactionsfrom alloyhash_blockon network trait for the networks to implement itethereum&op-stackto work with the new type and the method