Skip to content

feat(e2e,client-pull): real daemon responses as on-chain slash evidence (G-GOV-03) - #1367

Merged
thiras merged 4 commits into
mainfrom
feat/1042-e2e-g-gov-03-real-evidence
Jul 22, 2026
Merged

thiras merged 4 commits into
mainfrom
feat/1042-e2e-g-gov-03-real-evidence

Conversation

@yigitdot

@yigitdot yigitdot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Every existing "signed evidence" path in the harness cheats: it builds ProbeSlashData/StreamSlashData in the test and signs with node.operator() (crates/e2e/src/chain.rs slash_operator_via_judge, g_node_04_blacklist_compliance.rs). That proves the contract accepts a well-formed signature — which SlashJudge.t.sol already proves — and nothing about the daemon. This closes that gap.

Production change (crates/client-pull)

The node signs its refusals and the client threw the signature away one stack frame later. fn refusal took only resp.error; the signed StreamResponse body and slash_sig were dropped.

  • UpstreamRefused gains pub response: Option<StreamResponse> — Some for an open-stage ok == false refusal (already run through verify_response, so the slash_sig provably recovers to expected_signer), None for the four mid-stream ClientMessage::StreamError sites, which carry no signature at all.
  • fn refusal now takes the whole StreamResponse instead of Option<StreamError>. Both open stages (fetch_inner, open_progressive_pull) pass resp through.
  • The 13 struct-literal sites (4 production in client-pull, the rest in cli/node test modules) gain response: None. No other shape change; Display, the downcast_ref contract, and node_origin::classify_refusal are untouched, so node (which re-exports the crate as client_requester) and cli needed no logic changes.

~50 lines of non-test production diff.

Fail-before / pass-after: tests::an_open_stage_refusal_preserves_the_signed_stream_response drives the real private refusal() with a StreamResponse signed by a real StreamSlashData signer, and asserts the surviving signature still recovers to that signer. It cannot compile on main (the field does not exist); to show the assertion is load-bearing rather than tautological I kept the field and reverted only refusal()'s body to response: None — the test fails; restoring it passes.

New journey (crates/e2e/tests/g_gov_03_real_evidence.rs)

Two nodes, one offense each, both induced through real operator surfaces, all evidence captured off the wire and forwarded byte-for-byte:

  • Phantom (node A) — A serves a real paid delivery (which also leaves a channel its chain watcher has already accepted, so the later refusal can't be a pre-observation UnknownChannel in disguise), answers a probe with signed has_blob: true, the operator evicts H over admin RPC, and the next paid stream on that same channel returns signed ok: false / EvictedSinceProbe. → submitPhantomChallenge.
  • Rate bait-and-switch (node B) — B quotes rate 10 on a probe for a hash it never held, the operator rewrites payment.rate_per_mb to 40 and hot-reloads via admin_v1_reload (no restart — the field is in the reloadable set), and B's next signed StreamResponse quotes 40 inside the 30s window. → submitRateChallenge.

Both refusals assert their cause (EvictedSinceProbe / NotFound), so the journey can't pass on a slash it never induced.

Positive assertions: slash lands and is attributed to the operator; active bond falls by exactly the slashed amount; the TOKEN is escrowed (escrowedTotal up by the amount) rather than distributed; slashedAtEpoch stamps the ADR-036 vote-weight zero-out; and after warping past the 30-day filing window, finalizeUnappealedSlash pays the challenger exactly 50% and burns the rest (read off totalSupply, since the burn leg is invisible as a transfer).

Negatives, all built from the same real daemon output:

  • a genuine has_blob: true probe stamped 40s before the stream → reverts TimestampWindowViolated (asserted by 4-byte selector, so an unrelated fixture failure can't satisfy it);
  • the real probe with its signature swapped for one from an unrelated key → InvalidProbeSignature;
  • neither failed challenge moves any TOKEN, and neither stamps slashedAtEpoch.

One deliberate deviation from the issue text

The issue says a failed/bad challenge "forfeits the challenger bond". The as-built contract does not, by design — ADR 014 § Bond Handling: "a submit*Challenge that fails on-chain verification reverts and the challenger pays only gas; the bond is not transferred for failed verifications". SlashJudge._resolve pulls the bond only after every check has passed, and there is no second-stage dispute that could claw it back. So the assertion is the behaviour of record — nothing is pulled, no slash is minted — and the reasoning is documented in the test's module header.

Fixture additions (all additive)

  • chain.rs: challenge_with_real_evidence (a sibling of slash_operator_via_judge — that function's signature is untouched; review follow-up 29b568a did refactor its body to call the extracted arm_challenger instead of its own duplicated arming block, so the two now share a helper), Offense, EvidencePair, challenge_bond, escrowed_total, slash_record, finalize_unappealed_slash, token_total_supply, private arm_challenger.
  • client.rs: probe_at (caller-chosen timestamp_us — the fixed TIMESTAMP_US sentinel reads as 1970 to the judge's staleness bound) and refused_stream (one paid open on an existing channel, returning the daemon's signed refusal).
  • node.rs: set_rate_per_mb (rewrite + admin_v1_reload).
  • bindings.rs: a separate sol! block for submitRateChallenge, the CapacityBond escrow surface, and totalSupply.

Review follow-ups (29b568a)

Applied after review: corrected two doc comments that stated false things (set_rate_per_mb returns the raw pre-clamp atomic, not a clamped quote; refused_stream's UnknownChannel race cannot fire because the channel resolves after the blob gate). Replaced the journey's hand-copied selector hex with the typed expect_revert helper promoted from g_origin_01_publish into e2e::assert. Pinned Offense::discriminant to the generated SlashJudge::OffenseType. Deduped arm_challenger and folded two redundant sol! contracts into the CapacityBond/Erc20 blocks already in the same file. Fixed the stale anvil e2e CI budget (the comment still described 6 tests; the real inventory is 14, whose ceilings sum past the old 75m bound).

Out-of-scope findings filed as #1375, #1377, #1378, #1379. #1375 is the substantive one: SlashJudge's rate predicate does not require !ok, so a bait-and-switch that delivers is equally slashable — but the success path drops the signed response, so the profitable variant is the one we cannot evidence.

Verification

  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo fmt -- --check — clean
  • cargo nextest run --workspace --no-fail-fast — 2625 passed, 0 failed
  • cargo nextest run -p decdn-e2e --features anvil-e2e --no-fail-fast — 20 passed, 0 failed (new journey ~9-65s depending on forge cache)

Closes #1042

…lash evidence

Preserve the upstream operator's signed StreamResponse on UpstreamRefused
instead of discarding it, then build the G-GOV-03 journey on it: every byte
of evidence submitted to SlashJudge comes off the wire from a running
decdn-node, slash_sig included and forwarded verbatim.

client-pull: UpstreamRefused gains `response: Option<StreamResponse>` — Some
for an open-stage `ok == false` refusal (already verified against
`expected_signer` by verify_response), None for the unsigned mid-stream
StreamError frames. `refusal()` now takes the whole response rather than just
its error code. Unit-tested through the real private constructor with a real
StreamSlashData signature.

e2e: new g_gov_03_real_evidence journey — two nodes, a phantom announcement
(admin evict between probe and stream) and a rate bait-and-switch
(payment.rate_per_mb hot-reload between probe and stream), each submitted to
SlashJudge with a challenge bond. Asserts the slash lands, escrow-on-slash
books the TOKEN, slashedAtEpoch stamps the ADR-036 vote-weight zero-out, and
finalizeUnappealedSlash splits the escrow 50/50 challenger/burn. Negatives
re-use the same real evidence: a 40s-apart pair (TimestampWindowViolated), a
probe re-signed by a non-operator key (InvalidProbeSignature), and neither
failed challenge moves any TOKEN (ADR 014 § Bond Handling).

ChainFixture gains `challenge_with_real_evidence` as an additive sibling of
`slash_operator_via_judge`; the existing signature is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 55 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: f18db41b-8127-4508-a7f7-3539264dd94a

📥 Commits

Reviewing files that changed from the base of the PR and between e73fa04 and 80c26f7.

📒 Files selected for processing (12)
  • .github/workflows/ci.yml
  • crates/cli/src/commands/bundle_pull.rs
  • crates/cli/src/commands/fetch.rs
  • crates/client-pull/src/lib.rs
  • crates/e2e/src/assert.rs
  • crates/e2e/src/bindings.rs
  • crates/e2e/src/chain.rs
  • crates/e2e/src/client.rs
  • crates/e2e/src/node.rs
  • crates/e2e/tests/g_gov_03_real_evidence.rs
  • crates/e2e/tests/g_origin_01_publish.rs
  • crates/node/src/node_origin.rs

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.

@yigitdot yigitdot changed the title feat(e2e,client-pull): G-GOV-03 — real daemon responses as on-chain slash evidence feat(e2e,client-pull): real daemon responses as on-chain slash evidence (G-GOV-03) Jul 22, 2026
`cargo doc --document-private-items` with `-D warnings` rejects a public
doc link to a private const (rustdoc::private_intra_doc_links). Demote the
reference to plain code formatting.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 81.20% (was 81.55%, ▼ 0.36%) — 53830/66297 lines

File Coverage Lines Δ
crates/cli/src/commands/bundle_pull.rs 56.42% 549/973 ▲ +0.18%
crates/cli/src/commands/fetch.rs 36.00% 292/811 ▲ +0.24%
crates/client-pull/src/lib.rs 88.16% 953/1081 ▼ 0.52%
crates/e2e/src/assert.rs 19.54% 17/87 ▼ 12.54%
crates/e2e/src/chain.rs 0.96% 11/1146 ▼ 0.16%
crates/e2e/src/client.rs 0.00% 0/228 ● 0.00%
crates/e2e/src/node.rs 20.36% 68/334 ▼ 1.51%
crates/node/src/node_origin.rs 90.58% 971/1072 ▲ +0.03%
History
Commit Total Δ vs base
5a7d4e7 81.28% ▼ 0.33%
29b568a 81.26% ▼ 0.35%
80c26f7 (HEAD) 81.20% ▼ 0.36%

…t matching

Review follow-ups on #1367. No change to the journey coverage; all 20 anvil-e2e
tests still pass.

Two doc comments stated things that are not true:

- NodeFixture::set_rate_per_mb claimed its return value reflects the on-chain
  clamp. It does not - ReloadSnapshot is a bare load of the raw pre-clamp atomic
  (runtime/reload.rs), and clamping happens later and per-response at sign time
  (handlers/client/wire.rs, handlers/probe.rs). A caller who trusted the doc and
  picked an out-of-band rate would see the assertion pass and ship a silently
  clamped, non-slashable StreamResponse.
- ClientFixture::refused_stream justified reusing a channel via an
  UnknownChannel -> NotFound race that cannot fire: serve_stream resolves the
  channel *after* the blob-availability gate, so both captured refusals return
  before the lookup. The real confound is pull_authorized returning false for an
  unrecognized channel, which suppresses the fill tiers.

Reuse instead of reinvention:

- Promote expect_revert from g_origin_01_publish into e2e::assert and add an
  anyhow-taking sibling. The negatives now match on E::SELECTOR from
  sol!-declared errors instead of hand-copied selector hex substring-matched
  against the rendered error chain - compiler-checked against the ABI, and able
  to report which error actually came back.
- Route Offense::discriminant through the generated SlashJudge::OffenseType,
  collapsing two of four hand-kept mirrors of the contract enum ordering.
- Fold CapacityBondEscrow/Erc20Supply into the CapacityBond/Erc20 blocks already
  declared in the same file, and point slash_operator_via_judge at the extracted
  arm_challenger instead of its duplicated arming block.

Also fixes the stale anvil-e2e CI budget: the comment still described 6 tests
after the cli_* and g_origin_* journeys landed, leaving timeout-minutes: 75 below
the ~92m worst 2-thread schedule of the real 14-test inventory - inverting the
ordering the bound exists to guarantee.

Remaining review findings filed as #1375, #1377, #1378, #1379.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Contracts coverage

Line coverage: 89.58% (2657/2966 lines)
▲ +0.00pp vs base (89.58% → 89.58%)
Run: 29894379901

@yigitdot
yigitdot requested a review from Copilot July 22, 2026 01:06

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copy link
Copy Markdown
Contributor

Code review

Reviewed the full diff (12 files, +1198/−76) and traced the load-bearing correctness claim against the base code. Summary: this is a high-quality, well-scoped change — I'd merge it after a look at the nits below, none of which are blocking.

What it does

Closes #1042 in two parts:

  1. Production (client-pull): UpstreamRefused gains pub response: Option<StreamResponse>, and the shared refusal() constructor now takes the whole StreamResponse instead of just its error, so the operator's own signed refusal survives the client's error path instead of being dropped one frame later. Some at the open stage (ok == false), None at the four unsigned mid-stream StreamError sites. Display and the downcast_ref contract are untouched, so node/cli needed no logic changes — the ~13 struct-literal sites just gain response: None.
  2. E2E (G-GOV-03): a new journey that induces a phantom announcement (evict-after-probe) and a rate bait-and-switch (config hot-reload) through real operator surfaces, captures the daemon-signed evidence off the wire, and forwards it byte-for-byte to SlashJudge — plus the fixtures (challenge_with_real_evidence, refused_stream, set_rate_per_mb, escrow/supply reads, SlashJudgeRate binding) to support it.

Verified

The whole design rests on the preserved slash_sig provably recovering to the bound operator. I confirmed that holds in the base code: open_stream calls verify_response (lib.rs:1070) before returning resp, and verify_response (lib.rs:1964–1981) runs validate() → echoed-field correlation → StreamSlashData::from_response_body(...).verify_signer(&sig, expected_signer, …). So by the time fetch_inner/open_progressive_pull reach refusal(resp) on !body.ok, the response is already both structurally valid (so error is guaranteed Some) and signature-verified against expected_signer. The evidence really is court-admissible without re-signing. ✅

Strengths

  • The unit test an_open_stage_refusal_preserves_the_signed_stream_response drives the private refusal() (not a hand-built UpstreamRefused), so the documented fail-before/pass-after is genuinely load-bearing rather than tautological.
  • Negatives pin typed revert selectors via expect_revert_anyhow::<E> matching E::SELECTOR, and each pair is constructed so exactly one _verifyPair check fails — so they're robust to the contract's check ordering and can't be satisfied by a fixture bug that never reached the judge.
  • Honest, ADR-cited deviation from the issue text on bond forfeiture (ADR 014 § Bond Handling) with the reasoning in the module header — good call to document rather than silently diverge.
  • Clean DRY refactor lifting expect_revert out of g_origin_01_publish.rs into shared assert.rs.

Minor / non-blocking

  1. PR description vs diff: the body says slash_operator_via_judge's "signature and body are untouched," but the diff refactors its body to call the new arm_challenger helper (chain.rs). The extraction is behavior-preserving and a good change — it just means the "independently mergeable / untouched" framing slightly overstates the isolation, since that function now shares a helper with the new code.

  2. assert_fifty_fifty_split rounding assumption: it computes challenger_share = amount / 2, burn_share = amount − challenger_share. If a slash amount is ever odd and the contract floors the challenger leg the other way (burn = floor), the equality asserts would be off by one base unit. Fine for the current even bond tiers, but a one-line note on why amount is even — or reading the challenger/burn split off the finalize event/logs — would make it robust to a future odd tier.

  3. Capture asymmetry: the phantom capture asserts stream_a.body.hash == hash_a, but the rate capture doesn't assert stream_b.body.hash == unheld. It's transitively enforced by the contract's same-hash check on the successful positive, but an explicit assert would keep the two captures symmetric and localize a failure to the capture rather than the challenge.

  4. set_rate_per_mb config round-trip: toml::to_string(&doc) re-serializes the whole config, dropping any comments/formatting. Harmless for a generated fixture — just noting in case the fixture config ever grows human-facing comments.

  5. CI job timeout 75 → 130 min: the updated comment + test inventory are excellent, and the real guard is each test's per-test OVERALL_TIMEOUT. Worth a conscious note that the job-level bound is now a generous backstop — a hang in a compile or an in-test forge deploy (neither covered by a per-test timeout) would burn the full 130 min before failing. Acceptable given the alternative of a too-tight bound killing legitimate runs; flagging so it's a deliberate choice.

Coverage note

The coverage bot shows client-pull/src/lib.rs −0.52% and assert.rs −12.5%, but that's an artifact — the new production/fixture lines are exercised only by the anvil-e2e-gated journey, which the coverage job doesn't run. Not a real gap; the new field is covered by the unit test and the journey.

Nice work — the "real daemon output, forwarded verbatim, one field perturbed for each negative" structure is exactly the right shape for closing this gap.


Generated by Claude Code

Review follow-ups from @altanoruc on #1367.

- Assert the node-B refusal answers for the probed hash, matching the node-A
  capture. Was transitively enforced by the judge same-hash check on the
  positive, but asserting at the capture localizes a failure to the capture.
- Spell out why assert_fifty_fifty_split rounds the way it does.
  SlashEscrowLib._distribute floors the *challenger* leg (amount *
  CHALLENGER_BPS / BPS_DENOMINATOR) and gives the remainder to burn; since
  5000/10_000 is exactly 1/2 that equals amount / 2 for every amount, odd ones
  included. Also records why the shares are not read off the SlashUpheld event:
  that would prove only internal consistency, where hard-coding 50/50 pins the
  ADR 026 policy.
- Record the timeout-minutes 75 -> 130 tradeoff as deliberate: the bound is now
  a generous backstop, so a wedged compile or a forge deploy that hangs before a
  test arms its own timer burns the full 130m. Accepted because a tighter bound
  kills legitimate runs, and one below the per-test ceilings reintroduces the
  opaque job-level kill (#785) the ordering exists to avoid.

Not changed, with reasoning: the reviewer flagged a possible off-by-one if a
slash amount were odd and the contract floored the burn leg instead. It does
not - SlashEscrowLib.sol:203-204 floors the challenger leg and takes the
remainder for burn, which is what the test already computes. Noted inline
instead. The toml round-trip dropping comments is real but harmless for a
render_config-generated fixture; tracked with a round-trip test in #1378.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@yigitdot

Copy link
Copy Markdown
Contributor Author

Went through all five. Fixed 1, 3, 5; pushed back on 2; declined 4 with a pointer. Pushed as 80c26f7.

1 — stale PR description. Correct, and my fault: follow-up 29b568a refactored slash_operator_via_judge's body to call the extracted arm_challenger, after the description was written. Body updated — signature untouched, but the two now share a helper, so the "independently mergeable" framing is gone.

2 — rounding: the off-by-one can't happen. The premise is that the contract might floor the burn leg. It floors the challenger leg:

uint256 challengerShare = (amount * CHALLENGER_BPS) / BPS_DENOMINATOR;  // SlashEscrowLib.sol:203
uint256 burnShare = amount - challengerShare;                            // :204

CHALLENGER_BPS/BPS_DENOMINATOR is 5000/10_000 = exactly 1/2, so that is amount / 2 for every amount; an odd 7 splits 3 challenger / 4 burn under both contract and test. The assertion is already exact for odd tiers, so there's nothing to make robust — but the equivalence isn't obvious from reading it, so I added the derivation inline.

On reading the split off the event instead: deliberately not doing that. SlashUpheld carries the contract's own challengerShare/burnShare, so asserting balances against it would only prove the contract is self-consistent. Hard-coding 50/50 is what pins the ADR 026 policy — a governance change to 60/40 should fail this test. Noted inline too.

3 — capture asymmetry. Valid, fixed. Node B now asserts stream_b.body.hash == unheld. You're right that the contract's same-hash check covers it transitively on the positive; asserting at the capture means a mismatch fails where it happened rather than three stages later.

4 — toml comments. Real, and I'll leave it. The fixture config is machine-generated by render_config, so there are no comments to lose today. The failure mode I'd actually worry about is the ValueAfterTable shape in [cache] (origin sorts before pull_through_require_authorized_origin) — I checked the vendored toml 1.1.3 serializer and it's handled, because each table gets its own buffer. But that's a dependency bump away from breaking silently, so a round-trip test is tracked in #1378 alongside render_config_emits_parseable_toml.

5 — timeout backstop. Agreed it should be a conscious choice rather than a number, and you named the exact gap: a wedged compile or a forge deploy that hangs before a test arms its own timer is covered by nothing and now burns the full 130m. Written into the comment, along with why the alternative is worse — a bound below the per-test ceilings reintroduces the opaque #785 kill that masks the clear per-test message.

Coverage. Same read as yours — the assert.rs −12.5% is mostly the expect_revert promotion landing in a file the coverage job compiles but the anvil-e2e journey isn't run to exercise.

@thiras
thiras merged commit 7897229 into main Jul 22, 2026
23 checks passed
@thiras
thiras deleted the feat/1042-e2e-g-gov-03-real-evidence branch July 22, 2026 21:25
thiras added a commit that referenced this pull request Jul 22, 2026
fix(e2e): drop duplicate expect_revert from a semantic merge conflict

#1387 and #1367 each landed their own `expect_revert` in
`crates/e2e/src/assert.rs` — textually disjoint, so git merged both and
main stopped compiling (E0428, `decdn-e2e` lib), taking clippy, test,
doctest, cargo doc, and anvil e2e down with it.

Keep #1367's version: same signature and behaviour, but it shares the
selector check with `expect_revert_anyhow` via `assert_revert_data`
instead of inlining it. Callers of either copy are unaffected.

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
thiras added a commit that referenced this pull request Jul 23, 2026
…1367 follow-ups) (#1404)

* test(e2e): harden authorized-origin & slash-evidence journeys (#1366/#1367 follow-ups)

Batch of six test-only follow-ups from the reviews of #1366 (authorized-origin
gate, G-NODE-08) and #1367 (G-GOV-03 real-evidence slashing). Turns
circumstantial e2e assertions into direct ones and hardens fixture diagnostics.

- #1376: split RenderConfig's single bool into node_to_node_pull_through +
  require_authorized_origin; the render_config test sets them to distinct values.
- #1371: NodeFixture::scrape_metric; G-NODE-08 pins the refusal to the
  unauthorized-origin reject counter (0->1) instead of the collapsed wire
  NotFound that ServeRejectReason::wire_error folds seven reasons onto.
- #1372: seed_origin_blob_with_outboard so the ranged fetch reaches the real
  origin range tier, with a partial-presence control distinguishing it from a
  whole-blob fill.
- #1373: revokeAssignment binding + ChainFixture wrapper; new
  g_node_08_revocation journey (gate re-closes on revoke; already-held content
  survives). Staker-deactivation leg documented as a tracked follow-up.
- #1378: real-evidence EvidenceAlreadyUsed + InvalidStreamSignature negatives;
  client-pull mid_stream_refusal + unit tests; set_rate_per_mb round-trip test.
- #1379: hardened extract_slash_id (address+topic0 filter, propagates decode
  errors, asserts offenseType/evidenceHash); UpstreamVoucherRejected arm in
  refused_stream; node-B refusal pinned to the cache-miss counter; fixed the
  backwards refusal() message.

The only production change is in client-pull: a private mid_stream_refusal
constructor (behavior-preserving extraction of four identical sites) and a
corrected error message; public API unchanged.

Verified: cargo nextest (101 unit tests) + anvil journeys
g_node_08_authorized_origin, g_node_08_revocation, g_gov_03, smoke, slash_appeal
all pass; fmt + clippy --workspace --all-targets clean.

Closes #1371
Closes #1372
Closes #1373
Closes #1376
Closes #1378
Closes #1379

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* docs(e2e): warn scrape_metric is delta-only (review follow-up)

Two reviewers noted scrape_metric's return-0-on-missing contract makes an
absolute assertion (== 0) pass vacuously on a typo'd/unregistered name. All
current callers assert a 0->1 delta, which stays non-vacuous; document the
constraint so a future absolute check isn't written by mistake.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(e2e): bound smoke served-bytes to [content, wire] (#1381)

The anvil-e2e 'smoke_compose_fixtures' served-bytes check was flaky: it
asserted on-chain served-bytes == payload.len() (content), but the paid
path meters WIRE bytes (content + interleaved bao proof, ADR 038 §Payment
metering), so a fully settled 2 MiB delivery lands content + ~0.4% proof
overhead.

Root cause of the flake: the client pays a cumulative voucher at each
voucher_interval_mb boundary (each >= redeem_threshold_micro_usdc, so each
redeems) plus a final closing voucher for the last partial group. That
closing delta is only ~8 KiB of trailing proof, far below the redeem
threshold, so whether it has settled on-chain when the test reads is a
race: not-yet -> content total (observed locally), settled -> full wire
total (observed on CI run 29881984765). Both are correct transient states
of the same delivery, so any exact-equality assertion is inherently racy.

Bound served-bytes to [content_bytes, wire_bytes] instead, computing the
wire total via the canonical decdn_bao_range::align_range(..).wire_len()
the client itself pays against. '< content' still catches a redeem that
never landed; '> wire' catches over-accounting past the paid wire bytes.
Deterministic 3/3 locally.

Closes #1381

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.

e2e G-GOV-03: real node responses as valid on-chain evidence

4 participants