refactor: Switch HTTP outcalls receipts to hold spent cycles instead of refunds#10726
Merged
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to 917e2f1. Security Overview
Detected Code Changes
|
michael-weigelt
approved these changes
Jul 13, 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.
As part of the new pay-as-you-go pricing for HTTP outcalls, each replica participating in the outcall reports its own cycles usage. This usage is reported as part of the response shares gossiped between peers of a subnet.
Before this PR, each node gossiped a refund share, describing the amount of cycles (out of the per-replica allowance), that the node would like to refund to the caller.
The problem with this approach is that on free subnets, the per-replica allowance is zero, in order to avoid minting cycles by mistake. This means that nodes on free subnets cannot properly report their (nominal) cycles usage, which is relevant for properly updating canister metrics.
Therefore, with this PR, nodes will instead report the amount of spent cycles (out of the per-replica allowance). In a follow up we can then allow nodes on free subnets to spend more cycles than their allowance of zero.