Skip to content

e2e: missing SlashJudge negatives and unit cases around real-evidence challenges #1378

Closed

Description

@yigitdot

Follow-up from review of #1367 (G-GOV-03). The journey's negatives cover the window and the probe-signature checks; these are the cheap ones it leaves on the table, all buildable from evidence the journey already holds.

Missing on-chain negatives

  • Replay → EvidenceAlreadyUsed. Resubmit the exact real phantom pair under a fresh salt. This is the one dedup guard that lives in SlashJudge rather than CapacityBond (per its own comment), and it is what stops a griefer ratcheting lifetimeOffenseCount off a single captured refusal. Highest value of the three.
  • InvalidStreamSignature. Only the probe leg is forged today (forge_probe_signature); the stream leg's rejection path is untested against real evidence.
  • NotPhantom / NodeIdMismatch. Both are covered by SlashJudge.t.sol with synthetic evidence, so lower value — but NotPhantom from a real ok == true response is a different proposition than a synthetic one.

Missing unit cases in client-pull

  • Nothing pins response: None for mid-stream frames. The four production sites hard-code None and that is correct today — ClientMessage::StreamError carries no signature field and the server writes it via write_reject with no sign_response call. But nothing guards against someone "helpfully" synthesising a StreamResponse there later, which would hand an observer an unsigned artifact that the field's docs promise always recovers to the delivering node.
  • The unit test never asserts preserved.error == refused.error. refusal() clones response.error into UpstreamRefused::error and keeps the whole response; the same value lives in two places with nothing pinning that they agree. A future edit that reclassifies one leg would desync the wire code the reputation layer reads from the code inside the evidence. (Subsumed if client-pull: express UpstreamRefused's evidence invariants in the type #1377 lands.)

Also worth a test

NodeFixture::set_rate_per_mb does parse → mutate → toml::to_string → write with no round-trip test. It is correct today — I verified against the vendored toml 1.1.3 serializer that the ValueAfterTable hazard in [cache] (origin sorts before pull_through_require_authorized_origin) is handled, because each table gets its own buffer — but that is exactly the kind of thing a dependency bump breaks silently. render_config_emits_parseable_toml in the same file is the precedent: it exists so template regressions surface in a plain cargo nextest run -p decdn-e2e with no chain.

Activity

  1. added
    kind:test
    rust
    prio:medium
    on Jul 22, 2026
  2. self-assigned this
    on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:testprio:mediumrust

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions