From b3f13d06ea2886f5259b97c8004322b6cef1520e Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Mon, 25 Nov 2024 12:37:25 +0100 Subject: [PATCH 1/3] Update op-geth --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 30567fb101fa..db3ac9c62193 100644 --- a/go.mod +++ b/go.mod @@ -257,7 +257,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101408.1-0.20241011074051-d8e6791dbc37 +replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101408.1-0.20241129112120-a102e49b89c3 // replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index 7b1264f5fe26..028af1369b20 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,8 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/celo-org/op-geth v1.101408.1-0.20241011074051-d8e6791dbc37 h1:vOpdVeAT5E+6jfvsTlyFfUwUW7r0gM/EJLi/YzfLPXQ= -github.com/celo-org/op-geth v1.101408.1-0.20241011074051-d8e6791dbc37/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac= +github.com/celo-org/op-geth v1.101408.1-0.20241129112120-a102e49b89c3 h1:B0zdGButiL94J1Sn2hJ23KnEWPoVZgjLL6T801uaCqU= +github.com/celo-org/op-geth v1.101408.1-0.20241129112120-a102e49b89c3/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= From 925cc6475814c410687756a186b8726a2f5729cf Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Mon, 25 Nov 2024 15:26:36 +0100 Subject: [PATCH 2/3] Update migration config for baklava --- op-chain-ops/cmd/celo-migrate/state.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/op-chain-ops/cmd/celo-migrate/state.go b/op-chain-ops/cmd/celo-migrate/state.go index 5c029c8453b0..f1797c910cbd 100644 --- a/op-chain-ops/cmd/celo-migrate/state.go +++ b/op-chain-ops/cmd/celo-migrate/state.go @@ -80,12 +80,18 @@ var ( // CreateX common.HexToAddress("0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed"): false, }, + BaklavaNetworkID: { + // DeterministicDeploymentProxy + common.HexToAddress("0x4e59b44847b379578588920cA78FbF26c0B4956C"): false, + }, } unreleasedTreasuryAddressMap = map[uint64]common.Address{ AlfajoresNetworkID: common.HexToAddress("0x07bf0b2461A0cb608D5CF9a82ba97dAbA850F79F"), + BaklavaNetworkID: common.HexToAddress("0x022c5d5837E177B6d145761feb4C5574e5b48F5e"), } celoTokenAddressMap = map[uint64]common.Address{ AlfajoresNetworkID: addresses.CeloTokenAlfajoresAddress, + BaklavaNetworkID: addresses.CeloTokenBaklavaAddress, MainnetNetworkID: addresses.CeloTokenAddress, } ) From a00348e9ad1cd32e42dd942c82ac5055bf60cc2c Mon Sep 17 00:00:00 2001 From: Paul Lange Date: Tue, 26 Nov 2024 10:09:45 +0100 Subject: [PATCH 3/3] Fix build --- cannon/mipsevm/testutil/evm.go | 4 +++- op-chain-ops/cmd/op-simulate/main.go | 3 ++- op-e2e/actions/helpers/l1_miner.go | 6 ++++-- op-program/client/l2/engineapi/block_processor.go | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cannon/mipsevm/testutil/evm.go b/cannon/mipsevm/testutil/evm.go index dbe9970fdc24..d34b778aa645 100644 --- a/cannon/mipsevm/testutil/evm.go +++ b/cannon/mipsevm/testutil/evm.go @@ -100,7 +100,9 @@ func NewEVMEnv(contracts *ContractMetadata) (*vm.EVM, *state.StateDB) { if err != nil { panic(fmt.Errorf("failed to create memory state db: %w", err)) } - blockContext := core.NewEVMBlockContext(header, bc, nil, chainCfg, state) + + feeCurrencyContext := core.GetFeeCurrencyContext(header, chainCfg, state) + blockContext := core.NewEVMBlockContext(header, bc, nil, chainCfg, state, feeCurrencyContext) vmCfg := vm.Config{} env := vm.NewEVM(blockContext, vm.TxContext{}, state, chainCfg, vmCfg) diff --git a/op-chain-ops/cmd/op-simulate/main.go b/op-chain-ops/cmd/op-simulate/main.go index 8b0986e4554f..19f4cb41a6ae 100644 --- a/op-chain-ops/cmd/op-simulate/main.go +++ b/op-chain-ops/cmd/op-simulate/main.go @@ -294,7 +294,8 @@ func simulate(ctx context.Context, logger log.Logger, conf *params.ChainConfig, // run the transaction start := time.Now() - receipt, err := core.ApplyTransaction(conf, cCtx, &sender, &gp, state, header, tx, &usedGas, vmConfig) + feeCurrencyContext := core.GetFeeCurrencyContext(header, conf, state) + receipt, err := core.ApplyTransaction(conf, cCtx, &sender, &gp, state, header, tx, &usedGas, vmConfig, feeCurrencyContext) if err != nil { return fmt.Errorf("failed to apply tx: %w", err) } diff --git a/op-e2e/actions/helpers/l1_miner.go b/op-e2e/actions/helpers/l1_miner.go index 5fe5c762d5c9..e4675a246305 100644 --- a/op-e2e/actions/helpers/l1_miner.go +++ b/op-e2e/actions/helpers/l1_miner.go @@ -110,7 +110,8 @@ func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action { // TODO(client-pod#826) // Unfortunately this is not part of any Geth environment setup, // we just have to apply it, like how the Geth block-builder worker does. - context := core.NewEVMBlockContext(header, s.l1Chain, nil, s.l1Chain.Config(), statedb) + feeCurrencyContext := core.GetFeeCurrencyContext(header, s.l1Chain.Config(), statedb) + context := core.NewEVMBlockContext(header, s.l1Chain, nil, s.l1Chain.Config(), statedb, feeCurrencyContext) // NOTE: Unlikely to be needed for the beacon block root, but we setup any precompile overrides anyways for forwards-compatibility var precompileOverrides vm.PrecompileOverrides if vmConfig := s.l1Chain.GetVMConfig(); vmConfig != nil && vmConfig.PrecompileOverrides != nil { @@ -176,8 +177,9 @@ func (s *L1Miner) IncludeTx(t Testing, tx *types.Transaction) { return } s.l1BuildingState.SetTxContext(tx.Hash(), len(s.L1Transactions)) + feeCurrencyContext := core.GetFeeCurrencyContext(s.l1BuildingHeader, s.l1Cfg.Config, s.l1BuildingState) receipt, err := core.ApplyTransaction(s.l1Cfg.Config, s.l1Chain, &s.l1BuildingHeader.Coinbase, - s.L1GasPool, s.l1BuildingState, s.l1BuildingHeader, tx.WithoutBlobTxSidecar(), &s.l1BuildingHeader.GasUsed, *s.l1Chain.GetVMConfig()) + s.L1GasPool, s.l1BuildingState, s.l1BuildingHeader, tx.WithoutBlobTxSidecar(), &s.l1BuildingHeader.GasUsed, *s.l1Chain.GetVMConfig(), feeCurrencyContext) if err != nil { s.l1TxFailed = append(s.l1TxFailed, tx) t.Fatalf("failed to apply transaction to L1 block (tx %d): %v", len(s.L1Transactions), err) diff --git a/op-program/client/l2/engineapi/block_processor.go b/op-program/client/l2/engineapi/block_processor.go index 2e6cc5beade4..5798b317e5db 100644 --- a/op-program/client/l2/engineapi/block_processor.go +++ b/op-program/client/l2/engineapi/block_processor.go @@ -83,7 +83,8 @@ func NewBlockProcessorFromHeader(provider BlockDataProvider, h *types.Header) (* if h.ParentBeaconRoot != nil { // Unfortunately this is not part of any Geth environment setup, // we just have to apply it, like how the Geth block-builder worker does. - context := core.NewEVMBlockContext(header, provider, nil, provider.Config(), statedb) + feeCurrencyContext := core.GetFeeCurrencyContext(header, provider.Config(), statedb) + context := core.NewEVMBlockContext(header, provider, nil, provider.Config(), statedb, feeCurrencyContext) // NOTE: Unlikely to be needed for the beacon block root, but we setup any precompile overrides anyways for forwards-compatibility var precompileOverrides vm.PrecompileOverrides if vmConfig := provider.GetVMConfig(); vmConfig != nil && vmConfig.PrecompileOverrides != nil { @@ -113,8 +114,9 @@ func (b *BlockProcessor) CheckTxWithinGasLimit(tx *types.Transaction) error { func (b *BlockProcessor) AddTx(tx *types.Transaction) error { txIndex := len(b.transactions) b.state.SetTxContext(tx.Hash(), txIndex) + feeCurrencyContext := core.GetFeeCurrencyContext(b.header, b.dataProvider.Config(), b.state) receipt, err := core.ApplyTransaction(b.dataProvider.Config(), b.dataProvider, &b.header.Coinbase, - b.gasPool, b.state, b.header, tx, &b.header.GasUsed, *b.dataProvider.GetVMConfig()) + b.gasPool, b.state, b.header, tx, &b.header.GasUsed, *b.dataProvider.GetVMConfig(), feeCurrencyContext) if err != nil { return fmt.Errorf("failed to apply transaction to L2 block (tx %d): %w", txIndex, err) }