refactor: read HTTP/ECDSA outcall cycles from the per-use-case map - #11202
Draft
mraszyk wants to merge 1 commit into
Draft
refactor: read HTTP/ECDSA outcall cycles from the per-use-case map#11202mraszyk wants to merge 1 commit into
mraszyk wants to merge 1 commit into
Conversation
The cycles consumed by HTTP and ECDSA outcalls are tracked both in the legacy scalar fields consumed_cycles_http_outcalls / consumed_cycles_ecdsa_outcalls of SubnetMetrics and in the consumed_cycles_by_use_case map, which a migration introduced in #10844 keeps in lockstep with those fields. This switches all readers over to the map: - get_consumed_cycles_http_outcalls / get_consumed_cycles_ecdsa_outcalls now read the HTTPOutcalls / ECDSAOutcalls entries of consumed_cycles_by_use_case, via a new helper that also backs the existing Schnorr / VetKd / dropped messages getters. - consumed_cycles_total and consumed_cycles_total_v28 add those entries instead of the scalar fields. The scalar fields are still observed and serialized, so that downgrading to an earlier replica version keeps observing the correct totals; only their reads are gone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
✅ No security or compliance issues detected. Reviewed everything up to 7d085c9. Security Overview
Detected Code Changes
|
mraszyk
marked this pull request as draft
August 19, 2026 15:04
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.
The cycles consumed by HTTP and ECDSA outcalls are tracked both in the legacy scalar fields consumed_cycles_http_outcalls / consumed_cycles_ecdsa_outcalls of SubnetMetrics and in the consumed_cycles_by_use_case map, which a migration introduced in #10844 keeps in lockstep with those fields.
This switches all readers over to the map:
The scalar fields are still observed and serialized, so that downgrading to an earlier replica version keeps observing the correct totals; only their reads are gone.