Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade geth to 1.13 #2419

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agents/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/brianvoe/gofakeit/v6 v6.27.0
github.com/coinbase/rosetta-sdk-go v0.8.1
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.12.0
github.com/ethereum/go-ethereum v1.13.0
github.com/hedzr/log v1.6.3
github.com/imkira/go-interpol v1.1.0
github.com/ipfs/go-log v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions agents/testutil/simulated_backends_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,12 @@ func (a *SimulatedBackendsTestSuite) SetupBackends() {
defer wg.Done()
if useAnvil {
anvilOptsOrigin := anvil.NewAnvilOptionBuilder()
anvilOptsOrigin.SetChainID(uint64(params.RinkebyChainConfig.ChainID.Int64()))
anvilOptsOrigin.SetChainID(uint64(params.SepoliaChainConfig.ChainID.Int64()))
anvilOptsOrigin.SetBlockTime(1 * time.Second)
a.TestBackendOrigin = anvil.NewAnvilBackend(a.GetTestContext(), a.T(), anvilOptsOrigin)
a.TestSuite.DeferAfterTest(a.TestBackendOrigin.(*anvil.Backend).TearDown)
} else {
a.TestBackendOrigin = preset.GetRinkeby().Geth(a.GetTestContext(), a.T())
a.TestBackendOrigin = preset.GetSepolia().Geth(a.GetTestContext(), a.T())
}
}()
go func() {
Expand Down
2 changes: 1 addition & 1 deletion committee/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/Flaque/filet v0.0.0-20201012163910-45f684403088
github.com/brianvoe/gofakeit/v6 v6.27.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
github.com/ethereum/go-ethereum v1.12.0
github.com/ethereum/go-ethereum v1.13.0
github.com/hsanjuan/ipfs-lite v1.8.2
github.com/ipfs/go-datastore v0.6.0
github.com/ipfs/go-ds-crdt v0.5.2
Expand Down
2 changes: 1 addition & 1 deletion contrib/git-changes-action/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/Flaque/filet v0.0.0-20201012163910-45f684403088
github.com/avast/retry-go v3.0.0+incompatible
github.com/brianvoe/gofakeit/v6 v6.27.0
github.com/ethereum/go-ethereum v1.12.0
github.com/ethereum/go-ethereum v1.13.0
github.com/go-git/go-git/v5 v5.11.0
github.com/google/go-github/v41 v41.0.0
github.com/kendru/darwin/go/depgraph v0.0.0-20221105232959-877d6a81060c
Expand Down
2 changes: 1 addition & 1 deletion contrib/promexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/Flaque/filet v0.0.0-20201012163910-45f684403088
github.com/Yamashou/gqlgenc v0.10.0
github.com/creasty/defaults v1.7.0
github.com/ethereum/go-ethereum v1.12.0
github.com/ethereum/go-ethereum v1.13.0
github.com/gin-gonic/gin v1.9.1
github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc
github.com/ipfs/go-log v1.0.5
Expand Down
2 changes: 1 addition & 1 deletion contrib/screener-api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ require (
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/ethereum/go-ethereum v1.12.0 // indirect
github.com/ethereum/go-ethereum v1.13.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
Expand Down
2 changes: 1 addition & 1 deletion core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/c-bata/go-prompt v0.2.6
github.com/cheekybits/genny v1.0.0
github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e
github.com/ethereum/go-ethereum v1.12.0
github.com/ethereum/go-ethereum v1.13.0
github.com/fatih/structtag v1.2.0
github.com/gin-contrib/cors v1.4.0
github.com/gin-contrib/requestid v0.0.6
Expand Down
7 changes: 4 additions & 3 deletions ethergo/backends/geth/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package geth

import (
"math/big"
"testing"

"github.com/Flaque/filet"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
Expand All @@ -9,8 +12,6 @@ import (
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/params"
"github.com/phayes/freeport"
"math/big"
"testing"
)

// makeNodeConfig makes the config for a full backend.
Expand Down Expand Up @@ -45,7 +46,7 @@ func makeNodeConfig(tb testing.TB) *node.Config {
func makeEthConfig(address common.Address, config *params.ChainConfig) *ethconfig.Config {
ethConfig := ethconfig.Defaults
ethConfig.NetworkId = config.ChainID.Uint64()
ethConfig.Genesis = core.DeveloperGenesisBlock(0, 10000000, address)
ethConfig.Genesis = core.DeveloperGenesisBlock(10000000, address)
ethConfig.Genesis.Config = config
ethConfig.Miner.Etherbase = address
ethConfig.SyncMode = downloader.FullSync
Expand Down
8 changes: 4 additions & 4 deletions ethergo/backends/geth/geth.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const gasLimit = 10000000
func NewEmbeddedBackendForChainID(ctx context.Context, t *testing.T, chainID *big.Int) *Backend {
t.Helper()
// get the default config
config := ethCore.DeveloperGenesisBlock(0, gasLimit, common.Address{}).Config
config := ethCore.DeveloperGenesisBlock(gasLimit, common.Address{}).Config
config.ChainID = chainID
return NewEmbeddedBackendWithConfig(ctx, t, config)
}
Expand Down Expand Up @@ -118,7 +118,7 @@ func NewEmbeddedBackendWithConfig(ctx context.Context, t *testing.T, config *par
embedded.ethBackend.AccountManager().AddBackend(keystoreBackend)
embedded.ethBackend.SetEtherbase(acct.Address)

embedded.ethBackend.TxPool().SetGasPrice(big.NewInt(0))
embedded.ethBackend.TxPool().SetGasTip(big.NewInt(0))
err = embedded.ethBackend.APIBackend.StartMining()
assert.Nil(t, err)

Expand Down Expand Up @@ -220,7 +220,7 @@ func (f *Backend) GetTxContext(ctx context.Context, address *common.Address) (re
err = f.Chain.GasSetter().SetGasFee(ctx, auth, latestBlock.NumberU64(), core.CopyBigInt(gasprice.DefaultMaxPrice))
assert.Nil(f.T(), err)

auth.GasLimit = ethCore.DeveloperGenesisBlock(0, gasLimit, f.faucetAddr.Address).GasLimit / 2
auth.GasLimit = ethCore.DeveloperGenesisBlock(gasLimit, f.faucetAddr.Address).GasLimit / 2

return backends.AuthType{
TransactOpts: auth,
Expand Down Expand Up @@ -282,7 +282,7 @@ func (f *Backend) getFaucetTxContext(ctx context.Context) *bind.TransactOpts {
auth.GasPrice, err = f.Client().SuggestGasPrice(ctx)
assert.Nil(f.T(), err)

auth.GasLimit = ethCore.DeveloperGenesisBlock(0, gasLimit, f.faucetAddr.Address).GasLimit / 2
auth.GasLimit = ethCore.DeveloperGenesisBlock(gasLimit, f.faucetAddr.Address).GasLimit / 2

return auth
}
Expand Down
10 changes: 5 additions & 5 deletions ethergo/backends/preset/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
"github.com/synapsecns/sanguine/ethergo/chain/client"
)

// GetRinkeby gets the rinkeby preset backend.
func GetRinkeby() Backend {
// GetSepolia gets the rinkeby preset backend.
func GetSepolia() Backend {
chainConfig := *params.AllCliqueProtocolChanges
chainConfig.ChainID = params.RinkebyChainConfig.ChainID
chainConfig.ChainID = params.SepoliaChainConfig.ChainID

return Backend{
config: &chainConfig,
rpcURL: core.GetEnv("RINEKBY_RPC_URL", "ws://0.0.0.0:8045"),
name: "Rinkeby",
rpcURL: core.GetEnv("SEPOLIA_RPC_URL", "ws://0.0.0.0:8045"),
name: "Sepolia",
privateKey: os.Getenv("EXPORT_KEY"),
}
}
Expand Down
7 changes: 5 additions & 2 deletions ethergo/backends/simulated/multibackend/chainid.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package multibackend

import (
"math/big"

"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/trie"
util "github.com/synapsecns/sanguine/core"
"math/big"
)

// NewConfigWithChainID creates a new *params.ChainConfig and changes only the chain id
Expand Down Expand Up @@ -46,9 +48,10 @@ func NewConfigWithChainID(chainID *big.Int) *params.ChainConfig {
// NewSimulatedBackendWithConfig creates a new simulated backend with the given chain id.
func NewSimulatedBackendWithConfig(alloc core.GenesisAlloc, gasLimit uint64, config *params.ChainConfig) *SimulatedBackend {
database := rawdb.NewMemoryDatabase()
triedb := trie.NewDatabase(database, nil)

genesis := core.Genesis{Config: config, GasLimit: gasLimit, Alloc: alloc}
genesis.MustCommit(database)
genesis.MustCommit(database, triedb)
blockchain, _ := core.NewBlockChain(database, nil, &genesis, nil, ethash.NewFaker(), vm.Config{}, nil, nil)

backend := &SimulatedBackend{
Expand Down
2 changes: 1 addition & 1 deletion ethergo/backends/simulated/multibackend/simulated_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ethergo/chain/chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (s *ChainSuite) TestChainWatcher() {

// make sure a chain client can be started form a url.
func (s *ChainSuite) TestNewFromURL() {
rinkeby := preset.GetRinkeby().Geth(s.GetTestContext(), s.T())
rinkeby := preset.GetSepolia().Geth(s.GetTestContext(), s.T())
chnRPC, err := chain.NewFromURL(s.GetTestContext(), rinkeby.RPCAddress())
Nil(s.T(), err)

Expand Down
7 changes: 4 additions & 3 deletions ethergo/chain/client/client_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package client_test

import (
"os"
"time"

"github.com/ethereum/go-ethereum/core/types"
"github.com/lmittmann/w3/module/eth"
"github.com/lmittmann/w3/w3types"
Expand All @@ -10,8 +13,6 @@ import (
"github.com/synapsecns/sanguine/ethergo/chain/client"
"github.com/synapsecns/sanguine/ethergo/mocks"
"go.uber.org/atomic"
"os"
"time"
)

// TestAttemptReconnect tests the rehupping process. You may notice that in the below test, if the first connection
Expand All @@ -22,7 +23,7 @@ func (c *ClientSuite) TestAttemptReconnect() {
if os.Getenv("ATTEMPT_CONNECT_ENABLED") != "" {
c.T().Skip("deprecated")
}
testBackend := preset.GetRinkeby().Geth(c.GetTestContext(), c.T())
testBackend := preset.GetSepolia().Geth(c.GetTestContext(), c.T())

// make sure the client doesn't reset on us during the test
client.SetResetTimeout(time.Hour)
Expand Down
6 changes: 3 additions & 3 deletions ethergo/chain/client/config.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package client

import (
"math/big"

ethCommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/params"
"math/big"
)

// Config contains the configuration needed to connect to the chain.
Expand Down Expand Up @@ -333,8 +334,7 @@ var (

// chainConfigs is a list of chain configs.
var chainConfigs = []*params.ChainConfig{
params.MainnetChainConfig, params.SepoliaChainConfig,
params.RinkebyChainConfig, params.RinkebyChainConfig, params.GoerliChainConfig,
params.MainnetChainConfig, params.SepoliaChainConfig, params.GoerliChainConfig,
params.AllEthashProtocolChanges, BSCChainConfig, ChapelChainConfig, RialtoChainConfig,
SimulatedConfig, MaticMumbaiConfig, MaticMainnetConfig, AvalancheMainnetChainConfig, AvalancheLocalChainConfig,
ArbitrumMainnetConfig, FtmMainnetConfig, HarmonyConfig, BobaConfig, MoonRiverConfig, OptimisticEthereum,
Expand Down
8 changes: 5 additions & 3 deletions ethergo/chain/client/config_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package client_test

import (
"math"
"math/big"
"time"

"github.com/ethereum/go-ethereum/core/types"
. "github.com/stretchr/testify/assert"
"github.com/synapsecns/sanguine/core/testsuite"
"github.com/synapsecns/sanguine/ethergo/chain/client"
"github.com/synapsecns/sanguine/ethergo/mocks"
"gotest.tools/assert"
"math"
"math/big"
)

// TestConfigFromID makes sure configs are properly returned by id.
Expand Down Expand Up @@ -37,7 +39,7 @@ func (c ClientSuite) TestConfig() {
// TestChainSigner is a sanity check that our configs correctly use the signer.
func (c ClientSuite) TestChainSigner() {
for _, config := range client.ChainConfigs {
signer := types.MakeSigner(config, big.NewInt(0).SetUint64(math.MaxUint64))
signer := types.MakeSigner(config, big.NewInt(0).SetUint64(math.MaxUint64), uint64(time.Now().Unix()))
False(c.T(), signer.Equal(types.FrontierSigner{}))
False(c.T(), signer.Equal(types.HomesteadSigner{}))
}
Expand Down
9 changes: 5 additions & 4 deletions ethergo/chain/gas/londinium/gasprice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ package londinium_test

import (
"context"
"github.com/ethereum/go-ethereum/trie"
"github.com/synapsecns/sanguine/ethergo/chain/gas/londinium"
"math"
"math/big"
"testing"

"github.com/ethereum/go-ethereum/trie"
"github.com/synapsecns/sanguine/ethergo/chain/gas/londinium"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/ethash"
"github.com/ethereum/go-ethereum/core"
Expand Down Expand Up @@ -72,7 +73,7 @@ func newTestBackend(t *testing.T) *testBackend {
)
engine := ethash.NewFaker()
db := rawdb.NewMemoryDatabase()
triedb := trie.NewDatabase(db)
triedb := trie.NewDatabase(db, nil)
genesis, _ := gspec.Commit(db, triedb)

// Generate testing blocks
Expand All @@ -86,7 +87,7 @@ func newTestBackend(t *testing.T) *testBackend {
})
// Construct testing chain
diskdb := rawdb.NewMemoryDatabase()
disktriedb := trie.NewDatabase(diskdb)
disktriedb := trie.NewDatabase(diskdb, nil)
_, err := gspec.Commit(diskdb, disktriedb)
Nil(t, err)

Expand Down
8 changes: 7 additions & 1 deletion ethergo/chain/gas/london/oracle_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus/misc/eip4844"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth/gasprice"
Expand Down Expand Up @@ -64,7 +65,12 @@ func (h HeightOracleBackend) GetReceipts(ctx context.Context, hash common.Hash)

var receipts types.Receipts

err = receipts.DeriveFields(h.ChainConfig(), hash, block.NumberU64(), block.Time(), block.BaseFee(), block.Transactions())
var blobGasPrice *big.Int
if block.ExcessBlobGas() != nil {
blobGasPrice = eip4844.CalcBlobFee(*block.ExcessBlobGas())
}

err = receipts.DeriveFields(h.ChainConfig(), hash, block.NumberU64(), block.Time(), block.BaseFee(), blobGasPrice, block.Transactions())
if err != nil {
return nil, fmt.Errorf("could not derive receipts from block: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion ethergo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
github.com/dgraph-io/ristretto v0.1.0
github.com/ethereum/go-ethereum v1.12.0
github.com/ethereum/go-ethereum v1.13.0
github.com/goccy/go-json v0.10.2
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.5.0
Expand Down
Loading
Loading