Skip to content

Commit

Permalink
feat: enable process pending bundles (#1433)
Browse files Browse the repository at this point in the history
Co-authored-by: colin <[email protected]>
  • Loading branch information
georgehao and colinlyguo authored Jul 12, 2024
1 parent 622ce7b commit 04a893a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions rollup/cmd/rollup_relayer/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ func action(ctx *cli.Context) error {
log.Crit("failed to create batchProposer", "config file", cfgFile, "error", err)
}

bundleProposer := watcher.NewBundleProposer(subCtx, cfg.L2Config.BundleProposerConfig, genesis.Config, db, registry)
if err != nil {
log.Crit("failed to create bundleProposer", "config file", cfgFile, "error", err)
}

l2watcher := watcher.NewL2WatcherClient(subCtx, l2client, cfg.L2Config.Confirmations, cfg.L2Config.L2MessageQueueAddress, cfg.L2Config.WithdrawTrieRootSlot, db, registry)

// Watcher loop to fetch missing blocks
Expand All @@ -110,10 +115,14 @@ func action(ctx *cli.Context) error {

go utils.Loop(subCtx, 10*time.Second, batchProposer.TryProposeBatch)

go utils.Loop(subCtx, 10*time.Second, bundleProposer.TryProposeBundle)

go utils.Loop(subCtx, 2*time.Second, l2relayer.ProcessPendingBatches)

go utils.Loop(subCtx, 15*time.Second, l2relayer.ProcessCommittedBatches)

go utils.Loop(subCtx, 15*time.Second, l2relayer.ProcessPendingBundles)

// Finish start all rollup relayer functions.
log.Info("Start rollup-relayer successfully", "version", version.Version)

Expand Down
2 changes: 1 addition & 1 deletion rollup/internal/config/l2.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type L2Config struct {
// The batch_proposer config
BatchProposerConfig *BatchProposerConfig `json:"batch_proposer_config"`
// The bundle_proposer config
BundleProposerConfig *BatchProposerConfig `json:"bundle_proposer_config"`
BundleProposerConfig *BundleProposerConfig `json:"bundle_proposer_config"`
}

// ChunkProposerConfig loads chunk_proposer configuration items.
Expand Down

0 comments on commit 04a893a

Please sign in to comment.