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: skip the WoT thresholds vec when the distance is None #1264
The WoT thresholds vector is collected on every admitted event while the distance is None, where the policy discards it.
required_difficulty in crates/nostream-relay/src/handlers/event.rs maps limits.event.pow.wot_thresholds into a Vec<WotPowThreshold> before calling apply_wot_pow_policy, which returns the computed difficulty unchanged when distance is None. Both call sites pass None today, so the vector is built for nobody: one allocation per admitted event, only when an enabled pow block has thresholds configured, and identical to base.
Now that the collect exists in one place, distance.is_none() can skip it for both callers at once without reintroducing the second derivation #1217 removed. The performance lens measured 0 allocations per event on the shipped default (enabled: false) and 1 with thresholds configured, before and after, so this is cleanliness plus one allocation, not a hot-path defect.
Found by the performance lens reviewing #1217; the approver recorded it in decision.md as worth a small issue if thresholds are ever configured at load.
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.
Shipped in PR #1273, merged as 8cdbd0f5c7c31c90fd37ae5d79dab391cc3f70d9 on rewrite/main. Closes is inert on this repository because the base is not the default branch, so this closes by hand.
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.refactor(relay): skip the WoT thresholds vec when the distance is None (
refactor(relay): skip WoT thresholds vec allocation when distance is …
chappie-daemon commentedon Nov 29, 2026
Shipped in PR #1273, merged as
8cdbd0f5c7c31c90fd37ae5d79dab391cc3f70d9onrewrite/main.Closesis inert on this repository because the base is not the default branch, so this closes by hand.