Repository navigation
refactor(workspace,contracts)!: delete dead code found by the mechanism inventory sweep - #1850
Conversation
…sm inventory sweep (#1844 sibling) Remove code with no production caller, along with the tests that existed only to exercise it. Net -3,900 lines. Whole mechanisms: - client-pull: the rtt_map module (nothing constructs it; the shipped ADR 037 warming path ranks by live probe RTT), pull_to_sink and the decode_to_sink loop it drove, resume_offset / resume_is_genuine (superseded by the checkpointing ClientRangedStore), discovery::rank and the Probed.has_live_channel field only it read - node: the fused progressive pull (NodeOrigin::open_progressive_pull, NodeProgressivePull, TeeVerdict), superseded by the two-leg window path; its 13 tests and 4 helpers in node_origin_pull.rs - config-types: the Percent module (its seed-leech consumer was never built; the Bytes half of #894 remains) Smaller items: - cache: retry_fetch and the run_with_retry wrapper (the engine calls run_with_retry_classified directly) - node: CursorStart::Seeded persist field (its route no longer exists; the checkpoint-hold poller test now runs on FromCheckpoint), BOOTSTRAP_TIMEOUT (client::DHT_CLIENT_TIMEOUT already bounds every request), cmp_by_distance, selection::top_n, ShedState::tracked_clients, ClientHandler::lane_state_snapshot - incentive: MemoryPendingSettleStore, ARBITRUM_SEPOLIA_CHAIN_ID, CheckpointKey::Origin (kept only for a multi-key test) - client-pull: ClientRangedStore::{present_handle,data_path_handle} - reputation: interaction module is crate-private (all items pub(crate)) - e2e: remove_origin, blacklist_added_at, owner_pool_nonce fixture verbs - contracts: CapacityBond.getBondMultiple (ADR 003 excludes it from the interface) and CapacityBond.getNode (zero consumers; the ADR 003 interface listing drops it, getNodeByAddress stays) Kept deliberately: BPS_SCALE, register_lane, publisher_record_count (live callers), apply_voucher/stage_voucher (canonical voucher entry, carries channel_state_store coverage), DhtHandler::with_routing and per_source_tracked (constructor/observability seams for integration suites of live code), the stream_fetch* harness family. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013XCL6WZ1TzGypMUpFbvUYb
Gas snapshotNo gas changes vs base. |
Contracts coverageLine coverage: 89.85% (2575/2866 lines) |
…ode removal `OriginFetch` and `Origin` are no longer imported where the `collect_to_bytes` and `fetch` links resolve them, so both links now use full paths. Caught by `cargo doc -D warnings`. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013XCL6WZ1TzGypMUpFbvUYb
There was a problem hiding this comment.
Pull request overview
This PR removes code paths and tests identified as having no production callers after a mechanism-inventory sweep, trimming unused client-pull utilities, node pull-through legacy (“progressive/window”) remnants, stale config vocabulary types, and unused contract view helpers. The changes reduce maintenance surface area while keeping the currently shipped pull-through and retry mechanisms as the canonical paths.
Changes:
- Remove dead node pull-through APIs/tests (notably
NodeOrigin::open_progressive_pulland related helpers) in favor of the established two-leg pull path. - Remove unused client-pull / config-types mechanisms (
rtt_map, sink “pull-to-sink” remnants,Percent) and simplify discovery ranking shape. - Remove unused watcher cursor persistence shape (
CursorStart::Seeded { persist }) and unused contracts views (CapacityBond.getBondMultiple,getNode) with ADR interface update.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/reputation/src/lib.rs | Make interaction module crate-private and update crate docs accordingly. |
| crates/node/tests/node_origin_pull.rs | Delete tests that only exercised removed progressive/window pull APIs; adapt remaining tests to buffered fetch path. |
| crates/node/src/slash_watcher.rs | Update cursor start construction to new CursorStart::Seeded { at } shape and adjust tests. |
| crates/node/src/selection.rs | Remove unused top_n helper and its unit tests. |
| crates/node/src/node_origin/pull_leg.rs | Update docs to reference buffered Origin::fetch pipeline rather than removed progressive pull API. |
| crates/node/src/node_origin/mod.rs | Delete the progressive/window pull API and related types; tighten imports/docs around remaining pull paths. |
| crates/node/src/load_shed/state.rs | Remove tracked_clients accessor and update tests to check internal map length directly. |
| crates/node/src/handlers/client/mod.rs | Remove unused lane_state_snapshot and adjust test to read lane state directly. |
| crates/node/src/dht/routing.rs | Remove unused cmp_by_distance helper and its unit test. |
| crates/node/src/dht/capacity_bond_registry.rs | Update cursor start construction to new seeded shape and adjust tests. |
| crates/node/src/dht/bootstrap.rs | Remove dead BOOTSTRAP_TIMEOUT alias and its documentation. |
| crates/node/src/channel_store.rs | Remove dead test that relied on removed checkpoint key. |
| crates/node/src/chain_events/resumable_watcher.rs | Simplify CursorStart::Seeded to be non-persisting; remove persist-related logic/tests and update docs. |
| crates/node/src/chain_events/multiplexed_poller.rs | Update tests to reflect new cursor start semantics (use FromCheckpoint for durable cursors). |
| crates/node/src/blacklist_watcher.rs | Update cursor start construction to new seeded shape and adjust tests. |
| crates/incentive/src/store.rs | Remove dead CheckpointKey::Origin and MemoryPendingSettleStore plus tests. |
| crates/incentive/src/lib.rs | Stop re-exporting removed store types/keys. |
| crates/incentive/src/eth_identity.rs | Inline chain id literal in tests after removing dead constant. |
| crates/e2e/src/chain.rs | Remove dead ChainFixture helper methods with no journey callers. |
| crates/e2e/src/assert.rs | Remove unused owner_pool_nonce helper. |
| crates/config-types/src/percent.rs | Delete unused Percent newtype module. |
| crates/config-types/src/lib.rs | Remove percent module wiring and export. |
| crates/config-types/src/bytes.rs | Update docs to no longer reference Percent. |
| crates/client-pull/src/sink.rs | Remove dead pull-to-sink/resume helpers and related tests; keep streaming-decode support types used by ranged ingest path. |
| crates/client-pull/src/rtt_map.rs | Delete unused RTT map implementation and tests. |
| crates/client-pull/src/ranged_store.rs | Remove dead handle getters that had no callers. |
| crates/client-pull/src/lib.rs | Stop exporting deleted rtt_map; adjust module doc note for sink links. |
| crates/client-pull/src/discovery.rs | Remove dead “live channel” ranking fields/logic and update docs accordingly. |
| crates/cli/src/commands/fetch.rs | Stop populating removed Probed.has_live_channel; update comments around failover ordering. |
| crates/cache/tests/s3_origin.rs | Update test comment to reflect current retry loop entry point. |
| crates/cache/src/retry.rs | Remove dead run_with_retry wrapper and retry_fetch; keep run_with_retry_classified as the single retry loop primitive. |
| crates/cache/src/origin/s3.rs | Update docs to reference run_with_retry_classified. |
| crates/cache/src/origin/mod.rs | Update trait docs to no longer reference removed retry_fetch. |
| crates/cache/src/lib.rs | Remove re-export of deleted Percent. |
| crates/cache/src/circuit_breaker.rs | Update docs to reference run_with_retry_classified. |
| contracts/src/CapacityBond.sol | Remove unused view methods to reduce bytecode size. |
| adr/003-payments.md | Remove getNode from the documented interface list. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Removing CapacityBond.getBondMultiple and getNode changes the contract's deterministic gas profile, so the enforced .gas-snapshot gate needs the fresh baseline (FOUNDRY_PROFILE=ci forge snapshot). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_013XCL6WZ1TzGypMUpFbvUYb
Coverage reportTotal: 82.04% (was 82.08%, ▼ 0.04%) — 67905/82767 lines
History
|
One conflict, in `crates/incentive/src/store.rs`. The dead-code sweep (#1850) deleted `MemoryPendingSettleStore` and its two tests, which nothing on main references; this branch had carried them along untouched while editing the floor-loss surface immediately below them. Took main's deletion and kept this branch's `(pool_id, signer)` floor-loss doc and its `signers()` test helper. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Deletes everything the codebase-wide mechanism inventory sweep found with no production caller — including code whose only callers were its own tests, and those tests with it. +247 / −4,147 across 37 files. Companion issues: #1844 (staged mechanisms worth wiring instead), #1845 (stale docs).
Whole mechanisms removed
client-pull/src/rtt_map.rs(236 LOC) — the ADR 037 client RTT map; nothing constructed it (its own header said so). The shipped warming path ranks by live probe RTT viadiscovery::proxy_warming_order; theWarmingCandidatedoc now describes that divergence without pointing at a module.NodeOrigin::open_progressive_pull,NodeProgressivePull,TeeVerdict,abandon_corrupt, private candidate walkers) — superseded by the two-leg window path (open_pull_leg+run_pull_leg+ the serve leg). Its only external callers were tests: 13 test fns and 4 helpers deleted fromnode_origin_pull.rs(14,509 → 12,720 LOC).client-pull/src/sink.rs—pull_to_sink, thedecode_to_sinkloop only it drove,resume_offset,resume_is_genuine, and their tests. The live streaming path isClientRangedStore::ingest_stream(which keepsPullReader,StashedFault,classify_decode_error,content_paid_frontier— all still live and tested).config-types::Percent(125 LOC) — the seed-leech share-ratio consumer described in its docs was never built; theByteshalf of node: type-encode the seed-leech cap units (Bytes/Percent newtypes) to close the config→LeechCaps confusion seam #894 stays.discovery::rankand theProbed.has_live_channelfield only it read (both CLI construction sites set it to a constantfalse), plusRTT_REUSE_TOLERANCE.Smaller deletions
retry_fetch; therun_with_retrywrapper that became dead with it (engine callsrun_with_retry_classifieddirectly)CursorStart::Seeded { persist }field — its only production shape wasNonesince the origin route was folded into the blacklist route; the poller's checkpoint-hold test now exercises the realFromCheckpointshapeBOOTSTRAP_TIMEOUT(an alias ofclient::DHT_CLIENT_TIMEOUT, which already bounds every outbound DHT request),RoutingTable::cmp_by_distance,selection::top_n,ShedState::tracked_clients(its leak-prune tests now read the private field directly),ClientHandler::lane_state_snapshotMemoryPendingSettleStore,ARBITRUM_SEPOLIA_CHAIN_ID(test-only; literal inlined),CheckpointKey::Origin(kept only so a multi-key test had a second key)ClientRangedStore::{present_handle, data_path_handle}interactionmodule is now crate-private (every item in it was alreadypub(crate))remove_origin,blacklist_added_at,owner_pool_noncefixture verbs no journey callsCapacityBond.getBondMultiple— ADR 003 § payments explicitly excludes it from the interface, and it was spending bytecode on a contract near the EIP-170 ceiling;CapacityBond.getNode— zero consumers anywhere including tests (Rust bindsgetNodeByAddress); the ADR 003 interface listing drops thegetNodelineDeliberately kept (checked, not dead)
rate::BPS_SCALE(used inverify_rate's arithmetic),ClientHandler::register_lane(called on the voucher path),RecordStore::publisher_record_count(enforces the per-publisher admission cap).LaneState::apply_voucher/stage_voucher— documented as the canonical voucher-verification entry and load-bearing for thechannel_state_storepersistence suite; removing them means rewriting live-store coverage, not deleting dead code.DhtHandler::with_routingandConnectionLimiter::per_source_tracked— constructor/observability seams that the DHT integration suites andprobe_loopback's limiter-GC assertion (tests of live code) are built on; deleting them deletes that coverage.stream_fetch*family — the harness client for the node loopback suites and the e2eClientFixture; production usesopen_progressive_pull(client-pull's) +drive.Validation
cargo build/cargo clippy --workspace --all-targets/cargo fmt -- --check— cleannode_origin_pull65 ✓,channel_state_store14 ✓, cli 439 ✓, client-pull / cache / incentive / reputation / config-types suites ✓forge fmt --check✓,FOUNDRY_PROFILE=ci forge build --sizes --deny warnings✓,forge test843 passed / 0 failed ✓ (Foundry v1.7.1, solc 0.8.28)🤖 Generated with Claude Code
https://claude.ai/code/session_013XCL6WZ1TzGypMUpFbvUYb
Generated by Claude Code