Skip to content

test!: drop tests of dead code, removed features and duplicates - #2959

Merged
alpergundogdu merged 15 commits into
mainfrom
claude/test-suite-audit-fe54d9
Nov 24, 2026
Merged

alpergundogdu merged 15 commits into
mainfrom
claude/test-suite-audit-fe54d9

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

A test-suite audit turned up tests of code that no longer runs in production, tests of removed features, and duplicates. This PR removes them: 142 files, +848 / -6026.

Dead production code kept alive only by tests (deleted with its tests)

  • The pending-settle store (PendingSettleStore, PendingSettle, both redb tables, BuyerPendingSettleStoreHandle). No production caller since feat(payments): shared payment pool — capped delegated signers + node-addressed cumulative vouchers #1667.
  • bao-range streaming (encode_whole_blob_headerless), Bytes::{is_zero, saturating_*, Display}, PinnedHashes::diff, OriginUrl::into_url, first_payment_pool, send_unrecorded, redeem_hint_sender, StaticOriginDirectory::with_operators, the pool-store path() accessors.
  • Unused e2e fixtures (capture_delivery_wire, rotate_node_id, wait_for_log_line), unused bindings and contract mock setters.

Tests of removed features

Duplicates and no-op tests

  • About 150 tests whose assertions a named survivor already makes (unique assertions moved into the survivor first), plus tests that only restated std, serde, alloy or OpenZeppelin behaviour.
  • CLI deregister and unbond call rotate_key::confirm_or_bail instead of carrying their own copies.
  • 8 of the 21 GovernanceLifecycle bound-revert tests. The other 13 stay: their bound has no test in the target contract's own suite.

Breaking

  • LaneSnapshot::last_nonce is gone (it always reported 0; vouchers carry no nonce). decdn node lanes drops the NONCE column; the admin JSON and dashboard type drop the field.
  • A peer-store record without multiaddrs no longer decodes; the store skips it with a warning, as it does for other missing fields.

Strengthened rather than deleted

  • Metrics recorder tests bump each counter a distinct number of times, so a swapped recorder fails.
  • The dispatch in-flight test reads the gauge. bad_permissions_rejected asserts the StoreError variant. origin_only_node_declines_a_foreign_hash asserts Declined and foreign_declined_total 1.

Not in this PR

  • origin_only_node_declines_a_foreign_blob_already_in_cache still asserts only is_err(): its setup faults the backend, so the foreign-decline gate never runs. It needs a clean-absence backend.
  • Judgement calls left open: the set_bound acquire machinery, gating test fakes behind test-support, whether open_range_cursor should enforce max_blob_bytes.

Verification

  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items
  • cargo nextest run --workspace: 5978 passed
  • cargo test --no-run -p decdn-e2e --features anvil-e2e
  • pnpm -C crates/cli/dashboard test: 78 passed
  • Contracts: forge fmt --check, FOUNDRY_PROFILE=ci forge build --sizes --deny warnings, forge test (720 passed), gas snapshot regenerated

🤖 Generated with Claude Code

alpergundogdu and others added 15 commits November 23, 2026 19:19
- bao-range: delete the unused `streaming` module (encode_whole_blob_headerless)
  and its tests; serve_store's reference encoding strips the 8-byte header
  from encode_verified_range instead. Drop the thiserror #[from] test.
- config-types: delete test-only Bytes::is_zero/saturating_add/saturating_sub/
  Display, PinnedHashes::diff and OriginUrl::into_url with their tests; drop
  the duplicate default_and_disabled_are_distinct tests.
- cache: drop the stale partial_hit_size mirror, the iroh-blobs spike test,
  the observe_hit forwarding test, two access-time tests (fetch assertion
  moved into second_populate_updates_access_time), two NoOrigin integration
  tests, the http 404-only range test, two size-proof duplicates (kept-proof
  assertion moved into a_wrong_size_gets_no_proof) and the second fs
  outboard-oversize test (length assertion merged). Strengthen
  encode_verified_range_roundtrips_for_honest_bytes to check header and
  exact wire length; fix test names/docs that referred to CacheEngine::get.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Delete the unused pending-settle store: PendingSettle/PendingSettleStore
  (incentive), both redb tables, their helpers, BuyerPendingSettleStoreHandle,
  and the tests of them.
- Delete test-only PersistentPoolStateStore::{path,deployment} and
  PoolStoreFiles::path with lane_store_lives_in_data_dir.
- Delete StaticOriginDirectory::with_operators and
  PoolSettlementService::redeem_hint_sender (no callers).
- Delete dht/bootstrap unit tests that re-implement the seed loop, and
  duplicate or tautological tests in handlers/client, node_origin,
  runtime, runtime/reload, admin, dht rate_limit and origin, buyer_ledgers,
  metrics, load_shed, binding_check, selection, incentive store.
- Strengthen: dispatch in-flight gauge read, distinct bump counts for
  attestation and serve-cache metrics, a specific StoreError for bad
  permissions, a real flush in truncated_file_refuses_to_start.
- Fix stale comments in range_helper_tests and runtime tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…licate tests

- common: delete test-only ResolvedBlockchain::first_payment_pool; drop
  derived serde round-trips in admin, Option presence tests in
  config/types, region tests the protocol crate already pins, a
  duplicate identity reload test, a Debug-in-struct restatement, a clap
  flag restatement, and eight removed-knob unknown-field pins.
- incentive: delete uncalled tx::send_unrecorded; drop eth_identity
  tests that exercise the sol! macro and alloy; rename a lane test that
  never called stage_voucher and drop its clone half.
- protocol: drop eleven client and ten dht serde round-trips covered by
  the full-stack and discriminant tests, the unknown-discriminant decode
  tests, and validator tests subsumed by the dispatcher test.
- reputation: merge the two speed-score tests, drop the local copy and
  two EWMA tests subsumed by others.
- sponsord-api: drop arithmetic_saturates (restates std).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Remove tests of deleted code and tests a surviving test already covers:
- client_loopback: floor-reservation pair, client_deposit_gate_prices_one_chunk,
  the bound-signer-without-lane duplicates, the delegate-signer happy-path
  duplicates, pull_through_authorizes_the_delegate_not_the_funder,
  buyer_refuses_an_over_ceiling_blob_without_paying, and
  over_cap_stream_is_reset_without_signing_a_response.
- origin_range_pull: the floor-leak follow-up pull in the cold out-of-bounds test.
- node_to_node_pull_through: upstream_hash_mismatch_is_rejected and its liar helpers.
- anvil_settlement_e2e: the forge_script_body_completed unit tests (e2e covers them).

origin_only_node_declines_a_foreign_hash now asserts the Declined class and
the foreign-decline counter. Comments stop reasoning in voucher nonces, the
buyer-cap comments name the proven-size gate, and the redundant
with_client_binding re-signs go (pool_context attaches the same binding).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- bundle engine: drop a_fallback_drive_keeps_the_bytes_spliced_before_it
  (pre-assembly store-splice guard); splice tests and docs name the
  assembly file, not .partial
- streamer: size-claim wording on two open_range refusal tests
- segment: split_evenly test asserts four contiguous pieces
- lib tests: drop orphan doc block
- discovery: drop skips_inactive_nodes (duplicate)
- buyer_pool: merge two openPool pairs, drop open_on, the let _ =
  signature tests and the RFC 6979 determinism test
- config: drop const-construction test and literal assert
- source: drop compile-time PeerSource: BlobSource test
- ledger: drop two subsumed tests
- connection: drop concurrent_gets_share_one_dial (subsumed)
- lane_sources: doc matches what the test checks
- receipt: drop incentive verify_forward assert, rename test
- peer_store: multiaddrs is required; drop serde(default) and its
  back-compat test

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- cli: deregister/unbond confirm through rotate_key::confirm_or_bail (their
  copies and tests go); fold setup's days_from_civil test into civil_time,
  pool's data-dir test into config_fills_unset_flags; drop
  running_version_is_the_crate_version, the unused mod common in
  pool_lifecycle, and the removed-flag/command and has_blob absence pins;
  rename publish *_round_trip(s) tests to *_json_shape.
