diff --git a/zk/erigon_db/db.go b/zk/erigon_db/db.go index 85916867bde..a4b33ad8083 100644 --- a/zk/erigon_db/db.go +++ b/zk/erigon_db/db.go @@ -37,7 +37,13 @@ func (db ErigonDb) WriteHeader( return nil, fmt.Errorf("failed to get parent header: %w", err) } - h := core.MakeEmptyHeader(parentHeader, chainConfig, ts, &gasLimit) + h := ðTypes.Header{} + + if parentHeader != nil { + h = core.MakeEmptyHeader(parentHeader, chainConfig, ts, &gasLimit) + } else { + h.Number = blockNo + } h.ParentHash = parentHash h.Root = stateRoot diff --git a/zk/stages/stage_batches_test.go b/zk/stages/stage_batches_test.go index d3f622932ab..c721e7bc6c0 100644 --- a/zk/stages/stage_batches_test.go +++ b/zk/stages/stage_batches_test.go @@ -5,6 +5,7 @@ import ( "encoding/hex" "testing" + "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/kv/memdb" @@ -72,7 +73,8 @@ func TestUnwindBatches(t *testing.T) { require.NoError(t, err) dsClient := NewTestDatastreamClient(fullL2Blocks, gerUpdates) - cfg := StageBatchesCfg(db1, dsClient, ðconfig.Zk{}, nil) + + cfg := StageBatchesCfg(db1, dsClient, ðconfig.Zk{}, &chain.Config{}, nil) s := &stagedsync.StageState{ID: stages.Batches, BlockNumber: 0} u := &stagedsync.Sync{}