Harden request PoW policy and P2P defaults - #158
Merged
Conversation
Bind request PoW to receiver-owned policy and request context, reject stale and replayed requests, and default P2P listeners to loopback. Assisted-by: AI agent (reviewed by maintainer) Signed-off-by: Richard Ikeda <11233899+richardikeda@users.noreply.github.com>
richardikeda
marked this pull request as ready for review
July 26, 2026 14:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Completes the next coherent P0 remediation batch for request proof-of-work policy and P2P network exposure.
Why
The previous request path enforced only an implicit global PoW minimum. It did not expose a trusted receiver-owned policy, bind work to the request fields, enforce request freshness, or remember accepted requests across the normal persisted flow. The P2P configuration also described a localhost default while listening on all IPv4 interfaces.
Changes
RequestPowPolicyowned by the receiver./ip4/127.0.0.1/tcp/0.--listen-addr.docs/p0.mdwith evidence.Security Impact
Yes.
serde(default), so existing local-state envelopes remain readable.cfg_hash, epoch rule, or cryptographic primitive changes.Tests
cargo test -p spex-client --lib --lockedcargo test -p spex-client --test e2e_flow --lockedcargo test -p spex-transport --lib --lockedcargo fmt --all -- --checkcargo clippy --workspace --locked --all-targets --all-features -- -D warningscargo test --workspace --locked --all-featuresRUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-featurescargo auditcargo deny checkscripts/release_gate_docs.shthrough an in-memory CRLF normalization on Windowsscripts/release_gate_negative_test.shthrough an in-memory CRLF normalization on WindowsAll commands passed locally on 2026-07-26.
cargo auditretains the existing allowedpastemaintenance warning;cargo denyretains the documented duplicate/advisory-not-detected warnings.Documentation
README.mdTESTS.mdCHANGELOG.mddocs/p0.mddocs/security.mddocs/integration.mddocs/cli.mdVersioning
New version in
VERSION.md:1.0.29.Notes for Reviewers
Assisted-by: AI agent (reviewed by maintainer)