Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ var (
utils.L1EndpointFlag,
utils.L1ConfirmationsFlag,
utils.L1DeploymentBlockFlag,
utils.L1SyncIntervalFlag,
utils.L1DisableMessageQueueV2Flag,
utils.CircuitCapacityCheckEnabledFlag,
utils.CircuitCapacityCheckWorkersFlag,
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.L1EndpointFlag,
utils.L1ConfirmationsFlag,
utils.L1DeploymentBlockFlag,
utils.L1SyncIntervalFlag,
utils.L1DisableMessageQueueV2Flag,
utils.RollupVerifyEnabledFlag,
utils.DASyncEnabledFlag,
Expand Down
7 changes: 7 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,10 @@ var (
Name: "l1.sync.startblock",
Usage: "L1 block height to start syncing from. Should be set to the L1 message queue deployment block number.",
}
L1SyncIntervalFlag = cli.DurationFlag{
Name: "l1.sync.interval",
Usage: "Poll interval for L1 message syncing (e.g., 2s, 10s, 1m)",
}
L1DisableMessageQueueV2Flag = &cli.BoolFlag{
Name: "l1.disablemqv2",
Usage: "Disable L1 message queue v2",
Expand Down Expand Up @@ -1470,6 +1474,9 @@ func setL1(ctx *cli.Context, cfg *node.Config) {
if ctx.GlobalIsSet(L1DeploymentBlockFlag.Name) {
cfg.L1DeploymentBlock = ctx.GlobalUint64(L1DeploymentBlockFlag.Name)
}
if ctx.GlobalIsSet(L1SyncIntervalFlag.Name) {
cfg.L1SyncInterval = ctx.GlobalDuration(L1SyncIntervalFlag.Name)
}
if ctx.GlobalIsSet(L1DisableMessageQueueV2Flag.Name) {
cfg.L1DisableMessageQueueV2 = ctx.GlobalBool(L1DisableMessageQueueV2Flag.Name)
}
Expand Down
3 changes: 3 additions & 0 deletions node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"runtime"
"strings"
"sync"
"time"

"github.com/scroll-tech/go-ethereum/common"
"github.com/scroll-tech/go-ethereum/crypto"
Expand Down Expand Up @@ -197,6 +198,8 @@ type Config struct {
L1Confirmations rpc.BlockNumber `toml:",omitempty"`
// L1 bridge deployment block number
L1DeploymentBlock uint64 `toml:",omitempty"`
// Poll interval for L1 message syncing
L1SyncInterval time.Duration `toml:",omitempty"`
// Explicitly disable L1 message queue V2 and only query from L1 message queue V1 (before EuclidV2)
L1DisableMessageQueueV2 bool `toml:",omitempty"`
// Is daSyncingEnabled
Expand Down
7 changes: 6 additions & 1 deletion rollup/sync_service/sync_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,17 @@ func NewSyncService(ctx context.Context, genesisConfig *params.ChainConfig, node

ctx, cancel := context.WithCancel(ctx)

pollInterval := nodeConfig.L1SyncInterval
if pollInterval == 0 {
pollInterval = DefaultPollInterval
}

service := SyncService{
ctx: ctx,
cancel: cancel,
client: client,
db: db,
pollInterval: DefaultPollInterval,
pollInterval: pollInterval,
latestProcessedBlock: latestProcessedBlock,
}

Expand Down
Loading