Skip to content

Conversation

@nischitpra
Copy link
Collaborator

@nischitpra nischitpra commented Dec 3, 2025

Summary by CodeRabbit

  • New Features

    • Introduced configurable block committer lag parameter to manage block processing timing.
  • Improvements

    • RPC endpoint now automatically detects block receipts support without requiring manual configuration.
    • RPC client connections now disable tracking by default.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Walkthrough

Configuration adds a new CommitterLagByBlocks field for block-based lag control. The committer's readiness check is updated to wait until the next block number plus the configured lag reaches the latest block. RPC initialization is modified to disable insight tracking via custom headers and always probe for eth_getBlockReceipts support without configuration gating.

Changes

Cohort / File(s) Summary
Configuration and Feature Detection
configs/config.go
Added CommitterLagByBlocks uint64 field to Config struct with env var COMMITTER_LAG_BY_BLOCKS (default: 0). Set default for rpc.blockReceipts.enabled to true in LoadConfig.
Committer Block Processing Logic
internal/committer/poollatest.go
Modified readiness check to apply lag-aware condition: waits until nextBlockNumber + CommitterLagByBlocks >= latestBlock before proceeding to fetch/validate and publish blocks.
RPC Initialization and Feature Detection
internal/rpc/rpc.go
Initialize() now uses gethRpc.DialOptions with custom header to disable insight tracking. checkGetBlockReceiptsSupport() always probes endpoint for eth_getBlockReceipts support; removed configuration gating and adjusted logging (Info on success, warning on failure).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Configuration changes are straightforward additions with sensible defaults
  • Lag-aware condition in poollatest.go is a localized logic modification
  • RPC changes involve initialization pattern shift and feature detection flow, but modifications are contained within their respective functions
  • Consider attention to: the lag comparison logic (ensure off-by-one correctness) and the implications of always probing for eth_getBlockReceipts rather than respecting configuration

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'disable insight rpc' directly relates to the main change: disabling RPC tracking via a custom header in the RPC client initialization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch np/disable_insight_rpc

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8343bf2 and 0dcbca7.

📒 Files selected for processing (3)
  • configs/config.go (2 hunks)
  • internal/committer/poollatest.go (1 hunks)
  • internal/rpc/rpc.go (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
internal/committer/poollatest.go (1)
configs/config.go (1)
  • Cfg (86-86)
🔇 Additional comments (5)
configs/config.go (2)

64-64: LGTM! Clean addition of lag configuration.

The new CommitterLagByBlocks field follows the existing pattern and allows configurable block lag for the committer, which aligns with the PR objective.


98-99: Verify the impact of defaulting block receipts to enabled.

Setting rpc.blockReceipts.enabled to true by default changes the behavior for any deployments that didn't explicitly configure this setting. Confirm this default aligns with the expected behavior across all environments and check if existing configuration files override this value.

internal/rpc/rpc.go (2)

184-196: LGTM! Unconditional capability probing improves runtime detection.

The change to always probe for eth_getBlockReceipts support is a good practice for runtime capability detection. The implementation correctly handles both success and failure cases with appropriate logging.


75-82: LGTM! Implementation correctly uses gethRpc.DialOptions with custom header.

The change from gethRpc.Dial to gethRpc.DialOptions(ctx, rpcUrl, gethRpc.WithHeader("x-disable-insight-rpc", "true")) follows the correct go-ethereum API pattern. The addition of a context parameter and custom header is properly structured. Confirm that the RPC endpoint recognizes the x-disable-insight-rpc header name for your provider's tracking configuration.

internal/committer/poollatest.go (1)

32-32: LGTM! Lag-based readiness check correctly implemented.

The condition nextBlockNumber + config.Cfg.CommitterLagByBlocks >= latestBlock.Uint64() correctly ensures the committer maintains at least the configured lag distance from the latest block. When lag is 0, it behaves as before (waits until caught up); when lag > 0, it stays behind by that many blocks.


Comment @coderabbitai help to get the list of available commands and usage tips.

@nischitpra nischitpra merged commit 655c22b into main Dec 3, 2025
5 of 6 checks passed
@nischitpra nischitpra deleted the np/disable_insight_rpc branch December 3, 2025 07:45
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.

2 participants