Repository navigation
fix: close out remaining LOW review follow-ups (#845 #864) - #869
Conversation
Resolves the five still-open `[ ]` items across the two 2026-06 full-repository review umbrellas; all prior items shipped in #867/#868. node: - dht: cap per-connection served streams (MAX_DHT_REQUESTS_PER_CONN=256) and connection age (MAX_DHT_CONN_AGE=5m) so a peer staying under the per-stream rate limit can no longer pin its dispatch permit forever, mirroring handlers::client's hardcoded-constant precedent (#845). - reputation_indexer: bound the settled_seen dedup set with a companion FIFO (MAX_SETTLED_SEEN=65536), evicting the longest-settled ids first, mirroring the existing pending_settled bound — it no longer grows for the whole process lifetime (#864). cli: - bundle: consult the --exclude globset via filter_entry before canonicalize, pruning recursively-excluded directories. An escaping symlink inside an excluded subtree is no longer resolved and can't trip the escape bail!; a one-level tmp/* still keeps deeper tmp/sub/y via a sentinel-child recursion probe (#845). - config: add [gossip]/[security]/[dht.rate_limit]/[receipts] template blocks plus the missing network/blockchain/cache/payment/observability knobs to DEFAULT_CONFIG, and surface each section's kill-switch / rate-limit knobs in the validate summary; add a template round-trip parse test (#864). contracts (docs-only): - IFeeRouter: NatSpec now marks the 60/30/10 split as the default, governance-mutable within per-bucket bounds via setShares — the drift flagged in #845 was in fact still present (not resolved by #777). Verification: cargo fmt/clippy --all-targets clean; cargo nextest run 1694/1694 pass; forge fmt --check + FOUNDRY_PROFILE=ci forge build clean. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contracts coverageLine coverage: 89.36% (1814/2030 lines) |
Gas snapshotGas changes vs baseRun: 27284143633 |
There was a problem hiding this comment.
Code Review
This pull request introduces several robustness improvements, configuration updates, and resource limits across the codebase. Specifically, it updates the IFeeRouter interface documentation, implements lexical pruning of excluded directories in the CLI bundler to prevent escaping symlink errors, surfaces several new configuration options in the validation summary and default template, enforces connection request and age limits in the DHT handler to recycle dispatch permits, and bounds the settled_seen dedup set in the reputation indexer using FIFO eviction. Comprehensive tests have been added to verify these new behaviors. No review comments were provided, so there is no additional feedback.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR closes out the remaining LOW-severity follow-ups from the June 2026 full-repository review umbrellas (#845, #864) via small, localized fixes across node, CLI, and contracts docs.
Changes:
- Add per-connection caps (max served streams + max age) to the DHT stream-accept loop to prevent long-lived permit pinning.
- Bound
reputation_indexer’ssettled_seendedup tracking with FIFO eviction to prevent unbounded growth. - Improve CLI ergonomics and safety: make
bundle create --excludeprune excluded subtrees before canonicalization, and expand the shipped config template +config validatesummary coverage; update FeeRouter NatSpec to reflect governance-mutable default shares.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/node/src/reputation_indexer.rs | Bounds settled_seen with FIFO eviction and adds unit tests to prevent unbounded dedup growth. |
| crates/node/src/handlers/dht.rs | Caps per-connection DHT request handling to recycle dispatch permits and prevent indefinite connections. |
| crates/cli/src/commands/config.rs | Expands DEFAULT_CONFIG template and config validate summary with additional sections/knobs and adds a template-parse test. |
| crates/cli/src/commands/bundle.rs | Applies exclude filtering pre-canonicalization and prunes recursively-excluded directories; adds regression tests (incl. symlink escape cases). |
| contracts/src/interfaces/IFeeRouter.sol | Updates NatSpec to clarify 60/30/10 is the default and governance-mutable within bounds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nobs
The DEFAULT_CONFIG template showed `settlement_auto_threshold_micro_usdc = 0`
and `settlement_auto_by_voucher_nonce_span = 0`, but the resolver rejects
`Some(0)` for both ("must be > 0 when set", mod.rs:1065-1080) — these fields
disable via omission (None / commented-out), not via 0. Uncommenting the line
verbatim would fail `config validate` / node startup. Show realistic positive
example values (50 USDC / 1000 nonces) and reword the annotation to "leave
unset/commented to disable", matching how the other commented knobs in the
template carry working values.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Coverage reportTotal: 85.81% (was 85.80%, ▲ +0.01%) — 34074/39707 lines
History
|
reputation_indexer: - Correct the MAX_SETTLED_SEEN comment: a re-delivered settlement for an evicted channel re-credits the provider (resolved from the never-removed on-chain CapacityBond binding), it is NOT a no-op as previously claimed. Document it as a bounded, astronomically-unlikely double-count and explain why eviction stays at debug! (routine once saturated). Cross-reference from the mark_settled_seen doc; harmonize the #867/#868 citation to #864. node/dht: - The cap/age break dropped the peer's further requests silently. Now log (debug) which bound tripped and conn.close() with APP_ERR_RATE_LIMITED, mirroring close_stream_with_rate_limit and the client permit-exhaustion close, so the peer gets a reason and the close is observable. - Extract the accept-budget gate into accept_budget_reached() so the unit test exercises the real predicate instead of a re-implementation, and cover the previously-untested age branch. Correct the false comment that claimed tests/dht_loopback.rs exercises the cap end-to-end (it does not — it only proves multi-stream serving); state honestly what is covered. cli/bundle: - Add a test for an excluded directory that is itself an escaping symlink (tmp/** where tmp -> external dir): confirms the subtree is pruned before canonicalize and does not trip the escape bail!. Verification: cargo fmt/clippy --all-targets clean; decdn-node + decdn-cli 753 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Closes out the five still-open
[ ]items across the two 2026-06 full-repository review umbrellas (#845, #864). Every other item in both umbrellas already shipped via #867/#868, so this PR lets both be fully checked off and closed.All findings are LOW-severity, localized fixes.
node
handlers/dht.rs): the per-connection stream-accept loop had no cap, so a peer staying under the per-stream rate limit could keep opening streams forever and pin its dispatch permit for the process lifetime. AddedMAX_DHT_REQUESTS_PER_CONN(256) +MAX_DHT_CONN_AGE(5m); the loop stops accepting past either bound and releases the permit, mirroringhandlers::client'sMAX_CLIENT_STREAMSprecedent.settled_seen(reputation_indexer.rs): the dedupHashSetonly grew for the process lifetime. Added a companion FIFO (MAX_SETTLED_SEEN= 65536) evicting the longest-settled ids first, mirroring the existingpending_settledbound. Eviction is a pure dedup drop (no re-credit needed — thechannelsentry is already removed on credit).cli
bundle create --exclude(commands/bundle.rs): now consults the exclude globset viafilter_entrybefore canonicalize and prunes recursively-excluded directories. An escaping symlink inside an excluded subtree is no longer resolved and can't trip the escapebail!. A one-leveltmp/*still keeps deepertmp/sub/yvia a sentinel-child recursion probe.commands/config.rs): added[gossip]/[security]/[dht.rate_limit]/[receipts]template blocks + the missing network/blockchain/cache/payment/observability knobs toDEFAULT_CONFIG, and surfaced each section's kill-switch / rate-limit knobs in theconfig validatesummary. Added a template round-trip parse test.contracts (docs-only)
IFeeRouter.solNatSpec now marks the 60/30/10 split as the default, governance-mutable within per-bucket bounds viasetShares. Note: this drift was in fact still present (the umbrella speculated fix(contracts): security audit pass — High + Medium findings #777 may have already fixed it — it had not).Verification
cargo fmt -- --checkclean;cargo clippy --all-targetswarning-cleancargo nextest run— 1694/1694 pass (new unit/integration tests for the DHT cap,settled_seenbound, and the bundle exclude/prune + symlink cases)forge fmt --check+FOUNDRY_PROFILE=ci forge build --deny warningsclean🤖 Generated with Claude Code