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 jagdeep sidhu committed Apr 12, 2022
1 parent 1ebbb9c commit c0405b7
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 c0405b7

Please sign in to comment.