Skip to content

Commit

Permalink
Update geth library to v1.15.0 (#18)
Browse files Browse the repository at this point in the history
* Update geth to v1.15.0, fix issues

* Fix unit test

* Add test for EIP3651

* Add Prague Test

* Add Test for EIP7702
  • Loading branch information
wcgcyx authored Feb 12, 2025
1 parent d3f78af commit 692b436
Show file tree
Hide file tree
Showing 21 changed files with 772 additions and 1,460 deletions.
2 changes: 1 addition & 1 deletion backend/backend_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (b *BackendImpl) ImportBlock(ctx context.Context, blk *types.Block, prvBlk
b.timeTaken = 0
}
// Send event
b.chainHeadFeed.Send(core.ChainHeadEvent{Block: blk})
b.chainHeadFeed.Send(core.ChainHeadEvent{Header: blk.Header()})
return nil
}

Expand Down
30 changes: 15 additions & 15 deletions blockchain/blockchain_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestAddBlockOfSingleChain(t *testing.T) {

ctx := context.Background()

genesis := core.DefaultGoerliGenesisBlock()
genesis := core.DefaultHoleskyGenesisBlock()
genesis.Alloc[testAcct1] = types.Account{
Code: []byte{},
Storage: make(map[common.Hash]common.Hash),
Expand All @@ -110,7 +110,7 @@ func TestAddBlockOfSingleChain(t *testing.T) {
_, blocks, receipts := core.GenerateChainWithGenesis(genesis, engine, 64, func(i int, bg *core.BlockGen) {
for j := 0; j < rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand Down Expand Up @@ -147,7 +147,7 @@ func TestAddBlockOfForks(t *testing.T) {

ctx := context.Background()

genesis := core.DefaultGoerliGenesisBlock()
genesis := core.DefaultHoleskyGenesisBlock()
genesis.Alloc[testAcct1] = types.Account{
Code: []byte{},
Storage: make(map[common.Hash]common.Hash),
Expand All @@ -168,7 +168,7 @@ func TestAddBlockOfForks(t *testing.T) {
db, blocks, receipts := core.GenerateChainWithGenesis(genesis, engine, 64, func(i int, bg *core.BlockGen) {
for j := 0; j < rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand All @@ -183,7 +183,7 @@ func TestAddBlockOfForks(t *testing.T) {
blocks2, receipts2 := core.GenerateChain(genesis.Config, blocks[31], engine, db, 32, func(i int, bg *core.BlockGen) {
for j := 0; j < rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand Down Expand Up @@ -228,7 +228,7 @@ func TestFinalizedAndSafe(t *testing.T) {

ctx := context.Background()

genesis := core.DefaultGoerliGenesisBlock()
genesis := core.DefaultHoleskyGenesisBlock()
genesis.Alloc[testAcct1] = types.Account{
Code: []byte{},
Storage: make(map[common.Hash]common.Hash),
Expand All @@ -249,7 +249,7 @@ func TestFinalizedAndSafe(t *testing.T) {
_, blocks, receipts := core.GenerateChainWithGenesis(genesis, engine, 64, func(i int, bg *core.BlockGen) {
for j := 0; j < rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand Down Expand Up @@ -314,7 +314,7 @@ func TestGetBlockData(t *testing.T) {

ctx := context.Background()

genesis := core.DefaultGoerliGenesisBlock()
genesis := core.DefaultHoleskyGenesisBlock()
genesis.Alloc[testAcct1] = types.Account{
Code: []byte{},
Storage: make(map[common.Hash]common.Hash),
Expand All @@ -335,7 +335,7 @@ func TestGetBlockData(t *testing.T) {
_, blocks, receipts := core.GenerateChainWithGenesis(genesis, engine, 64, func(i int, bg *core.BlockGen) {
for j := 0; j <= rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand Down Expand Up @@ -449,7 +449,7 @@ func TestReorg(t *testing.T) {

ctx := context.Background()

genesis := core.DefaultGoerliGenesisBlock()
genesis := core.DefaultHoleskyGenesisBlock()
genesis.Alloc[testAcct1] = types.Account{
Code: []byte{},
Storage: make(map[common.Hash]common.Hash),
Expand All @@ -470,7 +470,7 @@ func TestReorg(t *testing.T) {
db, blocks, receipts := core.GenerateChainWithGenesis(genesis, engine, 64, func(i int, bg *core.BlockGen) {
for j := 0; j < rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand All @@ -485,7 +485,7 @@ func TestReorg(t *testing.T) {
blocks2, receipts2 := core.GenerateChain(genesis.Config, blocks[31], engine, db, 32, func(i int, bg *core.BlockGen) {
for j := 0; j < rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand Down Expand Up @@ -552,7 +552,7 @@ func TestPruning(t *testing.T) {

ctx := context.Background()

genesis := core.DefaultGoerliGenesisBlock()
genesis := core.DefaultHoleskyGenesisBlock()
genesis.Alloc[testAcct1] = types.Account{
Code: []byte{},
Storage: make(map[common.Hash]common.Hash),
Expand All @@ -573,7 +573,7 @@ func TestPruning(t *testing.T) {
db, blocks, receipts := core.GenerateChainWithGenesis(genesis, engine, 500, func(i int, bg *core.BlockGen) {
for j := 0; j < rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand All @@ -583,7 +583,7 @@ func TestPruning(t *testing.T) {
blocks2, receipts2 := core.GenerateChain(genesis.Config, blocks[31], engine, db, 32, func(i int, bg *core.BlockGen) {
for j := 0; j < rand.Intn(5); j++ {
// Simple transfer from test account 1 to test account 2
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(1), nil)
tx := types.NewTransaction(bg.TxNonce(testAcct1), testAcct2, big.NewInt(1), 21000, big.NewInt(0).Add(bg.BaseFee(), big.NewInt(1)), nil)
key, _ := crypto.HexToECDSA(testKey1)
tx, _ = types.SignTx(tx, types.MakeSigner(genesis.Config, big.NewInt(int64(i)), bg.Timestamp()), key)
bg.AddTx(tx)
Expand Down
53 changes: 19 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ go 1.22.6

require (
github.com/dgraph-io/badger/v2 v2.2007.3
github.com/ethereum/go-ethereum v1.14.8
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9
github.com/ethereum/go-ethereum v1.15.0
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/holiman/uint256 v1.3.1
github.com/holiman/uint256 v1.3.2
github.com/ipfs/go-datastore v0.6.0
github.com/ipfs/go-ds-badger2 v0.1.3
github.com/ipfs/go-log v1.0.5
Expand All @@ -24,38 +23,30 @@ require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/bits-and-blooms/bitset v1.17.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/consensys/bavard v0.1.22 // indirect
github.com/consensys/gnark-crypto v0.14.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand All @@ -65,50 +56,44 @@ require (
github.com/ipfs/go-log/v2 v2.5.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mus-format/common-go v0.0.0-20240704141923-ea7d12c7eed3 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pion/dtls/v2 v2.2.7 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/stun/v2 v2.0.0 // indirect
github.com/pion/transport/v2 v2.2.1 // indirect
github.com/pion/transport/v3 v3.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.0 // indirect
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/spf13/afero v1.1.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/supranational/blst v0.3.13 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.opencensus.io v0.22.4 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 692b436

Please sign in to comment.