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

upstream: merge geth date 1210 #2799

Merged
merged 45 commits into from
Dec 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
66d8185
version: begin v1.14.13 release cycle
holiman Nov 19, 2024
aa63692
version: fix typo in v1.14.13 release cycle name
holiman Nov 19, 2024
6d3d252
core/vm/program: evm bytecode-building utility (#30725)
holiman Nov 20, 2024
e3d61e6
core, eth, internal, cmd: rework EVM constructor (#30745)
rjl493456442 Nov 20, 2024
a25be32
core, eth, internal, miner: remove unnecessary parameters (#30776)
rjl493456442 Nov 22, 2024
2cd25fd
internal/ethapi: remove double map-clone (#30788)
hyunsooda Nov 22, 2024
16f2f71
all: typos in comments (#30779)
wangjingcun Nov 22, 2024
6eeff3e
trie: replace custom logic with bytes.HasPrefix (#30771)
j2gg0s Nov 22, 2024
6485d5e
core, triedb: remove destruct flag in state snapshot (#30752)
rjl493456442 Nov 22, 2024
5e1a39d
internal/flags: fix "flag redefined" bug for alias on custom flags (#…
gzliudan Nov 24, 2024
ab4a1cc
eth/tracers/logger: fix json-logger output missing (#30804)
holiman Nov 25, 2024
02159d5
eth/tracers/logger: improve markdown logger (#30805)
holiman Nov 25, 2024
19fa71b
internal/ethapi: remove double map-clone (#30803)
hyunsooda Nov 25, 2024
3c754e2
accounts/abi: fix MakeTopics mutation of big.Int inputs (#30785)
jmank88 Nov 25, 2024
2380012
core/state/snapshot: simplify snapshot rebuild (#30772)
ARR4N Nov 25, 2024
b4d99e3
eth/ethconfig: improve error message if TTD missing (#30807)
fjl Nov 26, 2024
d7e7b54
core/tracing: add GetCodeHash to StateDB (#30784)
nebojsa94 Nov 26, 2024
a11b4be
Revert "core/state/snapshot: simplify snapshot rebuild (#30772)" (#30…
rjl493456442 Nov 26, 2024
915248c
cmd/evm: don't reuse state between iterations, show errors (#30780)
jwasinger Nov 26, 2024
e0deac7
core: better document reason for dropping error on return (#30811)
wangjingcun Nov 27, 2024
8c1a36d
core/state/snapshot: handle legacy journal (#30802)
rjl493456442 Nov 28, 2024
2406305
trie: combine validation loops in VerifyRangeProof (#30823)
weiihann Nov 28, 2024
db8eed8
all: exclude empty outputs in requests commitment (#30670)
fjl Nov 28, 2024
53f66c1
cmd/bootnode: remove bootnode utility (#30813)
MariusVanDerWijden Nov 28, 2024
c7a8bce
core/types: add length check in CalcRequestsHash (#30829)
fjl Nov 28, 2024
05148d9
triedb/pathdb: track flat state changes in pathdb (snapshot integrati…
rjl493456442 Nov 29, 2024
03c37cd
core/state: introduce code reader interface (#30816)
rjl493456442 Nov 29, 2024
a793bc7
core: switch EVM tx context in ApplyMessage (#30809)
rjl493456442 Nov 29, 2024
ce8cec0
eth/tracers: fix state hooks in API (#30830)
s1na Nov 29, 2024
5347280
cmd/evm: improve block/state test runner (#30633)
lightclient Dec 2, 2024
9848e9b
fuzzing: fix oss-fuzz fuzzer (#30845)
holiman Dec 2, 2024
ae5a16f
internal/debug: rename --trace to --go-execution-trace (#30846)
fjl Dec 2, 2024
4afab7e
eth/downloader: move SyncMode to package eth/ethconfig (#30847)
fjl Dec 3, 2024
84cabb5
CODEOWNERS: add some more entries for auto assignment (#30851)
fjl Dec 3, 2024
f0e7382
cmd/evm, eth/tracers: refactor structlogger and make it streaming (#3…
holiman Dec 4, 2024
67a3b08
core/tracing: extends tracing.Hooks with OnSystemCallStartV2 (#30786)
nebojsa94 Dec 4, 2024
08e6bdb
trie/utils: ensure master can generate a correct genesis for kaustine…
gballet Dec 6, 2024
a722adb
core/txpool: remove unused parameter `local` (#30871)
stevemilk Dec 9, 2024
a91dcf3
core/state: enable partial-functional reader (snapshot integration pt…
rjl493456442 Dec 10, 2024
75f8473
cmd/evm: consolidate evm output switches (#30849)
holiman Dec 10, 2024
4ecf085
core/vm: remove unnecessary comment (#30887)
hzysvilla Dec 10, 2024
9045b79
metrics, cmd/geth: change init-process of metrics (#30814)
holiman Dec 10, 2024
4ed36ea
build: update to Go 1.23.4 (#30872)
hteevoli Dec 10, 2024
330190e
accounts/abi: support unpacking solidity errors (#30738)
darrenvechain Dec 10, 2024
2a1dcaf
Merge branch 'geth-master-date-1210' into bsc-develop
buddh0 Dec 12, 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
Prev Previous commit
Next Next commit
cmd/evm: don't reuse state between iterations, show errors (#30780)
Reusing state between benchmark iterations resulted in inconsistent
results across runs, which surfaced in ethereum/go-ethereum#30778 .

If these errors are triggered again, they will now trigger panic. 

---------

Co-authored-by: Martin HS <martin@swende.se>
  • Loading branch information
jwasinger and holiman authored Nov 26, 2024
commit 915248cd6bf14b9d1b29db182375bc456d4ef868
23 changes: 14 additions & 9 deletions cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,20 @@ type execStats struct {

func timedExec(bench bool, execFunc func() ([]byte, uint64, error)) ([]byte, execStats, error) {
if bench {
testing.Init()
// Do one warm-up run
output, gasUsed, err := execFunc()
result := testing.Benchmark(func(b *testing.B) {
for i := 0; i < b.N; i++ {
haveOutput, haveGasUsed, haveErr := execFunc()
if !bytes.Equal(haveOutput, output) {
b.Fatalf("output differs, have\n%x\nwant%x\n", haveOutput, output)
panic(fmt.Sprintf("output differs\nhave %x\nwant %x\n", haveOutput, output))
}
if haveGasUsed != gasUsed {
b.Fatalf("gas differs, have %v want%v", haveGasUsed, gasUsed)
panic(fmt.Sprintf("gas differs, have %v want %v", haveGasUsed, gasUsed))
}
if haveErr != err {
b.Fatalf("err differs, have %v want%v", haveErr, err)
panic(fmt.Sprintf("err differs, have %v want %v", haveErr, err))
}
}
})
Expand Down Expand Up @@ -137,7 +138,7 @@ func runCmd(ctx *cli.Context) error {
var (
tracer *tracing.Hooks
debugLogger *logger.StructLogger
statedb *state.StateDB
prestate *state.StateDB
chainConfig *params.ChainConfig
sender = common.BytesToAddress([]byte("sender"))
receiver = common.BytesToAddress([]byte("receiver"))
Expand Down Expand Up @@ -174,7 +175,7 @@ func runCmd(ctx *cli.Context) error {
defer triedb.Close()
genesis := genesisConfig.MustCommit(db, triedb)
sdb := state.NewDatabase(triedb, nil)
statedb, _ = state.New(genesis.Root(), sdb)
prestate, _ = state.New(genesis.Root(), sdb)
chainConfig = genesisConfig.Config

if ctx.String(SenderFlag.Name) != "" {
Expand Down Expand Up @@ -231,7 +232,7 @@ func runCmd(ctx *cli.Context) error {
}
runtimeConfig := runtime.Config{
Origin: sender,
State: statedb,
State: prestate,
GasLimit: initialGas,
GasPrice: flags.GlobalBig(ctx, PriceFlag.Name),
Value: flags.GlobalBig(ctx, ValueFlag.Name),
Expand Down Expand Up @@ -274,14 +275,18 @@ func runCmd(ctx *cli.Context) error {
if ctx.Bool(CreateFlag.Name) {
input = append(code, input...)
execFunc = func() ([]byte, uint64, error) {
// don't mutate the state!
runtimeConfig.State = prestate.Copy()
output, _, gasLeft, err := runtime.Create(input, &runtimeConfig)
return output, gasLeft, err
}
} else {
if len(code) > 0 {
statedb.SetCode(receiver, code)
prestate.SetCode(receiver, code)
}
execFunc = func() ([]byte, uint64, error) {
// don't mutate the state!
runtimeConfig.State = prestate.Copy()
output, gasLeft, err := runtime.Call(receiver, input, &runtimeConfig)
return output, initialGas - gasLeft, err
}
Expand All @@ -291,7 +296,7 @@ func runCmd(ctx *cli.Context) error {
output, stats, err := timedExec(bench, execFunc)

if ctx.Bool(DumpFlag.Name) {
root, err := statedb.Commit(genesisConfig.Number, true)
root, err := runtimeConfig.State.Commit(genesisConfig.Number, true)
if err != nil {
fmt.Printf("Failed to commit changes %v\n", err)
return err
Expand All @@ -310,7 +315,7 @@ func runCmd(ctx *cli.Context) error {
logger.WriteTrace(os.Stderr, debugLogger.StructLogs())
}
fmt.Fprintln(os.Stderr, "#### LOGS ####")
logger.WriteLogs(os.Stderr, statedb.Logs())
logger.WriteLogs(os.Stderr, runtimeConfig.State.Logs())
}

if bench || ctx.Bool(StatDumpFlag.Name) {
Expand Down