Skip to content

Commit

Permalink
Make polygon.sync default (#13376)
Browse files Browse the repository at this point in the history
This PR changes the default flags for erigon to run astrid sync as the
default for pos networks

---------

Co-authored-by: taratorio <94537774+taratorio@users.noreply.github.com>
  • Loading branch information
mh0lt and taratorio authored Jan 15, 2025
1 parent 5242eed commit fa5e176
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/rpcdaemon/cli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func RootCommand() (*cobra.Command, *httpcfg.HttpCfg) {
rootCmd.PersistentFlags().BoolVar(&cfg.GraphQLEnabled, "graphql", false, "enables graphql endpoint (disabled by default)")
rootCmd.PersistentFlags().Uint64Var(&cfg.Gascap, "rpc.gascap", 50_000_000, "Sets a cap on gas that can be used in eth_call/estimateGas")
rootCmd.PersistentFlags().Uint64Var(&cfg.MaxTraces, "trace.maxtraces", 200, "Sets a limit on traces that can be returned in trace_filter")
rootCmd.PersistentFlags().BoolVar(&polygonSync, "polygon.sync", false, "Enable if Erigon has been synced using the new polygon sync component")
rootCmd.PersistentFlags().BoolVar(&polygonSync, "polygon.sync", true, "Enable if Erigon has been synced using the new polygon sync component")

rootCmd.PersistentFlags().StringVar(&cfg.RpcAllowListFilePath, utils.RpcAccessListFlag.Name, "", "Specify granular (method-by-method) API allowlist")
rootCmd.PersistentFlags().UintVar(&cfg.RpcBatchConcurrency, utils.RpcBatchConcurrencyFlag.Name, 2, utils.RpcBatchConcurrencyFlag.Usage)
Expand Down
10 changes: 10 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,12 +788,14 @@ var (
Usage: "Ignore the bor block period and wait for 'blocksize' transactions (for testing purposes)",
}

// TODO - this is a depricated flag - should be removed
WithHeimdallMilestones = cli.BoolFlag{
Name: "bor.milestone",
Usage: "Enabling bor milestone processing",
Value: true,
}

// TODO - this is a depricated flag - should be removed
WithHeimdallWaypoints = cli.BoolFlag{
Name: "bor.waypoints",
Usage: "Enabling bor waypont recording",
Expand All @@ -803,8 +805,10 @@ var (
PolygonSyncFlag = cli.BoolFlag{
Name: "polygon.sync",
Usage: "Enabling syncing using the new polygon sync component",
Value: true,
}

// TODO - this is a depricated flag - should be removed
PolygonSyncStageFlag = cli.BoolFlag{
Name: "polygon.sync.stage",
Usage: "Enabling syncing with a stage that uses the polygon sync component",
Expand Down Expand Up @@ -1693,6 +1697,12 @@ func setBorConfig(ctx *cli.Context, cfg *ethconfig.Config, nodeConfig *nodecfg.C
cfg.WithHeimdallWaypointRecording = ctx.Bool(WithHeimdallWaypoints.Name)
cfg.PolygonSync = ctx.Bool(PolygonSyncFlag.Name)
cfg.PolygonSyncStage = ctx.Bool(PolygonSyncStageFlag.Name)

if cfg.PolygonSync {
cfg.WithHeimdallMilestones = false
cfg.WithHeimdallWaypointRecording = true
}

heimdall.RecordWayPoints(cfg.WithHeimdallWaypointRecording || cfg.PolygonSync || cfg.PolygonSyncStage)

chainConfig := params.ChainConfigByChainName(ctx.String(ChainFlag.Name))
Expand Down

0 comments on commit fa5e176

Please sign in to comment.