Skip to content

feat: make sync staleness check configurable via --max-sync-delay#793

Open
atlas7545 wants to merge 3 commits into
a16z:masterfrom
atlas7545:configurable-sync-delay
Open

feat: make sync staleness check configurable via --max-sync-delay#793
atlas7545 wants to merge 3 commits into
a16z:masterfrom
atlas7545:configurable-sync-delay

Conversation

@atlas7545

Copy link
Copy Markdown

Summary

Adds a --max-sync-delay CLI flag and corresponding config option to allow users to configure the maximum age (in seconds) of the latest block before Helios considers itself out of sync.

Previously this was hardcoded to 60 seconds in core/src/client/node.rs. The default remains 60s, preserving existing behavior.

Changes

  • core/src/client/node.rs — replaced hardcoded 60 with configurable self.max_sync_delay
  • core/src/client/mod.rs — pass max_sync_delay through to Node::new()
  • ethereum/src/config/mod.rs — added max_sync_delay: u64 field to Config (default: 60)
  • ethereum/src/config/cli.rs — added max_sync_delay to CliConfig
  • ethereum/src/builder.rs — thread config value through builder
  • cli/src/main.rs — added --max-sync-delay CLI flag
  • opstack/src/builder.rs — pass default (60) to HeliosClient::new()
  • linea/src/builder.rs — pass default (60) to HeliosClient::new()

Usage

# Default behavior (60s)
helios ethereum --execution-rpc http://localhost:8545

# Custom sync delay (120s)
helios ethereum --execution-rpc http://localhost:8545 --max-sync-delay 120

Compiles cleanly (cargo check passes).

atlas7545 and others added 3 commits April 2, 2026 19:57
Add a --max-sync-delay CLI flag and corresponding config option to
allow users to configure the maximum age (in seconds) of the latest
block before Helios considers itself out of sync.

Previously this was hardcoded to 60 seconds. The default remains 60s,
preserving existing behavior.

Threaded through: CLI args → CliConfig → Config → builder → Node
- Apply rustfmt formatting to function signatures in node.rs and mod.rs
- Replace manual checked_sub().unwrap_or_default() with saturating_sub()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant