Skip to content

feat: extend monitoring timeout configuration for settlement readiness#312

Merged
nahimterrazas merged 6 commits intomainfrom
arb-broadcaster-monitoring-timeout
Mar 24, 2026
Merged

feat: extend monitoring timeout configuration for settlement readiness#312
nahimterrazas merged 6 commits intomainfrom
arb-broadcaster-monitoring-timeout

Conversation

@nahimterrazas
Copy link
Copy Markdown
Collaborator

@nahimterrazas nahimterrazas commented Mar 18, 2026

  • Updated the monitoring timeout validation to allow a maximum of 14 days (1,209,600 seconds) to accommodate optimistic-rollup broadcaster routes.
  • Added to various configuration structures and tests, ensuring it defaults to the new maximum when not explicitly set.
  • Enhanced documentation to clarify the purpose and usage of the field in configuration files.

Summary

Testing Process

Checklist

  • Add a reference to related issues in the PR description.
  • Add unit tests if applicable.

Summary by CodeRabbit

  • New Features

    • Monitoring timeout is now configurable up to 14 days and exposed as an optional seed/bootstrap config field.
  • Bug Fixes / Behavior

    • Merge logic now respects initializer/override monitoring timeout when building runtime config.
    • Validation message updated to reflect the new maximum value.
  • Tests

    • Added tests for extended validation bounds and override/merge behavior; updated test fixtures.
  • Documentation

    • Docs updated with field description, valid range, defaults, and guidance for long-running broadcaster scenarios.

- Updated the monitoring timeout validation to allow a maximum of 14 days (1,209,600 seconds) to accommodate optimistic-rollup broadcaster routes.
- Added  to various configuration structures and tests, ensuring it defaults to the new maximum when not explicitly set.
- Enhanced documentation to clarify the purpose and usage of the  field in configuration files.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e753d32b-8aed-4654-93ea-b02e325fe5d1

📥 Commits

Reviewing files that changed from the base of the PR and between d36b00c and 23b70f5.

📒 Files selected for processing (2)
  • crates/solver-core/src/engine/token_manager.rs
  • crates/solver-demo/src/operations/init/mod.rs
✅ Files skipped from review due to trivial changes (1)
  • crates/solver-core/src/engine/token_manager.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/solver-demo/src/operations/init/mod.rs

📝 Walkthrough

Walkthrough

Expanded solver monitoring timeout upper bound to 1,209,600 seconds (14 days); added optional monitoring_timeout_seconds to seed overrides; merged initializer override/fallback into operator config; updated tests and documentation.

Changes

Cohort / File(s) Summary
Config Validation
crates/solver-config/src/lib.rs
Adjusted validation upper bound for solver.monitoring_timeout_seconds to 1_209_600 and updated the validation message and tests.
Seed Overrides Type
crates/solver-types/src/seed_overrides.rs
Added monitoring_timeout_seconds: Option<u64> with #[serde(default)]; updated test constructors to include None.
Merge Logic
crates/solver-service/src/config_merge.rs
Merge now prefers initializer.monitoring_timeout_seconds when present, otherwise falls back to seed.defaults.monitoring_timeout_seconds; wired into OperatorSolverConfig; added unit tests.
Demo/Test Fixtures
crates/solver-demo/src/operations/init/mod.rs
Updated test seed fixtures to include monitoring_timeout_seconds: None for new struct field.
Documentation
docs/config-storage.md, docs/oracles/settlement-timing-configuration.md
Documented new monitoring_timeout_seconds field, valid range (30–1,209,600), default behavior, and guidance for long-running broadcaster routes.
Tests / Minor Fix
crates/solver-core/src/engine/token_manager.rs
Adjusted test panic/assert formatting for unexpected TokenManagerError variant.

Sequence Diagram(s)

sequenceDiagram
    participant Seed as SeedOverrides
    participant Init as Initializer
    participant Merger as ConfigMerger
    participant Operator as OperatorConfig
    participant Runtime as Runtime

    rect rgba(200,220,255,0.5)
    Seed->>Merger: provide monitoring_timeout_seconds (Option<u64>)
    Init->>Merger: provide monitoring_timeout_seconds (Option<u64>)
    end

    rect rgba(200,255,200,0.5)
    Merger->>Operator: merge (prefer initializer, fallback to seed, else default)
    Operator->>Runtime: include OperatorSolverConfig.monitoring_timeout_seconds (u64)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • NicoMolinaOZ
  • shahnami
  • pepebndc

Poem

🐰 I hopped through fields of timeout light,
I stretched the watcher’s patient night,
Seeds whisper options, inits lend a say,
Merges pick one and send it away,
Now monitors wait — the rabbit’s delight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description addresses the main changes but lacks critical checklist items: no reference to related issues is provided, and unit tests are mentioned as added but the checkbox remains unchecked. Complete the checklist by adding a reference to the related issue and checking the unit tests checkbox, or clarify why these items cannot be completed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: extending monitoring timeout configuration for settlement readiness to support longer timeouts (14 days).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch arb-broadcaster-monitoring-timeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
docs/config-storage.md (1)

100-100: Consider documenting the accepted numeric bounds inline.

