From a36291dc345382094ba971ffd4cd5987e84b989f Mon Sep 17 00:00:00 2001 From: Adrian Sutton Date: Tue, 27 Aug 2024 15:37:35 +1000 Subject: [PATCH] op-geth: Update op-geth with single threaded fixes (#11598) --- go.mod | 2 +- go.sum | 4 ++-- op-program/client/l2/db_test.go | 2 ++ op-program/client/l2/engine_backend.go | 7 ++++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 12f502588d95..e8a150cb6a1d 100644 --- a/go.mod +++ b/go.mod @@ -235,7 +235,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum v1.14.8 => github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240822213944-6c8de76e0720 +replace github.com/ethereum/go-ethereum v1.14.8 => github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240827042333-110c433a2469 // replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index 1409be7d8133..0c661e610830 100644 --- a/go.sum +++ b/go.sum @@ -176,8 +176,8 @@ github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/u github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= -github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240822213944-6c8de76e0720 h1:PlMldvODGzwEBLRpK/mVUdrVa9LEN1cC0j5nKk5q7Jg= -github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240822213944-6c8de76e0720/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac= +github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240827042333-110c433a2469 h1:sGqlBjx0+z/ExU6VNo5OHSXS/5nc6BfkEQJvSdVbWp0= +github.com/ethereum-optimism/op-geth v1.101408.0-rc.4.0.20240827042333-110c433a2469/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240821192748-42bd03ba8313 h1:SVSFg8ccdRBJxOdRS1pK8oIHvMufiPAQz1gkQsEPnZc= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240821192748-42bd03ba8313/go.mod h1:XaVXL9jg8BcyOeugECgIUGa9Y3DjYJj71RHmb5qon6M= github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= diff --git a/op-program/client/l2/db_test.go b/op-program/client/l2/db_test.go index c85f99e2c55f..f214c527b1c2 100644 --- a/op-program/client/l2/db_test.go +++ b/op-program/client/l2/db_test.go @@ -131,6 +131,7 @@ func TestUpdateState(t *testing.T) { statedb, err := state.New(genesisBlock.Root(), state.NewDatabase(rawdb.NewDatabase(db)), nil) require.NoError(t, err) + statedb.MakeSinglethreaded() statedb.SetBalance(userAccount, uint256.NewInt(50), tracing.BalanceChangeUnspecified) require.Equal(t, uint256.NewInt(50), statedb.GetBalance(userAccount)) statedb.SetNonce(userAccount, uint64(5)) @@ -149,6 +150,7 @@ func TestUpdateState(t *testing.T) { statedb, err = state.New(newRoot, state.NewDatabase(rawdb.NewDatabase(db)), nil) require.NoError(t, err) + statedb.MakeSinglethreaded() require.Equal(t, uint256.NewInt(50), statedb.GetBalance(userAccount)) require.Equal(t, uint64(5), statedb.GetNonce(userAccount)) require.Equal(t, uint256.NewInt(60), statedb.GetBalance(unknownAccount)) diff --git a/op-program/client/l2/engine_backend.go b/op-program/client/l2/engine_backend.go index 08eafc9a0506..ea5195893625 100644 --- a/op-program/client/l2/engine_backend.go +++ b/op-program/client/l2/engine_backend.go @@ -170,7 +170,12 @@ func (o *OracleBackedL2Chain) Engine() consensus.Engine { } func (o *OracleBackedL2Chain) StateAt(root common.Hash) (*state.StateDB, error) { - return state.New(root, state.NewDatabase(rawdb.NewDatabase(o.db)), nil) + stateDB, err := state.New(root, state.NewDatabase(rawdb.NewDatabase(o.db)), nil) + if err != nil { + return nil, err + } + stateDB.MakeSinglethreaded() + return stateDB, nil } func (o *OracleBackedL2Chain) InsertBlockWithoutSetHead(block *types.Block) error {