Skip to content

Commit

Permalink
refactor(rollup-relayer): remove outdated logic (#1561)
Browse files Browse the repository at this point in the history
Co-authored-by: colinlyguo <[email protected]>
  • Loading branch information
colinlyguo and colinlyguo authored Nov 21, 2024
1 parent 22dd390 commit 1c22307
Show file tree
Hide file tree
Showing 17 changed files with 273 additions and 2,336 deletions.
7 changes: 7 additions & 0 deletions common/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
// RollupRelayerFlags contains flags only used in rollup-relayer
RollupRelayerFlags = []cli.Flag{
&ImportGenesisFlag,
&MinCodecVersionFlag,
}
// ConfigFileFlag load json type config file.
ConfigFileFlag = cli.StringFlag{
Expand Down Expand Up @@ -90,4 +91,10 @@ var (
Usage: "Genesis file of the network",
Value: "./conf/genesis.json",
}
// MinCodecVersionFlag defines the minimum codec version required for the chunk/batch/bundle proposers
MinCodecVersionFlag = cli.UintFlag{
Name: "min-codec-version",
Usage: "Minimum required codec version for the chunk/batch/bundle proposers",
Required: true,
}
)
2 changes: 1 addition & 1 deletion common/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime/debug"
)

var tag = "v4.4.76"
var tag = "v4.4.77"

var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
Expand Down
10 changes: 5 additions & 5 deletions rollup/cmd/rollup_relayer/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/scroll-tech/da-codec/encoding"
"github.com/scroll-tech/go-ethereum/ethclient"
"github.com/scroll-tech/go-ethereum/log"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -84,9 +85,10 @@ func action(ctx *cli.Context) error {
log.Crit("failed to create l2 relayer", "config file", cfgFile, "error", err)
}

chunkProposer := watcher.NewChunkProposer(subCtx, cfg.L2Config.ChunkProposerConfig, genesis.Config, db, registry)
batchProposer := watcher.NewBatchProposer(subCtx, cfg.L2Config.BatchProposerConfig, genesis.Config, db, registry)
bundleProposer := watcher.NewBundleProposer(subCtx, cfg.L2Config.BundleProposerConfig, genesis.Config, db, registry)
minCodecVersion := encoding.CodecVersion(ctx.Uint(utils.MinCodecVersionFlag.Name))
chunkProposer := watcher.NewChunkProposer(subCtx, cfg.L2Config.ChunkProposerConfig, minCodecVersion, genesis.Config, db, registry)
batchProposer := watcher.NewBatchProposer(subCtx, cfg.L2Config.BatchProposerConfig, minCodecVersion, genesis.Config, db, registry)
bundleProposer := watcher.NewBundleProposer(subCtx, cfg.L2Config.BundleProposerConfig, minCodecVersion, genesis.Config, db, registry)

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

Expand All @@ -108,8 +110,6 @@ func action(ctx *cli.Context) error {

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.
Expand Down
Loading

0 comments on commit 1c22307

Please sign in to comment.