Skip to content

feat: [EXC-1783] No execution overhead on low cycles#10096

Open
alin-at-dfinity wants to merge 1 commit intomasterfrom
alin/EXC-1783-no-execution-overhead-on-low-cycles
Open

feat: [EXC-1783] No execution overhead on low cycles#10096
alin-at-dfinity wants to merge 1 commit intomasterfrom
alin/EXC-1783-no-execution-overhead-on-low-cycles

Conversation

@alin-at-dfinity
Copy link
Copy Markdown
Contributor

@alin-at-dfinity alin-at-dfinity commented May 5, 2026

When a message execution is skipped due to low cycle balance, don't deduct the message execution overhead from the round instruction limit. The instruction overhead is intended to account for entering and exiting the sandbox, which does not apply here.

This will allow the "execution" of arbitrarily many messages per round on frozen (or close to frozen) canisters, which could drive up round duration. However, there are a lot of other limits in place (ingress messages in blocks, canister call fees, queue sizes) that make this a non-issue. Particularly given that the overhead for skipping a message execution is at least an order of magnitude lower than that of executing one.

When a message execution is skipped due to low cycle balance, don't deduct the message execution overhead from the round instruction limit. The instruction overhead is intended to account for entering and exiting the sandbox, which does not apply here.
@alin-at-dfinity alin-at-dfinity requested a review from a team as a code owner May 5, 2026 16:45
@github-actions github-actions Bot added the feat label May 5, 2026
Comment on lines +231 to +233
ExecuteSubnetMessageResultType::Finished => NumMessages::new(1),
ExecuteSubnetMessageResultType::Processing => NumMessages::new(0),
ExecuteSubnetMessageResultType::Paused => NumMessages::new(0),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a drive-by cleanup: AmountOf::new() is const; AmountOf::from() cannot be made const.


let mut callee = canister0;
let mut call = other_side(callee, 0);
let mut call = other_side(callee, 1);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another drive-by improvement (although this one fixes a test that was broken by this change): a message execution returning "zero instructions executed" is interpreted by the scheduler logic as "message not executed due to low cycles"; that's not what this test was aiming for (which is why it broke).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant