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

datastream catchup get executed block if datastream block is 0 #1154

Merged
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion zk/stages/stage_dataStreamCatchup.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/ledgerwatch/erigon/eth/stagedsync/stages"
"github.com/ledgerwatch/erigon/zk/datastream/server"
"github.com/ledgerwatch/erigon/zk/hermez_db"
"github.com/ledgerwatch/log/v3"
"github.com/ledgerwatch/erigon/zk/sequencer"
"github.com/ledgerwatch/log/v3"
)

type DataStreamCatchupCfg struct {
Expand Down Expand Up @@ -91,6 +91,15 @@ func CatchupDatastream(ctx context.Context, logPrefix string, tx kv.RwTx, stream
if err != nil {
return 0, err
}

// this handles a case where the node was synced in RPC mode without a datastream
// in this case the datastream progress will be 0 but it still should catch up
if finalBlockNumber == 0 {
finalBlockNumber, err = stages.GetStageProgress(tx, stages.Execution)
if err != nil {
return 0, err
}
}
} else {
finalBlockNumber, err = stages.GetStageProgress(tx, stages.Execution)
if err != nil {
Expand Down
Loading