Skip to content

Conversation

@viviveevee
Copy link
Contributor

@viviveevee viviveevee commented Jan 5, 2026

Description

Try not running out of instructions during commit_batch, compute_mvidence, and compute_state_hash using self-calls

How Has This Been Tested?

Mostly manually. e2e covers a lot of base functionality, but not big projects that may hit some limits.
Manual tests performed:

  • deploy portal with dfx 0.29.2, upgrade over it with this version
  • deploy portal with this version, do an edit and redeploy
  • deploy a toy project with an asset that's 700MB large. Debug output: commit_batch completed: counter 0: 19221556022, counter 1: 54288949009 (19b and 54b instructions for performance_counter(0) and (1)

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@viviveevee viviveevee marked this pull request as ready for review January 6, 2026 14:34
@viviveevee viviveevee requested a review from a team as a code owner January 6, 2026 14:34
Copy link
Contributor

@adamspofford-dfinity adamspofford-dfinity left a comment

Choose a reason for hiding this comment

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

LGTM with note

F: FnMut(P) -> ComputationStatus<D, P, E>,
P: Default,
{
const INSTRUCTION_THRESHOLD: u64 = 35_000_000_000; // At the time of writing, 40b instructions are the limit for single message
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this limit low enough? The worst single hashing operation I saw was 3b instructions (press-kit.zip).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fine as we now hash a single chunk at a time (limited by the ingress message size) and no longer an entire file. From what I measured a single chunk should not take more than ~2MB*80 instructions

I also tested this with a 700MB file, which took ~50b instructions to hash

@viviveevee viviveevee enabled auto-merge (squash) January 6, 2026 16:29
@viviveevee viviveevee merged commit 4ecdeb7 into master Jan 6, 2026
133 checks passed
@viviveevee viviveevee deleted the vivee/incremental-commit branch January 6, 2026 17:08
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.

2 participants