- e2e: delete capture_delivery_wire and its wire-tap helpers,
  ChainFixture::rotate_node_id and head_timestamp,
  NodeFixture::wait_for_log_line, time::advance_to, assert::expect_revert and
  operator_active, and bindings nothing calls; one rewrite_int replaces three
  copy-paste config rewriters; delete smoke.rs (covered by G-NODE-01), the
  namespace-transfer and below-min-bond journeys (covered by forge), and the
  allowance-absent check; fix stale docs in coalesce_two_clients and the
  authorized-origin comments; rename peer_store_probeless to
  peer_store_fast_path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pending-settle store is gone, so settle.redb holds the settlement
ledger and the sent redeemMany hashes. Move the orphaned #1042 doc onto
its test and restate the empty-blob test doc in the present tense.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…pins

- PaymentPool: drop the five removed-selector pins, the pause tests covered by
  PaymentPoolSweep.test_pause_blocksInflowsOnly, armsMinDeposit, and the
  redeem payout copy; Sweep drops its constructor-immutables copy.
- DeployProtocolScript: drop the SlashJudge/SlashAppeal absence asserts.
- CapacityBond: drop declaredMbps_storesValue, the re-register region test
  (covered by the cooldown test), and raiseNeverEjects (its ejected assert
  moves into grandfathersActiveOperator).
- GovernanceLifecycle: drop the three canaries (DeployProtocol pins the same
  wiring) and the lifecycle bound reverts whose bound is unit-tested in the
  target's own suite.
- ContentBlacklist: orphan headers and stray notice go, the regional test is
  named for what it checks, the ratify duplicate goes, and the deregister
  assert from ContentBlacklistMutations moves into the suspension test.
- OriginAssignment, DecdnGovernor, Token, E2EProtocol: drop tests subsumed by
  others, moving unique asserts into the survivors.
- Delete unused mock setters (MockFeeRouter.setWindowEpochs,
  MockEjector.setWindow, setSqrtPrice); regenerate .gas-snapshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Vouchers carry no nonce, so the field always reported 0. Remove it from
the admin DTO, the node producer, the `decdn node lanes` NONCE column,
and the dashboard type and fixtures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The gateway allowance, the old recovery flags and the single-chain flags
fail to parse like any unknown flag; keep only the --pool-rpc-url needs
--pool check. Drop the deleted smoke journey from the CI comment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-code-quality

github-code-quality Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust, Solidity

Rust / code-coverage/cargo-llvm-cov

main deed8b3 claude/test-suite-au... bff2a9c +/-
77% 78% +1%
View coverage of the 10 most impacted files.
File main deed8b3 claude/test-suite-au... bff2a9c +/-
crates/protocol...src/identity.rs 100% 50% -50%
crates/sponsord...pi/src/money.rs 100% 75% -25%
crates/bao-range/src/ingest.rs 81% 63% -18%
crates/node/src/pool_store.rs 82% 80% -2%
crates/e2e/src/node.rs 21% 19% -2%
crates/e2e/src/chain.rs 11% 12% +1%
crates/cli/src/...mands/unbond.rs 56% 58% +2%
crates/cli/src/...s/deregister.rs 38% 40% +2%
crates/config-t...c/origin_url.rs 89% 95% +6%
crates/incentive/src/tx.rs 91% 98% +7%

Solidity / code-coverage/forge

main deed8b3 claude/test-suite-au... bff2a9c +/-
90% 90% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated November 23, 2026 20:09 UTC

@github-actions

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@alpergundogdu
alpergundogdu merged commit 31ac9ad into main Nov 24, 2026
39 checks passed
@alpergundogdu
alpergundogdu deleted the claude/test-suite-audit-fe54d9 branch November 24, 2026 12:34
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.

1 participant