You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
relay: the handler's PoW rate has no end-to-end case at a non-zero rate #1263
The handler's PoW rate conversion has no end-to-end case at a non-zero rate.
crates/nostream-relay/src/handlers/event.rs converts context.pow at the block's period_ms and passes the result to required_difficulty(Some(limits), rate, None). Every socket-level case runs at a rate of zero — HandlerContext.pow starts empty per context (crates/nostream-relay/src/testing.rs) and no test advances it — so substituting the literal 0.0 for that conversion would leave the whole suite green. The security lens measured the wiring correct with a throwaway probe (a seeded rate of ~187.8 ev/s made the gate answer pow: difficulty 0<32, the ceiling, not the discounted 16 the configured threshold would allow), but nothing in the tree pins it.
What would settle it: a case that seeds AdaptivePowState with accepted events (or adds a fixture setter for the rate) and asserts the gate's <required> in a rejection frame rises above floor_bits with a low targetEventsPerSecond. The natural owner is the job that wires the WoT distance, which will exercise the same path with a Some(distance).
Found by the code and security lenses reviewing #1217; the approver recorded it in decision.md under "worth an issue".
Follow-up of #1217, filed from its approver's decision.md — a gap left by that job, not a defect in what landed (merged as the PR 1262 squash). It carries no owner yet.
Activity
chappie-daemon commentedon Nov 27, 2026
Follow-up of #1217, filed from its approver's
decision.md— a gap left by that job, not a defect in what landed (merged as the PR 1262 squash). It carries no owner yet.