Skip to content

feat(node,cli,cache): wire staged-but-unconnected mechanisms (#1844) - #1859

Merged
thiras merged 2 commits into
mainfrom
wire-staged-mechanisms-1844
Aug 27, 2026
Merged

thiras merged 2 commits into
mainfrom
wire-staged-mechanisms-1844

Conversation

@thiras

@thiras thiras commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Wires up several mechanisms that were previously staged but not connected to the runtime:

  • runtime: periodic LocalReputation::evict on a 1h interval (ADR 008) — bounds the local per-peer reputation store under peer churn.
  • dht client: exchange_payload helper; store() now encodes via encode_store_request (ADR 013 §Tier 1 two-phase), mirroring the server's parse_store_request_ext seam. Wire-compatible.
  • config-types: canonical origin-probe u64 defaults, re-exported in common and cache so the config default and cache engine default cannot drift.
  • admin: chain_denied_origins in admin_v1_status, wired from the live content denylist (ADR 011).
  • cli: decdn node slashes subcommand backed by admin_v1_slashes (e2e G-NODE-05: operator slash detection + appeal (incl. decdn appeal slash CLI) #1032, G-NODE-05).

Verification

  • cargo build and cargo clippy pass on the affected crates (decdn-cli, decdn-node, decdn-cache, decdn-config-types, decdn-common).

- 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
Copilot AI lite review requested due to automatic review settings August 27, 2026 03:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::evict to bound the per-peer reputation store.
  • Refactor the DHT client store() path to encode via encode_store_request and exchange pre-encoded payloads.
  • Centralize origin-probe default constants in decdn-config-types, re-export them via decdn-common, and consume them in decdn-cache; extend admin status + CLI output with chain_denied_origins; add CLI node 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.

Comment thread crates/node/src/runtime/mod.rs Resolved
Comment thread crates/cli/src/commands/node.rs Resolved
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 82.07% (was 82.08%, ▼ 0.01%) — 68981/84056 lines

File Coverage Lines Δ
crates/cache/src/origin_probe.rs 100.00% 165/165 ● 0.00%
crates/cli/src/commands/node.rs 77.04% 1084/1407 ▼ 0.33%
crates/common/src/admin.rs 93.69% 104/111 ▲ +0.12%
crates/common/src/cli/mod.rs 100.00% 3/3 ● 0.00%
crates/common/src/cli/node.rs 100.00% 5/5 ● 0.00%
crates/common/src/config/mod.rs 97.08% 6845/7051 ● 0.00%
crates/node/src/admin.rs 92.52% 977/1056 ▼ 0.61%
crates/node/src/dht/client.rs 76.69% 102/133 ▲ +1.89%
crates/node/src/runtime/mod.rs 47.59% 1154/2425 ▼ 0.24%
History
Commit Total Δ vs base
49fbbb0 82.03% ▼ 0.05%
1ab3412 (HEAD) 82.07% ▼ 0.01%

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@thiras
thiras merged commit e2273cc into main Aug 27, 2026
72 of 76 checks passed
@thiras
thiras deleted the wire-staged-mechanisms-1844 branch August 27, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants