Skip to content

fix: config single-source-of-truth doc + CI-aware anvil-e2e deploy timeout - #1428

Merged
thiras merged 2 commits into
mainfrom
fix/config-sot-and-e2e-timeout
Jul 24, 2026
Merged

thiras merged 2 commits into
mainfrom
fix/config-sot-and-e2e-timeout

Conversation

@thiras

@thiras thiras commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A small, low-risk "consistency + CI-hygiene" batch. Neither fix needs a design decision, touches payment-critical code, or overlaps any open PR.

#1402 — config single source of truth

  • adr/012-client.md: the client "Default configuration" block was actively stale — it used key/section names that no longer exist ([network] rpc_url, [bootstrap], [keys], [cache] probe_cache_*). Replaced the inline copy with a pointer to the CI-validated canonical example examples/configs/arbitrum-sepolia-client.toml plus a correct schema-terms description, so there is nothing left to re-drift.
  • crates/cli/src/commands/config.rs: documented DEFAULT_CONFIG as the canonical template and enumerated its guard tests. Strengthened default_config_template_parses_with_every_section into a compile-enforced completeness check (exhaustive FileConfig destructure) — adding a schema section now fails to compile until it is surfaced in the template. Added examples_use_only_template_sections to catch sample/template section drift. The existing schema-parity guards (assert_sample_config_matches_schema, render_config_emits_parseable_toml) already covered the examples.

#1384 — anvil-e2e deploy-timeout hardening

Note on #1384: #785 (already merged) resolved most of this issue. This change adds only the CI-scaling it left out. If maintainers consider the flake already fixed by #785, the e2e commit can be dropped and #1402 shipped alone.

Review

A multi-agent review (code / comments / tests) found no critical or important logic defects. Its findings — a "2-core vs 4-core" comment contradiction, an inaccurate guard-test description, a test-coverage gap for the "section forgotten in the template entirely" case, and an overstated ADR [payment] bullet — are all addressed in this PR.

Verification

  • cargo clippy --all-targets -- -D warnings
  • cargo fmt -- --check
  • cargo doc --workspace --no-deps --document-private-items (RUSTDOCFLAGS=-D warnings)
  • New/affected unit tests pass (decdn-cli config tests, decdn-e2e ci_scaling_widens_the_budget_only_under_ci)

Closes #1402
Closes #1384

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated client configuration guidance to reference a canonical, CI-validated example.
    • Clarified supported configuration sections, identity storage, voucher cadence, and registry refresh status.
    • Expanded the default configuration template with guidance and schema-alignment details.
  • Tests

    • Added checks to ensure the default template covers every configuration section.
    • Added validation that example configurations use only documented template sections.
    • Improved CI environment timeout handling for end-to-end blockchain tests.

…meout

Two low-risk consistency/CI-hygiene fixes.

#1402 (config single source of truth):
- adr/012-client.md: replace the stale "Default configuration" TOML block
  (used long-gone keys: [network] rpc_url, [bootstrap], [keys],
  [cache] probe_cache_*) with a pointer to the CI-validated canonical example
  examples/configs/arbitrum-sepolia-client.toml plus a schema-terms description.
  This was the one copy that actively contradicted the schema.
- crates/cli config.rs: document DEFAULT_CONFIG as canonical and list its guard
  tests; strengthen default_config_template_parses_with_every_section into a
  compile-enforced completeness check (exhaustive FileConfig destructure) so a
  new schema section forgotten in the template fails CI; add
  examples_use_only_template_sections to catch sample/template section drift.

#1384 (anvil-e2e deploy-timeout hardening, additive on top of #785):
- crates/e2e chain.rs: add ci_scaled()/scale_for_ci() + CI_TIMEOUT_MULTIPLIER
  and apply CI-aware scaling to DEPLOY_TIMEOUT and FORGE_BUILD_TIMEOUT, since the
  observed flakiness is CPU starvation under CI contention, not slowness. Local
  budgets unchanged so a genuine local hang still fails fast.

Verified: cargo clippy --all-targets -D warnings, cargo fmt --check,
cargo doc --workspace --document-private-items (RUSTDOCFLAGS=-D warnings),
and the new/affected unit tests all pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 24, 2026 09:16
@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@thiras, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Free

Run ID: 3a74c047-c949-437b-baa2-76767713ea75

📥 Commits

Reviewing files that changed from the base of the PR and between c1501e4 and 31a1996.

📒 Files selected for processing (1)
  • crates/cli/src/commands/config.rs

Walkthrough

The changes align client configuration documentation and CLI templates with the live schema, add tests for template/example consistency, and scale Forge subprocess timeouts only when running in CI.

Changes

Configuration alignment

Layer / File(s) Summary
Canonical configuration contract
adr/012-client.md, crates/cli/src/commands/config.rs
The ADR and default template documentation identify schema-backed configuration sources and describe current configuration fields and behavior.
Configuration drift validation
crates/cli/src/commands/config.rs
Tests exhaustively compare template sections with FileConfig and ensure example configs use only template-defined sections.

CI timeout scaling

Layer / File(s) Summary
CI timeout scaling helper
crates/e2e/src/chain.rs
Adds CI-specific timeout scaling helpers while preserving shorter local budgets.
Forge timeout integration and validation
crates/e2e/src/chain.rs
Forge build and deployment retries use scaled timeouts, with tests covering CI and non-CI behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens config documentation and CI robustness by (1) removing drift-prone inline schema copies in ADR docs in favor of CI-validated canonical examples, and (2) scaling Foundry deploy/build timeouts under CI to reduce anvil-e2e flakes due to runner contention.

Changes:

  • Update ADR-012 client configuration guidance to point to the canonical, schema-validated example config file instead of duplicating the schema inline.
  • Strengthen decdn config init’s DEFAULT_CONFIG guard tests to enforce template/schema completeness at compile time and prevent example/template section drift.
  • Scale forge build / forge script wall-clock budgets under CI via a pure, unit-tested scaling helper (scale_for_ci).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/e2e/src/chain.rs Adds CI-aware timeout scaling for Foundry build/deploy steps to reduce anvil-e2e contention flakes.
crates/cli/src/commands/config.rs Documents DEFAULT_CONFIG as the canonical template and adds stronger compile-/CI-guards against schema/template/example drift.
adr/012-client.md Replaces a stale inline config block with a pointer to the canonical client example and updates terminology to match the current schema.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/cli/src/commands/config.rs Outdated
Comment on lines +615 to +616
// Only bare section headers are uncommented, so every section is
// Some but each field stays at its built-in default (None on the
// wire form). Spot-check the four added sections are recognized.
assert!(parsed.gossip.is_some(), "[gossip] header parsed");
assert!(parsed.security.is_some(), "[security] header parsed");
assert!(parsed.dht.is_some(), "[dht.rate_limit] header parsed");
assert!(parsed.probe.is_some(), "[probe.rate_limit] header parsed");
assert!(parsed.receipts.is_some(), "[receipts] header parsed");
assert!(parsed.content.is_some(), "[content] header parsed");
// `Some` with each field left at its built-in default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reworded in 31a1996: the comment now states each uncommented line is a value-less section header, "some nested ([dht.rate_limit], [probe.rate_limit]) but each mapping to a top-level section" — so it no longer reads as top-level-only.

@github-actions

github-actions Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 81.08% (was 81.07%, ▲ +0.01%) — 52414/64646 lines

File Coverage Lines Δ
crates/cli/src/commands/config.rs 74.68% 233/312 ▲ +4.83%
crates/e2e/src/chain.rs 1.73% 21/1213 ▲ +0.81%
History
Commit Total Δ vs base
c1501e4 81.07% ▲ +0.01%
31a1996 (HEAD) 81.08% ▲ +0.01%

The uncommented lines include nested headers ([dht.rate_limit],
[probe.rate_limit]); reword so "section headers" isn't misread as
top-level-only. Addresses PR #1428 review feedback.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@thiras
thiras merged commit b5e8b73 into main Jul 24, 2026
24 checks passed
@thiras
thiras deleted the fix/config-sot-and-e2e-timeout branch July 24, 2026 10:24
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.

config: single source of truth for example/default configs flaky(ci): anvil-e2e DeployProtocol stalls under --test-threads 2 contention

2 participants