reth
reth copied to clipboard
Complete optimism mainnet forkid tests
We have a comprehensive set of tests for the mainnet and testnet forkids, including some optimism network tests: https://github.com/paradigmxyz/reth/blob/3d28a69134daa4f7ea1de004692f2630db152774/crates/primitives/src/chain/spec.rs#L2443-L2472
We should also add these for optimism mainnet, so we have forkid tests for all of the optimism networks covered.
Note: I just added a very basic, non-comprehensive test for this. The test now just needs to be completed with the other forks!
I'd like to work on this
Where can I find the block numbers for the forks? Found timestamps here: https://specs.optimism.io/protocol/superchain-upgrades.html#activation-timestamps
By knowing the block number I can find the Bedrock upgrade https://optimistic.etherscan.io/block/105235063
Where can I find the block numbers for the forks? Found timestamps here: https://specs.optimism.io/protocol/superchain-upgrades.html#activation-timestamps
By knowing the block number I can find the Bedrock upgrade https://optimistic.etherscan.io/block/105235063
yes, those should be correct, also take a look at the OP_MAINNET chainspec for the proper block and timestamp values. Just assigned!
I can only see the timestamps and not the blocks in the chainspec
https://github.com/paradigmxyz/reth/blob/3d28a69134daa4f7ea1de004692f2630db152774/crates/primitives/src/chain/spec.rs#L297-L300
Also, do you want forkid tests for all hardforks or just Canyon, Delta and Ecotone?
some hardforks are only conditioned on the timestamp and not the block number which is why some of them do not have a block number:)
I've added the forks as test cases, but I'm stuck on computing ForkHash and next for Canyon and Delta
https://github.com/paradigmxyz/reth/pull/8114
Computed fork ID is not computed correctly for Canyon and Delta:
assertion `left == right` failed: Expected fork ID ForkId { hash: ForkHash("00000000"), next: 1708560000 }, computed fork ID ForkId { hash: ForkHash("caf517ed"), next: 3950000 } at block 0
left: ForkId { hash: ForkHash("00000000"), next: 1708560000 }
right: ForkId { hash: ForkHash("caf517ed"), next: 3950000 }
Is the forkhash supposed to be 00000000, do you have a source on that? That sounds incorrect
left some comments in reviews, let's move there