Skip to content

Commit

Permalink
Optimism canyon (#6374)
Browse files Browse the repository at this point in the history
* Receipts

* Create2Deployer

* Fix null value

* Refactor 1559

* Canyon eip 1559

* Refactor

* MarkAsFailed

* Revert TxProcessor

* Fix tests

* Fix tests

* decoder

* Fix configs

* base-goerli regolith timestamp

* Fix elasticity multiplier

* Check tx type
  • Loading branch information
deffrian authored Jan 1, 2024
1 parent 344c568 commit 6f2698c
Show file tree
Hide file tree
Showing 32 changed files with 379 additions and 73 deletions.
15 changes: 13 additions & 2 deletions src/Nethermind/Chains/base-goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
"engine": {
"Optimism": {
"params": {
"regolithTimestamp": "0x0",
"bedrockBlockNumber": "0x0"
"regolithTimestamp": "0x6453E490",
"bedrockBlockNumber": "0x0",
"canyonTimestamp": "0x6553a790",
"l1FeeRecipient": "0x420000000000000000000000000000000000001A",
"l1BlockAddress": "0x4200000000000000000000000000000000000015",
"canyonBaseFeeChangeDenominator": "250",
"create2DeployerAddress": "0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2",
"create2DeployerCode": "6080604052600436106100435760003560e01c8063076c37b21461004f578063481286e61461007157806356299481146100ba57806366cfa057146100da57600080fd5b3661004a57005b600080fd5b34801561005b57600080fd5b5061006f61006a366004610327565b6100fa565b005b34801561007d57600080fd5b5061009161008c366004610327565b61014a565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100c657600080fd5b506100916100d5366004610349565b61015d565b3480156100e657600080fd5b5061006f6100f53660046103ca565b610172565b61014582826040518060200161010f9061031a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604052610183565b505050565b600061015683836102e7565b9392505050565b600061016a8484846102f0565b949350505050565b61017d838383610183565b50505050565b6000834710156101f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e636500000060448201526064015b60405180910390fd5b815160000361025f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f60448201526064016101eb565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116610156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f790000000000000060448201526064016101eb565b60006101568383305b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b61014e806104ad83390190565b6000806040838503121561033a57600080fd5b50508035926020909101359150565b60008060006060848603121561035e57600080fd5b8335925060208401359150604084013573ffffffffffffffffffffffffffffffffffffffff8116811461039057600080fd5b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156103df57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561040557600080fd5b818601915086601f83011261041957600080fd5b81358181111561042b5761042b61039b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156104715761047161039b565b8160405282815289602084870101111561048a57600080fd5b826020860160208301376000602084830101528095505050505050925092509256fe608060405234801561001057600080fd5b5061012e806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063249cb3fa14602d575b600080fd5b603c603836600460b1565b604e565b60405190815260200160405180910390f35b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16608857600060aa565b7fa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848f4b45b9392505050565b6000806040838503121560c357600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff8116811460ed57600080fd5b80915050925092905056fea26469706673582212205ffd4e6cede7d06a5daf93d48d0541fc68189eeb16608c1999a82063b666eb1164736f6c63430008130033a2646970667358221220fdc4a0fe96e3b21c108ca155438d37c9143fb01278a3c1d274948bad89c564ba64736f6c63430008130033"
}
}
},
Expand Down Expand Up @@ -45,6 +51,11 @@
"eip3529Transition": "0x0",
"eip3541Transition": "0x0",

"eip4895TransitionTimestamp": "0x6553a790",
"eip3651TransitionTimestamp": "0x6553a790",
"eip3855TransitionTimestamp": "0x6553a790",
"eip3860TransitionTimestamp": "0x6553a790",

"terminalTotalDifficulty": "0"
},
"genesis": {
Expand Down
13 changes: 12 additions & 1 deletion src/Nethermind/Chains/base-sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
"Optimism": {
"params": {
"regolithTimestamp": "0x0",
"bedrockBlockNumber": "0x0"
"bedrockBlockNumber": "0x0",
"canyonTimestamp": "0x6553a790",
"l1FeeRecipient": "0x420000000000000000000000000000000000001A",
"l1BlockAddress": "0x4200000000000000000000000000000000000015",
"canyonBaseFeeChangeDenominator": "250",
"create2DeployerAddress": "0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2",
"create2DeployerCode": "6080604052600436106100435760003560e01c8063076c37b21461004f578063481286e61461007157806356299481146100ba57806366cfa057146100da57600080fd5b3661004a57005b600080fd5b34801561005b57600080fd5b5061006f61006a366004610327565b6100fa565b005b34801561007d57600080fd5b5061009161008c366004610327565b61014a565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100c657600080fd5b506100916100d5366004610349565b61015d565b3480156100e657600080fd5b5061006f6100f53660046103ca565b610172565b61014582826040518060200161010f9061031a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604052610183565b505050565b600061015683836102e7565b9392505050565b600061016a8484846102f0565b949350505050565b61017d838383610183565b50505050565b6000834710156101f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e636500000060448201526064015b60405180910390fd5b815160000361025f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f60448201526064016101eb565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116610156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f790000000000000060448201526064016101eb565b60006101568383305b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b61014e806104ad83390190565b6000806040838503121561033a57600080fd5b50508035926020909101359150565b60008060006060848603121561035e57600080fd5b8335925060208401359150604084013573ffffffffffffffffffffffffffffffffffffffff8116811461039057600080fd5b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156103df57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561040557600080fd5b818601915086601f83011261041957600080fd5b81358181111561042b5761042b61039b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156104715761047161039b565b8160405282815289602084870101111561048a57600080fd5b826020860160208301376000602084830101528095505050505050925092509256fe608060405234801561001057600080fd5b5061012e806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063249cb3fa14602d575b600080fd5b603c603836600460b1565b604e565b60405190815260200160405180910390f35b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16608857600060aa565b7fa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848f4b45b9392505050565b6000806040838503121560c357600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff8116811460ed57600080fd5b80915050925092905056fea26469706673582212205ffd4e6cede7d06a5daf93d48d0541fc68189eeb16608c1999a82063b666eb1164736f6c63430008130033a2646970667358221220fdc4a0fe96e3b21c108ca155438d37c9143fb01278a3c1d274948bad89c564ba64736f6c63430008130033"
}
}
},
Expand Down Expand Up @@ -45,6 +51,11 @@
"eip3529Transition": "0x0",
"eip3541Transition": "0x0",