Adding the allowed range (30 to 1,209,600) in this row would help operators avoid invalid bootstrap values.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/config-storage.md` at line 100, Update the table row for the
`monitoring_timeout_seconds` setting to include the accepted numeric bounds (30
to 1,209,600 seconds) inline so operators know valid values; keep the default
mention (`28800`) and example long-latency value (`864000`) and ensure the
description still states the unit (seconds) and purpose (top-level solver
monitoring timeout for post-fill settlement polling).
crates/solver-config/src/lib.rs (1)

550-561: Add explicit boundary tests for the new cap.

Please add/adjust tests to cover accept at 30 and 1_209_600, and reject at 29 and 1_209_601.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/solver-config/src/lib.rs` around lines 550 - 561, Add unit tests that
exercise the monitoring timeout boundary checks around
monitoring_timeout_seconds: create Config instances (or modify a test fixture
that sets self.solver.monitoring_timeout_seconds) and call the validation
routine (e.g., validate or Config::validate) to assert success for values 30 and
1_209_600 and assert ConfigError::Validation for values 29 and 1_209_601; place
these tests alongside existing config validation tests and reuse the same
builder/fixture used elsewhere so you only change the timeout field and assert
Ok for 30 and 1_209_600 and Err for 29 and 1_209_601.
crates/solver-service/src/config_merge.rs (1)

3285-3293: Add a default-path test alongside the override-path test.

This new test correctly checks explicit override behavior. Please add a companion case asserting the unset default value (expected 1,209,600) so fallback behavior is regression-safe.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/solver-service/src/config_merge.rs` around lines 3285 - 3293, Add a
new unit test alongside test_merge_config_applies_monitoring_timeout_override
that verifies the default fallback for monitoring_timeout_seconds: call
test_seed_overrides() but do NOT set overrides.monitoring_timeout_seconds, call
merge_config(overrides, &TESTNET_SEED).unwrap(), and assert that
config.solver.monitoring_timeout_seconds == 1_209_600; place the test near
test_merge_config_applies_monitoring_timeout_override and use the same helpers
(test_seed_overrides, merge_config, TESTNET_SEED) and naming convention (e.g.,
test_merge_config_uses_default_monitoring_timeout) so the behavior is
regression-safe.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/solver-service/src/config_merge.rs`:
- Around line 415-417: The current fallback for monitoring_timeout_seconds uses
seed.defaults.monitoring_timeout_seconds which can be below the required 14-day
baseline; change the assignment so the chosen value enforces a minimum of
1_209_600 seconds (14 days). Specifically, update the logic around
initializer.monitoring_timeout_seconds /
seed.defaults.monitoring_timeout_seconds to apply a clamp/min (e.g.,
.max(1_209_600)) so the final monitoring_timeout_seconds is never less than
1_209_600, referencing the existing initializer.monitoring_timeout_seconds and
seed.defaults.monitoring_timeout_seconds symbols.

---

Nitpick comments:
In `@crates/solver-config/src/lib.rs`:
- Around line 550-561: Add unit tests that exercise the monitoring timeout
boundary checks around monitoring_timeout_seconds: create Config instances (or
modify a test fixture that sets self.solver.monitoring_timeout_seconds) and call
the validation routine (e.g., validate or Config::validate) to assert success
for values 30 and 1_209_600 and assert ConfigError::Validation for values 29 and
1_209_601; place these tests alongside existing config validation tests and
reuse the same builder/fixture used elsewhere so you only change the timeout
field and assert Ok for 30 and 1_209_600 and Err for 29 and 1_209_601.

In `@crates/solver-service/src/config_merge.rs`:
- Around line 3285-3293: Add a new unit test alongside
test_merge_config_applies_monitoring_timeout_override that verifies the default
fallback for monitoring_timeout_seconds: call test_seed_overrides() but do NOT
set overrides.monitoring_timeout_seconds, call merge_config(overrides,
&TESTNET_SEED).unwrap(), and assert that
config.solver.monitoring_timeout_seconds == 1_209_600; place the test near
test_merge_config_applies_monitoring_timeout_override and use the same helpers
(test_seed_overrides, merge_config, TESTNET_SEED) and naming convention (e.g.,
test_merge_config_uses_default_monitoring_timeout) so the behavior is
regression-safe.

In `@docs/config-storage.md`:
- Line 100: Update the table row for the `monitoring_timeout_seconds` setting to
include the accepted numeric bounds (30 to 1,209,600 seconds) inline so
operators know valid values; keep the default mention (`28800`) and example
long-latency value (`864000`) and ensure the description still states the unit
(seconds) and purpose (top-level solver monitoring timeout for post-fill
settlement polling).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c5bc45d-9a4d-4762-8d30-e9e684c16a87

📥 Commits

Reviewing files that changed from the base of the PR and between 40e80e4 and 94c71d6.

📒 Files selected for processing (6)
  • crates/solver-config/src/lib.rs
  • crates/solver-demo/src/operations/init/mod.rs
  • crates/solver-service/src/config_merge.rs
  • crates/solver-types/src/seed_overrides.rs
  • docs/config-storage.md
  • docs/oracles/settlement-timing-configuration.md

Comment thread crates/solver-service/src/config_merge.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@nahimterrazas nahimterrazas merged commit 64f9fb4 into main Mar 24, 2026
8 checks passed
@nahimterrazas nahimterrazas deleted the arb-broadcaster-monitoring-timeout branch March 24, 2026 19:59
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.

3 participants