Repository navigation
test(e2e): cover the operator deny-list and the origin restart path - #1499
Conversation
Two gaps in the address-level blacklist journey, both in the half of the deny-set with the weakest primitives — and both about to be rewritten by the enumeration work, so they are worth pinning before rather than after. **The operator list was untested.** `addOperator` writes `isOperatorBlacklisted` and emits `OperatorBlacklisted`; it never touches `_isOriginBlacklisted` or `OriginBlacklistUpdated`. A node projecting only the origin event passes the existing journey and still serves an operator governance has blacklisted — and this is the *primary* governance route, since it also ejects from `CapacityBond`. The new leg asserts the separation directly: `addOperator` must land on-chain while `isOriginBlacklisted` stays false, and the node must still refuse. **The restart path was untested.** The origin half has no version counter to detect a missed update against, so the deny-set must survive a process restart. A regression comes up as an EMPTY deny-set, which is indistinguishable from "nothing is blacklisted" while the node serves what it is obliged to refuse — and reports nothing wrong. The new leg blacklists, confirms the refusal, restarts, and requires the refusal again. Both assert the TYPED refusal (`StreamError::OriginBlacklisted`) via the shared `poll_until_refused` helper, so a channel/connect/payment regression that also fails the fetch cannot green them. Both have teeth by construction: if the node ignored `OperatorBlacklisted`, or came up with an empty deny-set, the fetch would keep succeeding and the poll would time out rather than pass. Adds `set_operator_blacklist` / `is_operator_blacklisted` to `ChainFixture` and binds `isOperatorBlacklisted` — deliberately not a wrapper over `set_origin_blacklist`, since the whole point is that the two lists are independent. Verified against a live anvil chain: 3 tests pass in 221s. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (3)
Note 🎁 Summarized by CodeRabbit FreeYour 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 |
There was a problem hiding this comment.
Pull request overview
Adds missing end-to-end coverage around the address-level origin/operator deny lists and verifies the origin deny-set remains enforced across a daemon restart, strengthening the node’s compliance guarantees and protecting against regressions ahead of the planned blacklist enumeration rewrite.
Changes:
- Added new e2e legs to assert (1) operator blacklist enforcement and (2) origin deny-set persistence across node restart.
- Introduced a shared
poll_until_refusedhelper to assert typed refusals (UpstreamRefused→StreamError) rather than string matching. - Extended the e2e chain fixture +
alloy::sol!bindings to drive and confirm the operator blacklist path (addOperator/isOperatorBlacklisted).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/e2e/tests/origin_blacklist_compliance.rs | Adds operator-blacklist and restart-survival e2e coverage plus a typed-refusal polling helper. |
| crates/e2e/src/chain.rs | Adds fixture helpers to set/read the operator blacklist via governed ContentBlacklist calls. |
| crates/e2e/src/bindings.rs | Extends the ContentBlacklistOrigin binding with isOperatorBlacklisted for on-chain confirmation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// Poll until a fetch by `client` is refused specifically for `expected`. | ||
| /// | ||
| /// Asserts on the TYPED refusal rather than a formatted string: a | ||
| /// channel/connect/payment regression that also fails the fetch must not green | ||
| /// the check. Before the watcher catches up the fetch may still succeed — that | ||
| /// is "not yet projected", so retry. |
Coverage reportTotal: 80.75% (was 80.79%, ▼ 0.05%) — 54698/67741 lines
History
|
Why
Two gaps in the address-level blacklist journey, both in the half of the deny-set with the weakest primitives — and both about to be rewritten by the enumeration work in #1497. Pinning the behaviour before the rewrite rather than after.
The operator list was untested
addOperatorwritesisOperatorBlacklistedand emitsOperatorBlacklisted. It never touches_isOriginBlacklistedorOriginBlacklistUpdated. So a node that projects only the origin event passes the existing journey and still serves an operator governance has blacklisted — and this is the primary governance route, since it also ejects the operator fromCapacityBond.OriginAssignmentunions the two lists; a node must too.The new leg asserts the separation directly rather than implying it:
The restart path was untested
The origin half sits outside the
getBlacklistVersion()mechanism, so there is no counter a consumer could use to notice it missed an update. The deny-set therefore has to survive a process restart on its own. A regression here surfaces as an empty deny-set, which is indistinguishable from "nothing is blacklisted" while the node serves content it is obliged to refuse — and reports nothing wrong.The new leg blacklists, confirms the refusal, restarts the daemon, and requires the refusal again.
Notes for review
Both assert the typed refusal, not a formatted string — via a shared
poll_until_refusedhelper that downcasts toUpstreamRefusedand requiresStreamError::OriginBlacklisted. A channel/connect/payment regression that also fails the fetch cannot green these.Both have teeth by construction. If the node ignored
OperatorBlacklisted, or came up with an empty deny-set after restart, the fetch would keep succeeding and the poll would time out rather than pass. There is no vacuous-pass path.set_operator_blacklistis deliberately not a wrapper overset_origin_blacklist— the entire point is that the two lists are independent, so the fixture keeps them independent too.Correction to an earlier assumption
Scoping this work, I recorded that there was no e2e coverage of the slash watcher's rebuild-on-restart. That was wrong:
slash_appeal.rs:127-147already asserts exactly that ("a fresh process must re-surface the slash by rebuilding its in-memory store from the SlashJudge floor scan"). No new test was needed there, and the slash-watcher migration is already guarded.Testing
Verified against a live anvil chain — 3 tests pass in 221s:
Plus
cargo clippy --workspace --all-targets -- -D warningsandcargo fmt --check.Pure test addition — no runtime code changes, so it can merge independently of #1497 and #1498.
🤖 Generated with Claude Code