"eip4895TransitionTimestamp": "0x6553a790",
"eip3651TransitionTimestamp": "0x6553a790",
"eip3855TransitionTimestamp": "0x6553a790",
"eip3860TransitionTimestamp": "0x6553a790",

"terminalTotalDifficulty": "0"
},
"genesis": {
Expand Down
11 changes: 10 additions & 1 deletion src/Nethermind/Chains/op-goerli.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
"params": {
"regolithTimestamp": "0x6414B8B0",
"bedrockBlockNumber": "0x0",
"canyonTimestamp": "0x6553a790",
"l1FeeRecipient": "0x420000000000000000000000000000000000001A",
"l1BlockAddress": "0x4200000000000000000000000000000000000015"
"l1BlockAddress": "0x4200000000000000000000000000000000000015",
"canyonBaseFeeChangeDenominator": "250",
"create2DeployerAddress": "0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2",
"create2DeployerCode": "6080604052600436106100435760003560e01c8063076c37b21461004f578063481286e61461007157806356299481146100ba57806366cfa057146100da57600080fd5b3661004a57005b600080fd5b34801561005b57600080fd5b5061006f61006a366004610327565b6100fa565b005b34801561007d57600080fd5b5061009161008c366004610327565b61014a565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100c657600080fd5b506100916100d5366004610349565b61015d565b3480156100e657600080fd5b5061006f6100f53660046103ca565b610172565b61014582826040518060200161010f9061031a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604052610183565b505050565b600061015683836102e7565b9392505050565b600061016a8484846102f0565b949350505050565b61017d838383610183565b50505050565b6000834710156101f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e636500000060448201526064015b60405180910390fd5b815160000361025f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f60448201526064016101eb565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116610156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f790000000000000060448201526064016101eb565b60006101568383305b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b61014e806104ad83390190565b6000806040838503121561033a57600080fd5b50508035926020909101359150565b60008060006060848603121561035e57600080fd5b8335925060208401359150604084013573ffffffffffffffffffffffffffffffffffffffff8116811461039057600080fd5b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156103df57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561040557600080fd5b818601915086601f83011261041957600080fd5b81358181111561042b5761042b61039b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156104715761047161039b565b8160405282815289602084870101111561048a57600080fd5b826020860160208301376000602084830101528095505050505050925092509256fe608060405234801561001057600080fd5b5061012e806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063249cb3fa14602d575b600080fd5b603c603836600460b1565b604e565b60405190815260200160405180910390f35b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16608857600060aa565b7fa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848f4b45b9392505050565b6000806040838503121560c357600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff8116811460ed57600080fd5b80915050925092905056fea26469706673582212205ffd4e6cede7d06a5daf93d48d0541fc68189eeb16608c1999a82063b666eb1164736f6c63430008130033a2646970667358221220fdc4a0fe96e3b21c108ca155438d37c9143fb01278a3c1d274948bad89c564ba64736f6c63430008130033"
}
}
},
Expand Down Expand Up @@ -52,6 +56,11 @@
"eip3529Transition": "0x3df828",
"eip3541Transition": "0x3df828",

