Skip to content

Commit

Permalink
core: fix benchmark panic (ethereum#24657)
Browse files Browse the repository at this point in the history
This PR fixes a few panics in the chain marker benchmarks. The root
cause for panic is in chain marker the genesis header/block is not
accessible, while it's expected to be obtained in tests. So this PR
avoids touching genesis header at all to avoid panic.
  • Loading branch information
rjl493456442 authored and cp-wjhan committed Nov 28, 2022
1 parent 1545844 commit bfaf527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func genTxRing(naccounts int) func(int, *BlockGen) {

// genUncles generates blocks with two uncle headers.
func genUncles(i int, gen *BlockGen) {
if i >= 6 {
if i >= 7 {
b2 := gen.PrevBlock(i - 6).Header()
b2.Extra = []byte("foo")
gen.AddUncle(b2)
Expand Down

0 comments on commit bfaf527

Please sign in to comment.