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

Add snapshot processing for all astrid modes #12339

Merged
merged 124 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
b8812c9
initial refactor for spans and events
mh0lt Aug 30, 2024
b0da397
fixed compilation errors
mh0lt Sep 1, 2024
56a7436
removed block reader bor snapshot processing
mh0lt Sep 1, 2024
605a015
removed stage binary formating dependencies
mh0lt Sep 5, 2024
628dac0
removed stage binary formating dependencies
mh0lt Sep 5, 2024
f90382a
typo
mh0lt Sep 5, 2024
fddae8c
remove temp event code
mh0lt Sep 5, 2024
d424f28
Merge branch 'main' into astrid_snapshots
mh0lt Sep 5, 2024
468d26e
fixed compile errors
mh0lt Sep 5, 2024
5f11254
regen mock
mh0lt Sep 5, 2024
07e91bb
add eventfetcher to bridge
mh0lt Sep 6, 2024
0bfd9e6
Merge branch 'main' into astrid_snapshots
mh0lt Sep 6, 2024
77be1f8
Add tx adapter
mh0lt Sep 6, 2024
bfaf380
standalone running with snapshots
mh0lt Sep 6, 2024
24f2e6f
add age to head update log
mh0lt Sep 6, 2024
39a1be5
added adaptors for index building and range adaption
mh0lt Sep 7, 2024
5ff9fba
get checkpoint id from range index
mh0lt Sep 7, 2024
c381bfa
use bridge/heimdall for stages
mh0lt Sep 9, 2024
b198ccb
add tx to range queries
mh0lt Sep 9, 2024
648b154
add printer
mh0lt Sep 9, 2024
78bc39d
add error soure detail
mh0lt Sep 9, 2024
7231688
add error soure detail
mh0lt Sep 9, 2024
1b3a619
add error soure detail
mh0lt Sep 9, 2024
17daeb3
add error soure detail
mh0lt Sep 9, 2024
3f270bd
add printer
mh0lt Sep 9, 2024
96b28f6
add printer
mh0lt Sep 9, 2024
0e90d22
add printer
mh0lt Sep 9, 2024
c76d130
pass in range table name
mh0lt Sep 9, 2024
bb2a42e
remove printer
mh0lt Sep 9, 2024
0d54442
error formatting
mh0lt Sep 9, 2024
dcb6785
add printer
mh0lt Sep 9, 2024
e9c2ce9
add printer
mh0lt Sep 10, 2024
c572038
fix entity id from store
mh0lt Sep 10, 2024
534a62d
fix withtx return
mh0lt Sep 10, 2024
e5bb649
fix store type
mh0lt Sep 10, 2024
35c1e8f
add printer
mh0lt Sep 10, 2024
78b0fe9
Merge branch 'main' into astrid_snapshots
mh0lt Sep 10, 2024
f262c9d
post merge fixes
mh0lt Sep 10, 2024
929b58e
promote fetch log
mh0lt Sep 12, 2024
97f3d7e
promote put log
mh0lt Sep 12, 2024
2672d05
add printer
mh0lt Sep 12, 2024
a150c6b
add printer
mh0lt Sep 12, 2024
161d768
add printer
mh0lt Sep 12, 2024
74171e6
add printer
mh0lt Sep 12, 2024
a296a85
add printer
mh0lt Sep 12, 2024
5d96a38
add printer
mh0lt Sep 13, 2024
70e29ea
add printer
mh0lt Sep 13, 2024
fd475f6
add printer
mh0lt Sep 13, 2024
d8a2b28
split prune and unwid functionality
mh0lt Sep 13, 2024
08a5c9b
remove printers
mh0lt Sep 13, 2024
759d391
move log
mh0lt Sep 13, 2024
e1c03d1
move log
mh0lt Sep 13, 2024
31ccf9f
Fix blocks availibility for partial blocks
mh0lt Sep 16, 2024
9b438b8
remove printers
mh0lt Sep 16, 2024
f2e6a36
check file blocks available by type
mh0lt Sep 16, 2024
484ebfa
download not complete until db processing finished
mh0lt Sep 16, 2024
8885b95
get events from snapshots
mh0lt Sep 16, 2024
4748dd8
add lastprocessed event with frozen
mh0lt Sep 17, 2024
d782683
sync start up & event snap end fixes
mh0lt Sep 18, 2024
1e8b4af
adjust logging
mh0lt Sep 18, 2024
40a83c8
rationalize stage & astrid event access code
mh0lt Sep 18, 2024
8ba307c
Merge branch 'main' into astrid_snapshots
mh0lt Sep 19, 2024
d2c6882
post merge updates
mh0lt Sep 19, 2024
587b20c
base snapshots compiling
mh0lt Sep 19, 2024
21ed721
base merge compiling
mh0lt Sep 19, 2024
70346ee
sysc.stage at tip
mh0lt Sep 20, 2024
4b9611a
fix failt on reopen of active files
mh0lt Oct 4, 2024
579740b
Merge branch 'main' into astrid_snapshots
mh0lt Oct 4, 2024
a42371c
post merge updates
mh0lt Oct 5, 2024
d1d59f5
Merge branch 'main' into astrid_snapshots
mh0lt Oct 8, 2024
cba2228
remove printer
mh0lt Oct 8, 2024
4a4c109
fix panic due to nill receipt
mh0lt Oct 8, 2024
2cd71b7
fix close nil channel panic
mh0lt Oct 8, 2024
9bb1fcf
don't wait on zero timeout
mh0lt Oct 8, 2024
c15731a
remove races
mh0lt Oct 8, 2024
59229cb
remove races
mh0lt Oct 9, 2024
4faa819
ref count frozen
mh0lt Oct 9, 2024
3068555
fix race
mh0lt Oct 11, 2024
4c58e16
tidy lock locations
mh0lt Oct 11, 2024
325e08f
Merge branch 'main' into astrid_snapshots
mh0lt Oct 11, 2024
7ebfb56
post merge changes
mh0lt Oct 11, 2024
089f605
Merge branch 'main' into astrid_snapshots
mh0lt Oct 11, 2024
2856dbc
internalize option mechanics
mh0lt Oct 12, 2024
6b1d5c1
start from snapshots (db's removed)
mh0lt Oct 12, 2024
5d97017
make file recalc atomic
mh0lt Oct 16, 2024
a247986
Merge branch 'main' into astrid_snapshots
mh0lt Oct 16, 2024
7241e80
don't reopen index if refcount>0
mh0lt Oct 16, 2024
f188e53
add bridge store to sim test
mh0lt Oct 16, 2024
7db113a
Merge branch 'main' into astrid_snapshots
mh0lt Oct 17, 2024
9410aa7
post merge fixes
mh0lt Oct 17, 2024
f712241
add stores to tests
mh0lt Oct 17, 2024
3da6cc4
Merge branch 'main' into astrid_snapshots
mh0lt Oct 17, 2024
7ba2f3d
fix test validator signature
mh0lt Oct 17, 2024
6735807
fix prune db passing
mh0lt Oct 19, 2024
dc3cca1
move snapshot ready to engine ready
mh0lt Oct 19, 2024
e2b1497
Merge branch 'main' into astrid_snapshots
mh0lt Oct 19, 2024
4767200
updated including #12362
mh0lt Oct 19, 2024
7b2d520
fix startup from 0 with no-downloader
mh0lt Oct 19, 2024
faa6429
fix heimdall service_test regression
mh0lt Oct 21, 2024
5ee2684
review fixes
mh0lt Oct 21, 2024
c2f4ea2
review fixes
mh0lt Oct 21, 2024
41c43e1
review fixes
mh0lt Oct 21, 2024
d526ff2
review fixes
mh0lt Oct 21, 2024
1a7938c
Merge branch 'main' into astrid_snapshots
mh0lt Oct 21, 2024
86f22c9
added block changes
mh0lt Oct 21, 2024
870e988
adding bissing dbs
mh0lt Oct 21, 2024
d4083dc
consolidate bridge db code
mh0lt Oct 22, 2024
d20b40e
fexed start timing and remove block reader dependency
mh0lt Oct 22, 2024
ff2b0b7
remove unecessary polygon specific code
mh0lt Oct 22, 2024
c1575cf
Merge branch 'main' into astrid_snapshots
mh0lt Oct 22, 2024
a20e6d7
post merge fixes
mh0lt Oct 22, 2024
b5f6909
fix snapshot production after db changes
mh0lt Oct 23, 2024
3ceeccd
add missing channels
mh0lt Oct 23, 2024
80abb44
Merge branch 'main' into astrid_snapshots
mh0lt Oct 23, 2024
c4ee8ba
added syncronous error check and block insert logging
mh0lt Oct 24, 2024
8bb6c19
Merge branch 'main' into astrid_snapshots
mh0lt Oct 24, 2024
dc042f3
port merge changes
mh0lt Oct 24, 2024
17228c9
review fixes
mh0lt Oct 25, 2024
e9fc731
Merge branch 'main' into astrid_snapshots
mh0lt Oct 25, 2024
9d6a6de
post merge updates
mh0lt Oct 25, 2024
dd95339
remove redundant method
mh0lt Oct 25, 2024
893d988
set correct base seg
mh0lt Oct 25, 2024
6f9e254
lint fixes
mh0lt Oct 26, 2024
e6bf473
Merge branch 'main' into astrid_snapshots
mh0lt Oct 28, 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
2 changes: 1 addition & 1 deletion accounts/abi/unpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ func TestOOMMaliciousInput(t *testing.T) {
}
encb, err := hex.DecodeString(test.enc)
if err != nil {
t.Fatalf("invalid hex: %s" + test.enc)
t.Fatalf("invalid hex: %s", test.enc)
}
_, err = abi.Methods["method"].Outputs.UnpackValues(encb)
if err == nil {
Expand Down
3 changes: 1 addition & 2 deletions cmd/capcli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,7 @@ func (r *RetrieveHistoricalState) Run(ctx *Context) error {
return err
}

var bor *freezeblocks.BorRoSnapshots
blockReader := freezeblocks.NewBlockReader(allSnapshots, bor)
blockReader := freezeblocks.NewBlockReader(allSnapshots, nil, nil, nil)
eth1Getter := getters.NewExecutionSnapshotReader(ctx, blockReader, db)
eth1Getter.SetBeaconChainConfig(beaconConfig)
csn := freezeblocks.NewCaplinSnapshots(ethconfig.BlocksFreezing{}, beaconConfig, dirs, log.Root())
Expand Down
12 changes: 6 additions & 6 deletions cmd/devnet/scenarios/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (s *suite) runStep(ctx context.Context, scenario *Scenario, step *Step, pre
earlyReturn := prevStepErr != nil || sr.Err == ErrUndefined

// Run after step handlers.
rctx, sr.Err = s.runAfterStepHooks(ctx, step, sr.Status, sr.Err)
rctx, sr.Err = s.runAfterStepHooks(ctx, step, sr.Status, sr.Err) //nolint

// Trigger after scenario on failing or last step to attach possible hook error to step.
if isLast || (sr.Status != Skipped && sr.Status != Undefined && sr.Err != nil) {
Expand Down Expand Up @@ -303,7 +303,7 @@ func (s *suite) runScenario(scenario *Scenario) (sr *ScenarioResult, err error)
if s.testingT != nil {
// Running scenario as a subtest.
s.testingT.Run(scenario.Name, func(t *testing.T) {
ctx, sr.StepResults, err = s.runSteps(ctx, scenario, scenario.Steps)
ctx, sr.StepResults, err = s.runSteps(ctx, scenario, scenario.Steps) //nolint
if s.shouldFail(err) {
t.Error(err)
}
Expand Down Expand Up @@ -346,7 +346,7 @@ func (s *suite) runBeforeStepHooks(ctx context.Context, step *Step, err error) (
}

if hctx != nil {
ctx = hctx
ctx = hctx //nolint
}
}

Expand All @@ -371,7 +371,7 @@ func (s *suite) runAfterStepHooks(ctx context.Context, step *Step, status StepSt
}

if hctx != nil {
ctx = hctx
ctx = hctx //nolint
}
}

Expand All @@ -393,7 +393,7 @@ func (s *suite) runBeforeScenarioHooks(ctx context.Context, scenario *Scenario)
}

if hctx != nil {
ctx = hctx
ctx = hctx //nolint
}
}

Expand Down Expand Up @@ -431,7 +431,7 @@ func (s *suite) runAfterScenarioHooks(ctx context.Context, scenario *Scenario, l
}

if hctx != nil {
ctx = hctx
ctx = hctx //nolint
}
}

Expand Down
130 changes: 109 additions & 21 deletions cmd/devnet/services/polygon/heimdallsim/heimdall_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@ package heimdallsim

import (
"context"
"encoding/json"
"errors"
"os"
"time"

"github.com/erigontech/erigon-lib/log/v3"

libcommon "github.com/erigontech/erigon-lib/common"
"github.com/erigontech/erigon-lib/downloader/snaptype"
"github.com/erigontech/erigon/eth/ethconfig"
"github.com/erigontech/erigon/polygon/bridge"
"github.com/erigontech/erigon/polygon/heimdall"
"github.com/erigontech/erigon/rlp"
"github.com/erigontech/erigon/turbo/snapshotsync/freezeblocks"
)

type HeimdallSimulator struct {
snapshots *freezeblocks.BorRoSnapshots
snapshots *heimdall.RoSnapshots
blockReader *freezeblocks.BlockReader

iterations []uint64 // list of final block numbers for an iteration
Expand All @@ -43,8 +45,99 @@ type HeimdallSimulator struct {

var _ heimdall.HeimdallClient = (*HeimdallSimulator)(nil)

type sprintLengthCalculator struct{}

func (sprintLengthCalculator) CalculateSprintLength(number uint64) uint64 {
return 16
}

type noopBridgeStore struct{}

func (noopBridgeStore) Prepare(ctx context.Context) error {
return nil
}

func (noopBridgeStore) Close() {}

func (noopBridgeStore) LastEventId(ctx context.Context) (uint64, error) {
return 0, errors.New("noop")
}
func (noopBridgeStore) LastEventIdWithinWindow(ctx context.Context, fromID uint64, toTime time.Time) (uint64, error) {
return 0, errors.New("noop")
}
func (noopBridgeStore) LastProcessedEventId(ctx context.Context) (uint64, error) {
return 0, errors.New("noop")
}
func (noopBridgeStore) LastProcessedBlockInfo(ctx context.Context) (bridge.ProcessedBlockInfo, bool, error) {
return bridge.ProcessedBlockInfo{}, false, errors.New("noop")
}
func (noopBridgeStore) LastFrozenEventId() uint64 {
return 0
}
func (noopBridgeStore) LastFrozenEventBlockNum() uint64 {
return 0
}
func (noopBridgeStore) EventTxnToBlockNum(ctx context.Context, borTxHash libcommon.Hash) (uint64, bool, error) {
return 0, false, errors.New("noop")
}
func (noopBridgeStore) Events(ctx context.Context, start, end uint64) ([][]byte, error) {
return nil, errors.New("noop")
}
func (noopBridgeStore) BlockEventIdsRange(ctx context.Context, blockNum uint64) (start uint64, end uint64, err error) {
return 0, 0, errors.New("noop")
}
func (noopBridgeStore) PutEventTxnToBlockNum(ctx context.Context, eventTxnToBlockNum map[libcommon.Hash]uint64) error {
return nil
}
func (noopBridgeStore) PutEvents(ctx context.Context, events []*heimdall.EventRecordWithTime) error {
return nil
}
func (noopBridgeStore) PutBlockNumToEventId(ctx context.Context, blockNumToEventId map[uint64]uint64) error {
return nil
}
func (noopBridgeStore) PutProcessedBlockInfo(ctx context.Context, info bridge.ProcessedBlockInfo) error {
return nil
}
func (noopBridgeStore) Unwind(ctx context.Context, blockNum uint64) error {
return nil
}
func (noopBridgeStore) BorStartEventId(ctx context.Context, hash libcommon.Hash, blockHeight uint64) (uint64, error) {
return 0, errors.New("noop")
}
func (noopBridgeStore) EventsByBlock(ctx context.Context, hash libcommon.Hash, blockNum uint64) ([]rlp.RawValue, error) {
return nil, errors.New("noop")
}
func (noopBridgeStore) EventsByIdFromSnapshot(from uint64, to time.Time, limit int) ([]*heimdall.EventRecordWithTime, bool, error) {
return nil, false, errors.New("noop")
}
func (noopBridgeStore) PruneEvents(ctx context.Context, blocksTo uint64, blocksDeleteLimit int) (deleted int, err error) {
return 0, nil
}

type heimdallStore struct {
spans heimdall.EntityStore[*heimdall.Span]
}

func (heimdallStore) Checkpoints() heimdall.EntityStore[*heimdall.Checkpoint] {
return nil
}
func (heimdallStore) Milestones() heimdall.EntityStore[*heimdall.Milestone] {
return nil
}
func (hs heimdallStore) Spans() heimdall.EntityStore[*heimdall.Span] {
return hs.spans
}
func (heimdallStore) SpanBlockProducerSelections() heimdall.EntityStore[*heimdall.SpanBlockProducerSelection] {
return nil
}
func (heimdallStore) Prepare(ctx context.Context) error {
return nil
}
func (heimdallStore) Close() {
}

func NewHeimdallSimulator(ctx context.Context, snapDir string, logger log.Logger, iterations []uint64) (*HeimdallSimulator, error) {
snapshots := freezeblocks.NewBorRoSnapshots(ethconfig.Defaults.Snapshot, snapDir, 0, logger)
snapshots := heimdall.NewRoSnapshots(ethconfig.Defaults.Snapshot, snapDir, 0, logger)

// index local files
localFiles, err := os.ReadDir(snapDir)
Expand All @@ -55,7 +148,7 @@ func NewHeimdallSimulator(ctx context.Context, snapDir string, logger log.Logger
for _, file := range localFiles {
info, _, _ := snaptype.ParseFileName(snapDir, file.Name())
if info.Ext == ".seg" {
err = info.Type.BuildIndexes(ctx, info, nil, snapDir, nil, log.LvlWarn, logger)
err = info.Type.BuildIndexes(ctx, info, nil, nil, snapDir, nil, log.LvlWarn, logger)
if err != nil {
return nil, err
}
Expand All @@ -67,8 +160,12 @@ func NewHeimdallSimulator(ctx context.Context, snapDir string, logger log.Logger
}

h := HeimdallSimulator{
snapshots: snapshots,
blockReader: freezeblocks.NewBlockReader(nil, snapshots),
snapshots: snapshots,
blockReader: freezeblocks.NewBlockReader(nil, snapshots,
heimdallStore{
spans: heimdall.NewSpanSnapshotStore(heimdall.NoopEntityStore[*heimdall.Span]{Type: heimdall.Spans}, snapshots),
},
bridge.NewSnapshotStore(noopBridgeStore{}, snapshots, sprintLengthCalculator{})),

iterations: iterations,

Expand Down Expand Up @@ -97,25 +194,25 @@ func (h *HeimdallSimulator) Next() {
func (h *HeimdallSimulator) FetchLatestSpan(ctx context.Context) (*heimdall.Span, error) {
latestSpan := uint64(heimdall.SpanIdAt(h.lastAvailableBlockNumber))

span, err := h.getSpan(ctx, latestSpan)
span, _, err := h.getSpan(ctx, latestSpan)
if err != nil {
return nil, err
}

return &span, nil
return span, nil
}

func (h *HeimdallSimulator) FetchSpan(ctx context.Context, spanID uint64) (*heimdall.Span, error) {
if spanID > uint64(heimdall.SpanIdAt(h.lastAvailableBlockNumber)) {
return nil, errors.New("span not found")
}

span, err := h.getSpan(ctx, spanID)
span, _, err := h.getSpan(ctx, spanID)
if err != nil {
return nil, err
}

return &span, err
return span, err
}

func (h *HeimdallSimulator) FetchSpans(ctx context.Context, page uint64, limit uint64) ([]*heimdall.Span, error) {
Expand Down Expand Up @@ -167,15 +264,6 @@ func (h *HeimdallSimulator) FetchMilestoneID(ctx context.Context, milestoneID st
return errors.New("method FetchMilestoneID not implemented")
}

func (h *HeimdallSimulator) getSpan(ctx context.Context, spanId uint64) (heimdall.Span, error) {
span, err := h.blockReader.Span(ctx, nil, spanId)
if span != nil && err == nil {
var s heimdall.Span
if err = json.Unmarshal(span, &s); err != nil {
return heimdall.Span{}, err
}
return s, err
}

return heimdall.Span{}, err
func (h *HeimdallSimulator) getSpan(ctx context.Context, spanId uint64) (*heimdall.Span, bool, error) {
return h.blockReader.Span(ctx, nil, spanId)
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestSimulatorEvents(t *testing.T) {
}

// the number of events included in v1-000000-000500-borevents.seg
eventsCount := 23
eventsCount := 100

ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Expand Down
8 changes: 4 additions & 4 deletions cmd/devnet/tests/bor_devnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ func TestStateSync(t *testing.T) {
})
t.Run("DeployChildChainReceiver", func(t *testing.T) {
var err error
ctx, err = contracts_steps.DeployChildChainReceiver(ctx, "child-funder")
ctx, err = contracts_steps.DeployChildChainReceiver(ctx, "child-funder") //nolint
require.Nil(t, err)
})
t.Run("DeployRootChainSender", func(t *testing.T) {
var err error
ctx, err = contracts_steps.DeployRootChainSender(ctx, "root-funder")
ctx, err = contracts_steps.DeployRootChainSender(ctx, "root-funder") //nolint
require.Nil(t, err)
})
t.Run("GenerateSyncEvents", func(t *testing.T) {
Expand Down Expand Up @@ -87,12 +87,12 @@ func TestChildChainExit(t *testing.T) {
})
t.Run("DeployRootChainReceiver", func(t *testing.T) {
var err error
ctx, err = contracts_steps.DeployRootChainReceiver(ctx, "root-funder")
ctx, err = contracts_steps.DeployRootChainReceiver(ctx, "root-funder") //nolint
require.Nil(t, err)
})
t.Run("DeployChildChainSender", func(t *testing.T) {
var err error
ctx, err = contracts_steps.DeployChildChainSender(ctx, "child-funder")
ctx, err = contracts_steps.DeployChildChainSender(ctx, "child-funder") //nolint
require.Nil(t, err)
})
t.Run("ProcessChildTransfers", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/diag/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func main() {

var cancel context.CancelFunc

ctx.Context, cancel = context.WithCancel(sync.WithLogger(ctx.Context, logger))
ctx.Context, cancel = context.WithCancel(sync.WithLogger(ctx.Context, logger)) //nolint

go handleTerminationSignals(cancel, logger)

Expand Down
4 changes: 2 additions & 2 deletions cmd/downloader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
"time"

"github.com/erigontech/erigon-lib/common/dbg"
_ "github.com/erigontech/erigon/core/snaptype" //hack
_ "github.com/erigontech/erigon/polygon/bor/snaptype" //hack
_ "github.com/erigontech/erigon/core/snaptype" //hack
_ "github.com/erigontech/erigon/polygon/heimdall" //hack

"github.com/anacrolix/torrent/metainfo"
"github.com/c2h5oh/datasize"
Expand Down
2 changes: 1 addition & 1 deletion cmd/hack/hack.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func printCurrentBlockNumber(chaindata string) {
}

func blocksIO(db kv.RoDB) (services.FullBlockReader, *blockio.BlockWriter) {
br := freezeblocks.NewBlockReader(freezeblocks.NewRoSnapshots(ethconfig.BlocksFreezing{}, "", 0, log.New()), nil /* BorSnapshots */)
br := freezeblocks.NewBlockReader(freezeblocks.NewRoSnapshots(ethconfig.BlocksFreezing{}, "", 0, log.New()), nil, nil, nil)
bw := blockio.NewBlockWriter()
return br, bw
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/integration/commands/reset_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/erigontech/erigon-lib/kv"
"github.com/erigontech/erigon-lib/kv/rawdbv3"
"github.com/erigontech/erigon-lib/state"
"github.com/erigontech/erigon/polygon/heimdall"
"github.com/erigontech/erigon/turbo/snapshotsync/freezeblocks"

"github.com/erigontech/erigon/core/rawdb/rawdbhelpers"
Expand All @@ -54,7 +55,7 @@ var cmdResetState = &cobra.Command{
}
ctx, _ := common.RootContext()
defer db.Close()
sn, borSn, agg, _ := allSnapshots(ctx, db, logger)
sn, borSn, agg, _, _, _ := allSnapshots(ctx, db, logger)
defer sn.Close()
defer borSn.Close()
defer agg.Close()
Expand Down Expand Up @@ -113,7 +114,7 @@ func init() {
rootCmd.AddCommand(cmdClearBadBlocks)
}

func printStages(tx kv.Tx, snapshots *freezeblocks.RoSnapshots, borSn *freezeblocks.BorRoSnapshots, agg *state.Aggregator) error {
func printStages(tx kv.Tx, snapshots *freezeblocks.RoSnapshots, borSn *heimdall.RoSnapshots, agg *state.Aggregator) error {
var err error
var progress uint64
w := new(tabwriter.Writer)
Expand Down
2 changes: 1 addition & 1 deletion cmd/integration/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func openDB(opts kv2.MdbxOpts, applyMigrations bool, logger log.Logger) (kv.RwDB
}

if opts.GetLabel() == kv.ChainDB {
_, _, agg, _ := allSnapshots(context.Background(), db, logger)
_, _, agg, _, _, _ := allSnapshots(context.Background(), db, logger)
tdb, err := temporal.New(db, agg)
if err != nil {
return nil, err
Expand Down
Loading
Loading