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

feat: sync updates to v1.13.5 #1085

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7a72868
cmd/evm: make t8ntool handle transaction decoding errors better (#28397)
holiman Oct 25, 2023
eb2a3de
trie: use explicit errors in stacktrie (instead of panic) (#28361)
holiman Oct 25, 2023
f04949e
graphql: logs return error if from block > to (#28412)
jsvisa Oct 25, 2023
90932b6
rpc: use correct stringer-method for serializing BlockNumberOrHash (#…
ajsutton Oct 25, 2023
55e20e9
cmd/geth: test for logging-output (#28373)
holiman Oct 25, 2023
0106994
graphql: fix an issue of nil pointer panic (#28416)
jsvisa Oct 26, 2023
bcb36d9
core, cmd/geth: add --override.* flags to geth init (#28407)
gballet Oct 27, 2023
64b37b8
graphql: always set content-type to application/json (#28417)
jsvisa Oct 27, 2023
c89984d
all: make vendored copy of reexec (#28382)
holiman Oct 27, 2023
3a3c491
trie/triedb/pathdb: improve dirty node flushing trigger (#28426)
rjl493456442 Oct 31, 2023
13c53bc
core/rawdb: add logging and fix comments around AncientRange function…
jakub-freebit Oct 31, 2023
bf9c885
core: add basic chain history support in GenerateChain (#28428)
fjl Oct 31, 2023
48b9566
cmd/evm: add --run option to blocktest command (#28421)
marioevz Oct 31, 2023
6142999
ethdb/pebble: cap memory table size as maxMemTableSize-1 (#28444)
rjl493456442 Oct 31, 2023
20e567b
core/vm: performance tweak of `OpCode.String()` (#28453)
lmittmann Nov 2, 2023
9ffac27
eth/tracers: add position field for callTracer logs (#28389)
alvarosevilla95 Nov 3, 2023
b3d83ac
ethclient: fix forwarding 1559 gas fields (#28462)
karalabe Nov 3, 2023
2a6365b
.travis: enable cross building to macos arm64 (#28474)
karalabe Nov 7, 2023
15c294a
travis: use newer builder image (#28475)
karalabe Nov 7, 2023
abdd602
eth/filters: eth_getLogs fast exit for invalid block range (#28386)
jsvisa Nov 7, 2023
2974eaa
eth: set networkID to chainID by default (#28250)
MariusVanDerWijden Nov 7, 2023
e818955
core/vm: set basefee to 0 internally on eth_call (#28470)
karalabe Nov 8, 2023
8a8d81a
graphql: type of yParity from Long to BigInt (#28456)
jsvisa Nov 9, 2023
bda8f95
cmd/geth: more testcases for logging (#28501)
holiman Nov 9, 2023
6f640b6
ethdb/pebble: add `Errorf` function to panicLogger (#28491)
mcdee Nov 9, 2023
46baa9a
eth/filters: exit early if topics-filter has more than 4 topics (#28494)
jsvisa Nov 10, 2023
3e2c657
core/rawdb: fsync the index file after each freezer write (#28483)
rjl493456442 Nov 10, 2023
961b050
cmd/evm: allow state dump regardless if test passes in statetest (#28…
sorpaas Nov 10, 2023
82f6798
ethclient: add empty/nonexist account testcase for eth_getProof RPC (…
jsvisa Nov 10, 2023
15bd8ba
build: upgrade -dlgo version to Go 1.21.4 (#28505)
sandakersmann Nov 10, 2023
82cdfaf
cmd/geth: remove some whitespace in code and comments (#28148)
jsvisa Nov 10, 2023
fd2424d
params: release Geth v1.15.5
karalabe Nov 14, 2023
0b6b761
go mod tidy
colinlyguo Oct 31, 2024
332d98d
Merge branch 'syncUpstream/active' into syncUpstream/update-v1.13.5
colinlyguo Oct 31, 2024
220ece2
fix CI
colinlyguo Oct 31, 2024
633169b
try fix CI
colinlyguo Oct 31, 2024
97a1f8b
try fix CI
colinlyguo Oct 31, 2024
f2040b6
update go-verkle
colinlyguo Oct 31, 2024
19e6400
remove verkle
colinlyguo Oct 31, 2024
cecf688
remove verkle cmd
colinlyguo Oct 31, 2024
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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
- stage: build
if: type = push
os: osx
osx_image: xcode14.2
go: 1.21.x
env:
- azure-osx
Expand All @@ -104,6 +105,8 @@ jobs:
script:
- go run build/ci.go install -dlgo
- go run build/ci.go archive -type tar -signer OSX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
- go run build/ci.go install -dlgo -arch arm64
- go run build/ci.go archive -arch arm64 -type tar -signer OSX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds

# These builders run the tests
- stage: build
Expand Down
30 changes: 15 additions & 15 deletions build/checksums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
# https://github.com/ethereum/execution-spec-tests/releases/download/v1.0.6/
485af7b66cf41eb3a8c1bd46632913b8eb95995df867cf665617bbc9b4beedd1 fixtures_develop.tar.gz

# version:golang 1.21.3
# version:golang 1.21.4
# https://go.dev/dl/
186f2b6f8c8b704e696821b09ab2041a5c1ee13dcbc3156a13adcf75931ee488 go1.21.3.src.tar.gz
27014fc69e301d7588a169ca239b3cc609f0aa1abf38528bf0d20d3b259211eb go1.21.3.darwin-amd64.tar.gz
65302a7a9f7a4834932b3a7a14cb8be51beddda757b567a2f9e0cbd0d7b5a6ab go1.21.3.darwin-arm64.tar.gz
8e0cd2f66cf1bde9d07b4aee01e3d7c3cfdd14e20650488e1683da4b8492594a go1.21.3.freebsd-386.tar.gz
6e74f65f586e93d1f3947894766f69e9b2ebda488592a09df61f36f06bfe58a8 go1.21.3.freebsd-amd64.tar.gz
fb209fd070db500a84291c5a95251cceeb1723e8f6142de9baca5af70a927c0e go1.21.3.linux-386.tar.gz
1241381b2843fae5a9707eec1f8fb2ef94d827990582c7c7c32f5bdfbfd420c8 go1.21.3.linux-amd64.tar.gz
fc90fa48ae97ba6368eecb914343590bbb61b388089510d0c56c2dde52987ef3 go1.21.3.linux-arm64.tar.gz
a1ddcaaf0821a12a800884c14cb4268ce1c1f5a0301e9060646f1e15e611c6c7 go1.21.3.linux-armv6l.tar.gz
3b0e10a3704f164a6e85e0377728ec5fd21524fabe4c925610e34076586d5826 go1.21.3.linux-ppc64le.tar.gz
4c78e2e6f4c684a3d5a9bdc97202729053f44eb7be188206f0627ef3e18716b6 go1.21.3.linux-s390x.tar.gz
e36737f4f2fadb4d2f919ec4ce517133a56e06064cca6e82fc883bb000c4d56c go1.21.3.windows-386.zip
27c8daf157493f288d42a6f38debc6a2cb391f6543139eba9152fceca0be2a10 go1.21.3.windows-amd64.zip
bfb7a5c56f9ded07d8ae0e0b3702ac07b65e68fa8f33da24ed6df4ce01fe2c5c go1.21.3.windows-arm64.zip
47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787 go1.21.4.src.tar.gz
cd3bdcc802b759b70e8418bc7afbc4a65ca73a3fe576060af9fc8a2a5e71c3b8 go1.21.4.darwin-amd64.tar.gz
8b7caf2ac60bdff457dba7d4ff2a01def889592b834453431ae3caecf884f6a5 go1.21.4.darwin-arm64.tar.gz
f1e685d086eb36f4be5b8b953b52baf7752bc6235400d84bb7d87e500b65f03e go1.21.4.freebsd-386.tar.gz
59f9b32187efb98d344a3818a631d3815ebb5c7bbefc367bab6515caaca544e9 go1.21.4.freebsd-amd64.tar.gz
64d3e5d295806e137c9e39d1e1f10b00a30fcd5c2f230d72b3298f579bb3c89a go1.21.4.linux-386.tar.gz
73cac0215254d0c7d1241fa40837851f3b9a8a742d0b54714cbdfb3feaf8f0af go1.21.4.linux-amd64.tar.gz
ce1983a7289856c3a918e1fd26d41e072cc39f928adfb11ba1896440849b95da go1.21.4.linux-arm64.tar.gz
6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252 go1.21.4.linux-armv6l.tar.gz
2c63b36d2adcfb22013102a2ee730f058ec2f93b9f27479793c80b2e3641783f go1.21.4.linux-ppc64le.tar.gz
7a75ba4afc7a96058ca65903d994cd862381825d7dca12b2183f087c757c26c0 go1.21.4.linux-s390x.tar.gz
870a0e462b94671dc2d6cac707e9e19f7524fdc3c90711e6cd4450c3713a8ce0 go1.21.4.windows-386.zip
79e5428e068c912d9cfa6cd115c13549856ec689c1332eac17f5d6122e19d595 go1.21.4.windows-amd64.zip
58bc7c6f4d4c72da2df4d2650c8222fe03c9978070eb3c66be8bbaa2a4757ac1 go1.21.4.windows-arm64.zip

# version:golangci 1.51.1
# https://github.com/golangci/golangci-lint/releases/
Expand Down
3 changes: 3 additions & 0 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ func doTest(cmdline []string) {
// Enable CKZG backend in CI.
gotest.Args = append(gotest.Args, "-tags=ckzg")

// Enable integration-tests
gotest.Args = append(gotest.Args, "-tags=integrationtests")

// Test a single package at a time. CI builders are slow
// and some tests run into timeouts under load.
gotest.Args = append(gotest.Args, "-p", "1")
Expand Down
3 changes: 1 addition & 2 deletions build/update-license.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ var (
"vendor/", "tests/testdata/", "build/",

// don't relicense vendored sources
"cmd/internal/browser",
"common/bitutil/bitutil",
"common/prque/",
"consensus/ethash/xor.go",
"crypto/blake2b/",
"crypto/bn256/",
"crypto/bls12381/",
Expand All @@ -78,6 +76,7 @@ var (
"log/",
"metrics/",
"signer/rules/deps",
"internal/reexec",

// skip special licenses
"crypto/secp256k1", // Relicensed to BSD-3 via https://github.com/ethereum/go-ethereum/pull/17225
Expand Down
18 changes: 17 additions & 1 deletion cmd/evm/blockrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"os"
"regexp"
"sort"

"github.com/scroll-tech/go-ethereum/core/rawdb"
Expand All @@ -30,11 +31,18 @@ import (
"github.com/urfave/cli/v2"
)

var RunFlag = &cli.StringFlag{
Name: "run",
Value: ".*",
Usage: "Run only those tests matching the regular expression.",
}

var blockTestCommand = &cli.Command{
Action: blockTestCmd,
Name: "blocktest",
Usage: "executes the given blockchain tests",
ArgsUsage: "<file>",
Flags: []cli.Flag{RunFlag},
}

func blockTestCmd(ctx *cli.Context) error {
Expand All @@ -61,13 +69,21 @@ func blockTestCmd(ctx *cli.Context) error {
if err = json.Unmarshal(src, &tests); err != nil {
return err
}
// run them in order
re, err := regexp.Compile(ctx.String(RunFlag.Name))
if err != nil {
return fmt.Errorf("invalid regex -%s: %v", RunFlag.Name, err)
}

// Run them in order
var keys []string
for key := range tests {
keys = append(keys, key)
}
sort.Strings(keys)
for _, name := range keys {
if !re.MatchString(name) {
continue
}
test := tests[name]
if err := test.Run(false, rawdb.HashScheme, tracer); err != nil {
return fmt.Errorf("test %v: %w", name, err)
Expand Down
37 changes: 26 additions & 11 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ type rejectedTx struct {

// Apply applies a set of transactions to a pre-state
func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
txs types.Transactions, miningReward int64,
getTracerFn func(txIndex int, txHash common.Hash) (tracer vm.EVMLogger, err error)) (*state.StateDB, *ExecutionResult, error) {
txIt txIterator, miningReward int64,
getTracerFn func(txIndex int, txHash common.Hash) (tracer vm.EVMLogger, err error)) (*state.StateDB, *ExecutionResult, []byte, error) {
// Capture errors for BLOCKHASH operation, if we haven't been supplied the
// required blockhashes
var hashError error
Expand Down Expand Up @@ -195,25 +195,39 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
core.ProcessBeaconBlockRoot(*beaconRoot, evm, statedb)
}
var blobGasUsed uint64
for i, tx := range txs {

for i := 0; txIt.Next(); i++ {
tx, err := txIt.Tx()
if err != nil {
log.Warn("rejected tx", "index", i, "error", err)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()})
continue
}
if tx.Type() == types.BlobTxType && vmContext.BlobBaseFee == nil {
errMsg := "blob tx used but field env.ExcessBlobGas missing"
log.Warn("rejected tx", "index", i, "hash", tx.Hash(), "error", errMsg)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, errMsg})
continue
}
if tx.Type() == types.BlobTxType {
blobGasUsed += uint64(params.BlobTxBlobGasPerBlob * len(tx.BlobHashes()))
}
msg, err := core.TransactionToMessage(tx, signer, pre.Env.BaseFee)
if err != nil {
log.Warn("rejected tx", "index", i, "hash", tx.Hash(), "error", err)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()})
continue
}
if tx.Type() == types.BlobTxType {
txBlobGas := uint64(params.BlobTxBlobGasPerBlob * len(tx.BlobHashes()))
if used, max := blobGasUsed+txBlobGas, uint64(params.MaxBlobGasPerBlock); used > max {
err := fmt.Errorf("blob gas (%d) would exceed maximum allowance %d", used, max)
log.Warn("rejected tx", "index", i, "err", err)
rejectedTxs = append(rejectedTxs, &rejectedTx{i, err.Error()})
continue
}
blobGasUsed += txBlobGas
}
tracer, err := getTracerFn(txIndex, tx.Hash())
if err != nil {
return nil, nil, err
return nil, nil, nil, err
}
vmConfig.Tracer = tracer
statedb.SetTxContext(tx.Hash(), txIndex)
Expand Down Expand Up @@ -244,7 +258,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
}
includedTxs = append(includedTxs, tx)
if hashError != nil {
return nil, nil, NewError(ErrorMissingBlockhash, hashError)
return nil, nil, nil, NewError(ErrorMissingBlockhash, hashError)
}
gasUsed += msgResult.UsedGas

Expand Down Expand Up @@ -319,7 +333,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
// Commit block
root, err := statedb.Commit(vmContext.BlockNumber.Uint64(), chainConfig.IsEIP158(vmContext.BlockNumber))
if err != nil {
return nil, nil, NewError(ErrorEVM, fmt.Errorf("could not commit state: %v", err))
return nil, nil, nil, NewError(ErrorEVM, fmt.Errorf("could not commit state: %v", err))
}
execRs := &ExecutionResult{
StateRoot: root,
Expand All @@ -345,9 +359,10 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
// for accessing latest states.
statedb, err = state.New(root, statedb.Database(), nil)
if err != nil {
return nil, nil, NewError(ErrorEVM, fmt.Errorf("could not reopen state: %v", err))
return nil, nil, nil, NewError(ErrorEVM, fmt.Errorf("could not reopen state: %v", err))
}
return statedb, execRs, nil
body, _ := rlp.EncodeToBytes(includedTxs)
return statedb, execRs, body, nil
}

func MakePreState(db ethdb.Database, accounts core.GenesisAlloc) *state.StateDB {
Expand Down
7 changes: 3 additions & 4 deletions cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
// Check if anything needs to be read from stdin
var (
prestate Prestate
txs types.Transactions // txs to apply
txIt txIterator // txs to apply
allocStr = ctx.String(InputAllocFlag.Name)

envStr = ctx.String(InputEnvFlag.Name)
Expand Down Expand Up @@ -194,7 +194,7 @@
// Set the chain id
chainConfig.ChainID = big.NewInt(ctx.Int64(ChainIDFlag.Name))

if txs, err = loadTransactions(txStr, inputData, prestate.Env, chainConfig); err != nil {
if txIt, err = loadTransactions(txStr, inputData, prestate.Env, chainConfig); err != nil {

Check failure on line 197 in cmd/evm/internal/t8ntool/transition.go

View workflow job for this annotation

GitHub Actions / test

cannot use loadTransactions(txStr, inputData, prestate.Env, chainConfig) (value of type "github.com/scroll-tech/go-ethereum/core/types".Transactions) as txIterator value in assignment: "github.com/scroll-tech/go-ethereum/core/types".Transactions does not implement txIterator (missing method Next)
return err
}
if err := applyCurieChecks(&prestate.Env, chainConfig, inputData.ParentL1BaseFee); err != nil {
Expand All @@ -210,11 +210,10 @@
return err
}
// Run the test and aggregate the result
s, result, err := prestate.Apply(vmConfig, chainConfig, txs, ctx.Int64(RewardFlag.Name), getTracer)
s, result, body, err := prestate.Apply(vmConfig, chainConfig, txIt, ctx.Int64(RewardFlag.Name), getTracer)
if err != nil {
return err
}
body, _ := rlp.EncodeToBytes(txs)
// Dump the excution result
collector := make(Alloc)
s.DumpToCollector(collector, nil)
Expand All @@ -223,7 +222,7 @@

// txWithKey is a helper-struct, to allow us to use the types.Transaction along with
// a `secretKey`-field, for input
type txWithKey struct {

Check failure on line 225 in cmd/evm/internal/t8ntool/transition.go

View workflow job for this annotation

GitHub Actions / test

other declaration of txWithKey
key *ecdsa.PrivateKey
tx *types.Transaction
protected bool
Expand Down Expand Up @@ -273,7 +272,7 @@
//
// To manage this, we read the transactions twice, first trying to read the secretKeys,
// and secondly to read them with the standard tx json format
func signUnsignedTransactions(txs []*txWithKey, signer types.Signer) (types.Transactions, error) {

Check failure on line 275 in cmd/evm/internal/t8ntool/transition.go

View workflow job for this annotation

GitHub Actions / test

other declaration of signUnsignedTransactions
var signedTxs []*types.Transaction
for i, tx := range txs {
var (
Expand All @@ -300,7 +299,7 @@
return signedTxs, nil
}

func loadTransactions(txStr string, inputData *input, env stEnv, chainConfig *params.ChainConfig) (types.Transactions, error) {

Check failure on line 302 in cmd/evm/internal/t8ntool/transition.go

View workflow job for this annotation

GitHub Actions / test

other declaration of loadTransactions
var txsWithKeys []*txWithKey
var signed types.Transactions
if txStr != stdinSelector {
Expand Down
Loading
Loading