strip unused QuotingMetricsTracker surface, dead deps, and dead feature flag#109
Merged
Conversation
The quote-pricing formula in payment/pricing.rs reads exactly one input: close_records_stored. Every other field on QuotingMetricsTracker (received_payment_count, records_per_type, start_time, network_size) is written but never read by any production code path, and there are no prometheus / opentelemetry / metrics dependencies or HTTP/RPC status endpoints that observe them. Likewise the entire persistence layer (with_persistence, PersistedMetrics, maybe_persist, Drop::persist, PERSIST_INTERVAL) is unreachable in production: node.rs and devnet.rs both construct the tracker via ::new(_), never ::with_persistence(_), so the on-disk format and debounce machinery serve no purpose. This commit narrows the tracker to its live surface: - one field: close_records_stored - two methods: record_store(), records_stored() - ::new(initial_records) constructor QuoteGenerator::record_payment() and the storage handler's record_payment() call site go away (they only fed the dropped received_payment_count counter). QuoteGenerator::record_store() loses its unused data_type parameter. 472 lib tests pass; clippy clean; rustfmt clean; cargo doc warning-free.
The label implied a roadmap (a pending Phase 2 with new inputs to the formula) that does not exist anywhere in the repository. Rewords the module doc to describe the current formula on its own terms and keeps the historical context as "an earlier formula" rather than "Phase 0". No code change.
Three direct dependencies (aes-gcm-siv, hkdf, self_encryption) were declared for a legacy ant-node data migration that was never integrated. `grep` confirms zero imports across src/. The "dev" Cargo feature is declared but has zero `#[cfg(feature = "dev")]` gates anywhere in src/. Cargo.lock loses 76 lines of transitive baggage along with these. 472 lib tests pass; clippy clean; rustfmt clean; cargo doc clean.
There was a problem hiding this comment.
Pull request overview
This PR removes unused quoting-metrics scaffolding and associated dead code paths, simplifies the storage->pricing signal to a single counter (close_records_stored), and trims unused Cargo dependencies/feature flags to reduce maintenance overhead.
Changes:
- Simplify
QuotingMetricsTrackerto only trackclose_records_stored, removing unused counters, per-type tracking, and persistence helpers. - Update storage handler and quote generator to record only store events (remove payment recording and
data_typeparameter fromrecord_store). - Remove unused direct dependencies (
aes-gcm-siv,hkdf,self_encryption), drop the unuseddevfeature, and refresh pricing module docs.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/storage/handler.rs | Stops recording payment/type metrics on chunk PUT; only increments stored-record counter. |
| src/payment/quote.rs | Removes record_payment and changes record_store API to match simplified metrics tracker. |
| src/payment/pricing.rs | Updates module-level documentation wording (no pricing logic change). |
| src/payment/metrics.rs | Replaces multi-metric + persistence tracker with a single atomic counter. |
| Cargo.toml | Removes dead direct deps and removes the unused dev feature. |
| Cargo.lock | Removes lock entries for eliminated direct dependencies and their no-longer-needed transitive packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mickvandijke
approved these changes
May 21, 2026
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
QuotingMetricsTracker— the price formula reads exactly one input (close_records_stored), everything else was scaffolding without a consumer.aes-gcm-siv,hkdf,self_encryption) and the deaddevCargo feature flag.Net: +28 / -413 across 6 files (Cargo.lock loses 76 lines on its own).
What's actually dead
QuotingMetricsTrackershipped with seven fields, but onlyclose_records_storedis read bycalculate_price(which is the only consumer). The others were either ghost infrastructure (entire persistence layer:with_persistence,PersistedMetrics,maybe_persist,Drop::persist) or values that get bundled into aQuotingMetricsstruct nobody calls —received_payment_count,records_per_type,start_time/live_time,network_size. Production constructs the tracker via::new(_), never::with_persistence(_), so the on-disk format and debounce machinery never fired anywhere.Cargo deps
aes-gcm-siv,hkdf,self_encryptionwere declared for a legacy data-migration feature that was never built — zerousestatements acrosssrc/. Cargo featuredevhad zero#[cfg(feature = "dev")]gates.What this PR doesn't touch
record_paymentis removed (only fed the dropped counter);record_storeloses its unuseddata_typeparameter. The wire protocol still carriesdata_typethroughChunkQuoteRequestandMerkleCandidateQuoteRequest, untouched.ant-client,ant-protocol,evmlib,saorsa-core) imports the affected surface. Verified by grep across the workspace and~/.cargo/registry/.Verification
cargo clippy --all-features --all-targets -- -D warningsclean.cargo fmt --checkclean.cargo doc --no-deps --all-featureswithRUSTDOCFLAGS="--deny=warnings"clean.Test plan
ant-client) build against this branch unchangedrecord_storesignature change isn't load-bearing somewhere I missed