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

Make polygon.sync default #13376

Merged
merged 4 commits into from
Jan 15, 2025
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
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")
Copy link
Member

@taratorio taratorio Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mh0lt I think we also need to set Value: true for the main --polygon.sync flag variable here https://github.com/erigontech/erigon/blob/main/cmd/utils/flags.go#L803-L806

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


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
Loading