"eip4895TransitionTimestamp": "0x6553a790",
"eip3651TransitionTimestamp": "0x6553a790",
"eip3855TransitionTimestamp": "0x6553a790",
"eip3860TransitionTimestamp": "0x6553a790",

"terminalTotalDifficulty": "0"
},
"genesis": {
Expand Down
15 changes: 13 additions & 2 deletions src/Nethermind/Chains/op-sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
"Optimism": {
"params": {
"regolithTimestamp": "0x0",
"bedrockBlockNumber": "0x0"
"bedrockBlockNumber": "0x0",
"canyonTimestamp": "0x6553a790",
"l1FeeRecipient": "0x420000000000000000000000000000000000001A",
"l1BlockAddress": "0x4200000000000000000000000000000000000015",
"canyonBaseFeeChangeDenominator": "250",
"create2DeployerAddress": "0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2",
"create2DeployerCode": "6080604052600436106100435760003560e01c8063076c37b21461004f578063481286e61461007157806356299481146100ba57806366cfa057146100da57600080fd5b3661004a57005b600080fd5b34801561005b57600080fd5b5061006f61006a366004610327565b6100fa565b005b34801561007d57600080fd5b5061009161008c366004610327565b61014a565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100c657600080fd5b506100916100d5366004610349565b61015d565b3480156100e657600080fd5b5061006f6100f53660046103ca565b610172565b61014582826040518060200161010f9061031a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604052610183565b505050565b600061015683836102e7565b9392505050565b600061016a8484846102f0565b949350505050565b61017d838383610183565b50505050565b6000834710156101f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e636500000060448201526064015b60405180910390fd5b815160000361025f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f60448201526064016101eb565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116610156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f790000000000000060448201526064016101eb565b60006101568383305b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b61014e806104ad83390190565b6000806040838503121561033a57600080fd5b50508035926020909101359150565b60008060006060848603121561035e57600080fd5b8335925060208401359150604084013573ffffffffffffffffffffffffffffffffffffffff8116811461039057600080fd5b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000806000606084860312156103df57600080fd5b8335925060208401359150604084013567ffffffffffffffff8082111561040557600080fd5b818601915086601f83011261041957600080fd5b81358181111561042b5761042b61039b565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019083821181831017156104715761047161039b565b8160405282815289602084870101111561048a57600080fd5b826020860160208301376000602084830101528095505050505050925092509256fe608060405234801561001057600080fd5b5061012e806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063249cb3fa14602d575b600080fd5b603c603836600460b1565b604e565b60405190815260200160405180910390f35b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16608857600060aa565b7fa2ef4600d742022d532d4747cb3547474667d6f13804902513b2ec01c848f4b45b9392505050565b6000806040838503121560c357600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff8116811460ed57600080fd5b80915050925092905056fea26469706673582212205ffd4e6cede7d06a5daf93d48d0541fc68189eeb16608c1999a82063b666eb1164736f6c63430008130033a2646970667358221220fdc4a0fe96e3b21c108ca155438d37c9143fb01278a3c1d274948bad89c564ba64736f6c63430008130033"
}
}
},
Expand Down Expand Up @@ -39,12 +45,17 @@
"eip1559Transition": "0x0",
"eip1559FeeCollectorTransition": "0x0",
"eip1559FeeCollector": "0x4200000000000000000000000000000000000019",
"eip1559ElasticityMultiplier": "0xa",
"eip1559ElasticityMultiplier": "0x6",
"eip1559BaseFeeMaxChangeDenominator": "0x32",
"eip3198Transition": "0x0",
"eip3529Transition": "0x0",
"eip3541Transition": "0x0",

