diff --git a/go.mod b/go.mod index 108a465f0a24..8912b23ec380 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/antithesishq/antithesis-sdk-go v0.3.8 github.com/ava-labs/avalanchego/graft/coreth v0.0.0-20251203215505-70148edc6eca github.com/ava-labs/avalanchego/graft/subnet-evm v0.8.1-0.20251201175023-067762d6ce7d - github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 + github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300 github.com/btcsuite/btcd/btcutil v1.1.3 github.com/cespare/xxhash/v2 v2.3.0 github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 diff --git a/go.sum b/go.sum index 25c16af80312..bafea5bb98b2 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17 h1:ZZt7G5PdpREOrlappMAGui10ZvzPrr/tbnoUspCbed4= github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17/go.mod h1:hR/JSGXxST9B9olwu/NpLXHAykfAyNGfyKnYQqiiOeE= -github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 h1:hQ15IJxY7WOKqeJqCXawsiXh0NZTzmoQOemkWHz7rr4= -github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2/go.mod h1:DqSotSn4Dx/UJV+d3svfW8raR+cH7+Ohl9BpsQ5HlGU= +github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300 h1:9VRvqASGSAnQ9tKVRKGH8Q0Yq8efCwYTBWp0p2creho= +github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300/go.mod h1:DqSotSn4Dx/UJV+d3svfW8raR+cH7+Ohl9BpsQ5HlGU= github.com/ava-labs/simplex v0.0.0-20250919142550-9cdfff10fd19 h1:S6oFasZsplNmw8B2S8cMJQMa62nT5ZKGzZRdCpd+5qQ= github.com/ava-labs/simplex v0.0.0-20250919142550-9cdfff10fd19/go.mod h1:GVzumIo3zR23/qGRN2AdnVkIPHcKMq/D89EGWZfMGQ0= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= diff --git a/graft/coreth/eth/tracers/api_test.go b/graft/coreth/eth/tracers/api_test.go index 782b58bf95e6..a5de876b6f40 100644 --- a/graft/coreth/eth/tracers/api_test.go +++ b/graft/coreth/eth/tracers/api_test.go @@ -30,6 +30,7 @@ package tracers import ( "context" "crypto/ecdsa" + "encoding/binary" "encoding/json" "errors" "fmt" @@ -54,6 +55,7 @@ import ( "github.com/ava-labs/libevm/crypto" "github.com/ava-labs/libevm/eth/tracers/logger" "github.com/ava-labs/libevm/ethdb" + "github.com/ava-labs/libevm/libevm/ethtest" ethparams "github.com/ava-labs/libevm/params" "golang.org/x/exp/slices" ) @@ -630,7 +632,9 @@ func TestTracingWithOverrides(t *testing.T) { func testTracingWithOverrides(t *testing.T, scheme string) { // Initialize test accounts - accounts := newAccounts(3) + // This test requires deterministic block hashes, since it will fail 1/256 times, + // when the final block hash starts with 0xef. + accounts := UNSAFEDeterministicAccounts(t, 3) storageAccount := common.Address{0x13, 37} genesis := &core.Genesis{ Config: params.TestChainConfig, @@ -996,6 +1000,19 @@ func newAccounts(n int) (accounts []Account) { return accounts } +// WARNING: only use for tests that require deterministic accounts +func UNSAFEDeterministicAccounts(t *testing.T, n uint64) []Account { + seed := make([]byte, 8) // uint64 size + accounts := make([]Account, 0, n) + for i := range n { + binary.BigEndian.PutUint64(seed, i) + key := ethtest.UNSAFEDeterministicPrivateKey(t, seed) + addr := crypto.PubkeyToAddress(key.PublicKey) + accounts = append(accounts, Account{key: key, addr: addr}) + } + return accounts +} + func newRPCBalance(balance *big.Int) **hexutil.Big { rpcBalance := (*hexutil.Big)(balance) return &rpcBalance diff --git a/graft/coreth/go.mod b/graft/coreth/go.mod index 9aef91cac27b..141ecf670c65 100644 --- a/graft/coreth/go.mod +++ b/graft/coreth/go.mod @@ -12,7 +12,7 @@ require ( github.com/ava-labs/avalanchego v1.14.1-0.20251120155522-df4a8e531761 github.com/ava-labs/avalanchego/graft/evm v0.0.0-00010101000000-000000000000 github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17 - github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 + github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/deckarep/golang-set/v2 v2.1.0 github.com/go-cmd/cmd v1.4.3 diff --git a/graft/coreth/go.sum b/graft/coreth/go.sum index dbee3975c13a..fbed9768edf1 100644 --- a/graft/coreth/go.sum +++ b/graft/coreth/go.sum @@ -28,8 +28,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17 h1:ZZt7G5PdpREOrlappMAGui10ZvzPrr/tbnoUspCbed4= github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17/go.mod h1:hR/JSGXxST9B9olwu/NpLXHAykfAyNGfyKnYQqiiOeE= -github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 h1:hQ15IJxY7WOKqeJqCXawsiXh0NZTzmoQOemkWHz7rr4= -github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2/go.mod h1:DqSotSn4Dx/UJV+d3svfW8raR+cH7+Ohl9BpsQ5HlGU= +github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300 h1:9VRvqASGSAnQ9tKVRKGH8Q0Yq8efCwYTBWp0p2creho= +github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300/go.mod h1:DqSotSn4Dx/UJV+d3svfW8raR+cH7+Ohl9BpsQ5HlGU= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= diff --git a/graft/coreth/scripts/eth-allowed-packages.txt b/graft/coreth/scripts/eth-allowed-packages.txt index 1652e4a518e1..866a9eaa3c9e 100644 --- a/graft/coreth/scripts/eth-allowed-packages.txt +++ b/graft/coreth/scripts/eth-allowed-packages.txt @@ -30,6 +30,7 @@ "github.com/ava-labs/libevm/ethdb/pebble" "github.com/ava-labs/libevm/event" "github.com/ava-labs/libevm/libevm" +"github.com/ava-labs/libevm/libevm/ethtest" "github.com/ava-labs/libevm/libevm/legacy" "github.com/ava-labs/libevm/libevm/options" "github.com/ava-labs/libevm/libevm/stateconf" diff --git a/graft/evm/go.mod b/graft/evm/go.mod index 3efcac388124..3611a0d2b66b 100644 --- a/graft/evm/go.mod +++ b/graft/evm/go.mod @@ -4,7 +4,7 @@ go 1.24.9 require ( github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17 - github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 + github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300 github.com/holiman/uint256 v1.2.4 github.com/stretchr/testify v1.10.0 ) diff --git a/graft/evm/go.sum b/graft/evm/go.sum index 805f05174f1d..574cfb6f06c8 100644 --- a/graft/evm/go.sum +++ b/graft/evm/go.sum @@ -20,8 +20,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17 h1:ZZt7G5PdpREOrlappMAGui10ZvzPrr/tbnoUspCbed4= github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17/go.mod h1:hR/JSGXxST9B9olwu/NpLXHAykfAyNGfyKnYQqiiOeE= -github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 h1:hQ15IJxY7WOKqeJqCXawsiXh0NZTzmoQOemkWHz7rr4= -github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2/go.mod h1:DqSotSn4Dx/UJV+d3svfW8raR+cH7+Ohl9BpsQ5HlGU= +github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300 h1:9VRvqASGSAnQ9tKVRKGH8Q0Yq8efCwYTBWp0p2creho= +github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300/go.mod h1:DqSotSn4Dx/UJV+d3svfW8raR+cH7+Ohl9BpsQ5HlGU= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= diff --git a/graft/subnet-evm/eth/tracers/api_test.go b/graft/subnet-evm/eth/tracers/api_test.go index 0637ac1daef4..e014c8b3aca1 100644 --- a/graft/subnet-evm/eth/tracers/api_test.go +++ b/graft/subnet-evm/eth/tracers/api_test.go @@ -30,6 +30,7 @@ package tracers import ( "context" "crypto/ecdsa" + "encoding/binary" "encoding/json" "errors" "fmt" @@ -54,6 +55,7 @@ import ( "github.com/ava-labs/libevm/crypto" "github.com/ava-labs/libevm/eth/tracers/logger" "github.com/ava-labs/libevm/ethdb" + "github.com/ava-labs/libevm/libevm/ethtest" ethparams "github.com/ava-labs/libevm/params" "golang.org/x/exp/slices" ) @@ -628,7 +630,9 @@ func TestTracingWithOverrides(t *testing.T) { func testTracingWithOverrides(t *testing.T, scheme string) { // Initialize test accounts - accounts := newAccounts(3) + // This test requires deterministic block hashes, since it will fail 1/256 times, + // when the final block hash starts with 0xef. + accounts := UNSAFEDeterministicAccounts(t, 3) storageAccount := common.Address{0x13, 37} genesis := &core.Genesis{ Config: params.TestChainConfig, @@ -994,6 +998,19 @@ func newAccounts(n int) (accounts []Account) { return accounts } +// WARNING: only use for tests that require deterministic accounts +func UNSAFEDeterministicAccounts(t *testing.T, n uint64) []Account { + seed := make([]byte, 8) // uint64 size + accounts := make([]Account, 0, n) + for i := range n { + binary.BigEndian.PutUint64(seed, i) + key := ethtest.UNSAFEDeterministicPrivateKey(t, seed) + addr := crypto.PubkeyToAddress(key.PublicKey) + accounts = append(accounts, Account{key: key, addr: addr}) + } + return accounts +} + func newRPCBalance(balance *big.Int) **hexutil.Big { rpcBalance := (*hexutil.Big)(balance) return &rpcBalance diff --git a/graft/subnet-evm/go.mod b/graft/subnet-evm/go.mod index 789700784f3e..43669563a1ea 100644 --- a/graft/subnet-evm/go.mod +++ b/graft/subnet-evm/go.mod @@ -19,7 +19,7 @@ require ( github.com/ava-labs/avalanchego v1.14.1-antithesis-docker-image-fix github.com/ava-labs/avalanchego/graft/evm v0.0.0-00010101000000-000000000000 github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17 - github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 + github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/deckarep/golang-set/v2 v2.1.0 github.com/go-cmd/cmd v1.4.3 diff --git a/graft/subnet-evm/go.sum b/graft/subnet-evm/go.sum index ea73b2910f51..441f7e493e0c 100644 --- a/graft/subnet-evm/go.sum +++ b/graft/subnet-evm/go.sum @@ -32,8 +32,8 @@ github.com/ava-labs/avalanchego/graft/coreth v0.0.0-20251203215505-70148edc6eca github.com/ava-labs/avalanchego/graft/coreth v0.0.0-20251203215505-70148edc6eca/go.mod h1:y+/5DAxCTLAXdWRxAYN1V8DV0DIF7uHhOOeNa9oASuU= github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17 h1:ZZt7G5PdpREOrlappMAGui10ZvzPrr/tbnoUspCbed4= github.com/ava-labs/firewood-go-ethhash/ffi v0.0.17/go.mod h1:hR/JSGXxST9B9olwu/NpLXHAykfAyNGfyKnYQqiiOeE= -github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2 h1:hQ15IJxY7WOKqeJqCXawsiXh0NZTzmoQOemkWHz7rr4= -github.com/ava-labs/libevm v1.13.15-0.20251016142715-1bccf4f2ddb2/go.mod h1:DqSotSn4Dx/UJV+d3svfW8raR+cH7+Ohl9BpsQ5HlGU= +github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300 h1:9VRvqASGSAnQ9tKVRKGH8Q0Yq8efCwYTBWp0p2creho= +github.com/ava-labs/libevm v1.13.15-0.20251210210615-b8e76562a300/go.mod h1:DqSotSn4Dx/UJV+d3svfW8raR+cH7+Ohl9BpsQ5HlGU= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=