Repository navigation
feat(node,cli,cache): wire staged-but-unconnected mechanisms (#1844) - #1859
Merged
Merged
Conversation
- runtime: periodic LocalReputation::evict on a 1h interval - dht client: exchange_payload helper; store() encodes via encode_store_request - config-types: canonical origin-probe u64 defaults, re-exported in common and cache - admin: chain_denied_origins in admin_v1_status, wired from the content denylist - cli: decdn node slashes subcommand
There was a problem hiding this comment.
Pull request overview
This PR connects several previously-staged mechanisms into the live node/CLI runtime: periodic local reputation eviction, a DHT client store path that uses the protocol’s two-phase encoding helper, canonical origin-probe defaults shared across crates, admin status reporting of the live on-chain origin deny-set size, and a new decdn node slashes CLI subcommand backed by admin_v1_slashes.
Changes:
- Add an hourly background task to run
LocalReputation::evictto bound the per-peer reputation store. - Refactor the DHT client
store()path to encode viaencode_store_requestand exchange pre-encoded payloads. - Centralize origin-probe default constants in
decdn-config-types, re-export them viadecdn-common, and consume them indecdn-cache; extend admin status + CLI output withchain_denied_origins; add CLInode slashes.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/node/src/runtime/mod.rs | Add hourly local reputation eviction tick; wire admin denylist into admin server state; plumb shutdown handle. |
| crates/node/src/dht/client.rs | Introduce exchange_payload and use encode_store_request for store() requests. |
| crates/node/src/admin.rs | Add denylist to AdminState and report chain_denied_origins via admin_v1_status. |
| crates/config-types/src/lib.rs | Re-export new origin-probe default constants from defaults. |
| crates/config-types/src/defaults.rs | Define canonical u64 origin-probe memo TTL/timeout/capacity defaults. |
| crates/common/src/config/mod.rs | Replace duplicated origin-probe defaults with re-exports from decdn-config-types. |
| crates/common/src/cli/node.rs | Add NodeCommand::Slashes and define SlashesArgs. |
| crates/common/src/cli/mod.rs | Re-export SlashesArgs from the CLI module. |
| crates/common/src/admin.rs | Extend StatusResponse with chain_denied_origins; update serde round-trip test. |
| crates/cli/src/commands/node.rs | Implement decdn node slashes command; render chain_denied_origins in status output; update status tests. |
| crates/cache/src/origin_probe.rs | Wrap canonical origin-probe defaults from decdn-config-types into Duration/usize cache constants. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage reportTotal: 82.07% (was 82.08%, ▼ 0.01%) — 68981/84056 lines
History
|
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.
Summary
Wires up several mechanisms that were previously staged but not connected to the runtime:
LocalReputation::evicton a 1h interval (ADR 008) — bounds the local per-peer reputation store under peer churn.exchange_payloadhelper;store()now encodes viaencode_store_request(ADR 013 §Tier 1 two-phase), mirroring the server'sparse_store_request_extseam. Wire-compatible.commonandcacheso the config default and cache engine default cannot drift.chain_denied_originsinadmin_v1_status, wired from the live content denylist (ADR 011).decdn node slashessubcommand backed byadmin_v1_slashes(e2e G-NODE-05: operator slash detection + appeal (incl. decdn appeal slash CLI) #1032, G-NODE-05).Verification
cargo buildandcargo clippypass on the affected crates (decdn-cli,decdn-node,decdn-cache,decdn-config-types,decdn-common).