"eip4895TransitionTimestamp": "0x6553a790",
"eip3651TransitionTimestamp": "0x6553a790",
"eip3855TransitionTimestamp": "0x6553a790",
"eip3860TransitionTimestamp": "0x6553a790",

"terminalTotalDifficulty": "0"
},
"genesis": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public async Task BlockProducer_returns_correct_fork_base_fee()
.WithEip1559TransitionBlock(7)
.CreateTestBlockchain()
.BlocksBeforeTransitionShouldHaveZeroBaseFee()
.AssertNewBlock(Eip1559Constants.ForkBaseFee);
.AssertNewBlock(Eip1559Constants.DefaultForkBaseFee);
await scenario.Finish();
}

Expand All @@ -266,7 +266,7 @@ public async Task BlockProducer_returns_correctly_decreases_base_fee_on_empty_bl
.WithEip1559TransitionBlock(6)
.CreateTestBlockchain()
.BlocksBeforeTransitionShouldHaveZeroBaseFee()
.AssertNewBlock(Eip1559Constants.ForkBaseFee)
.AssertNewBlock(Eip1559Constants.DefaultForkBaseFee)
.AssertNewBlock(875000000)
.AssertNewBlock(765625000)
.AssertNewBlock(669921875)
Expand All @@ -283,7 +283,7 @@ public async Task BaseFee_should_decrease_when_we_send_transactions_below_gas_ta
.CreateTestBlockchain(gasLimit)
.DeployContract()
.BlocksBeforeTransitionShouldHaveZeroBaseFee()
.AssertNewBlock(Eip1559Constants.ForkBaseFee)
.AssertNewBlock(Eip1559Constants.DefaultForkBaseFee)
.SendLegacyTransaction(gasLimit / 3, 20.GWei())
.SendEip1559Transaction(gasLimit / 3, 1.GWei(), 20.GWei())
.AssertNewBlock(875000000)
Expand All @@ -301,7 +301,7 @@ public async Task BaseFee_should_not_change_when_we_send_transactions_equal_gas_
.CreateTestBlockchain(gasTarget)
.DeployContract()
.BlocksBeforeTransitionShouldHaveZeroBaseFee()
.AssertNewBlock(Eip1559Constants.ForkBaseFee)
.AssertNewBlock(Eip1559Constants.DefaultForkBaseFee)
.SendLegacyTransaction(gasTarget / 2, 20.GWei())
.SendEip1559Transaction(gasTarget / 2, 1.GWei(), 20.GWei())
.AssertNewBlock(875000000)
Expand All @@ -319,7 +319,7 @@ public async Task BaseFee_should_increase_when_we_send_transactions_above_gas_ta
.CreateTestBlockchain(gasTarget)
.DeployContract()
.BlocksBeforeTransitionShouldHaveZeroBaseFee()
.AssertNewBlock(Eip1559Constants.ForkBaseFee)
.AssertNewBlock(Eip1559Constants.DefaultForkBaseFee)
.SendLegacyTransaction(gasTarget / 2, 20.GWei())
.SendEip1559Transaction(gasTarget / 2, 1.GWei(), 20.GWei())
.SendLegacyTransaction(gasTarget / 2, 20.GWei())
Expand All @@ -337,7 +337,7 @@ public async Task When_base_fee_decreases_previously_fee_too_low_transaction_is_
.WithEip1559TransitionBlock(6)
.CreateTestBlockchain(gasTarget)
.BlocksBeforeTransitionShouldHaveZeroBaseFee()
.AssertNewBlock(Eip1559Constants.ForkBaseFee)
.AssertNewBlock(Eip1559Constants.DefaultForkBaseFee)
.SendLegacyTransaction(gasTarget / 2, 7.GWei() / 10, nonce: UInt256.Zero)
.AssertNewBlock(875000000)
.AssertNewBlock(765625000)
Expand Down
Loading

0 comments on commit 6f2698c

Please sign in to comment.