Skip to content

fix: update private kernel reset hints builder#20760

Merged
LeilaWang merged 1 commit intonextfrom
lw/reset_hints_builder
Feb 23, 2026
Merged

fix: update private kernel reset hints builder#20760
LeilaWang merged 1 commit intonextfrom
lw/reset_hints_builder

Conversation

@LeilaWang
Copy link
Contributor

@LeilaWang LeilaWang commented Feb 23, 2026

Update the hints building process in PrivateKernelResetPrivateInputsBuilder to match the private kernel reset circuit:

  • Do not squash a note hash if a future log is linked to it.
    • It can only be squashed when all its logs are included in the public inputs and can be squashed together.
  • Use the contract address to decide the type of a read request:
    • Empty contract address -> settled read request
    • Non-empty contract address -> pending read request
  • Clear read requests first when note hashes/nullifiers/private logs will overflow and there's not enough transient data to be reset.
  • Remove the assumption that the protocol/first nullifier has empty contract address.


const totalReadsToReset = numPendingReads + numSettledReads;
const minResetNeeded = numCurr + numNext - maxAmountToKeep;
if (totalReadsToReset < minResetNeeded) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Catch and throw a better error here, instead of propagating to the next round of reset or the tail.

? 'nullifiers'
: 'private logs';
throw new Error(`Number of ${overflownData} exceeds the limit.`);
if (this.nextIteration) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It used to force reset the read requests when numTransientData == 0. But it should do it when numTransientData is not big enough to clear the space for adding items in the next iteration.

.getActiveItems()
.filter(n => !n.contractAddress.isZero()).length;
const numToSilo = Math.max(0, numNullifiers - this.numTransientData);
// Include the first nullifier if there's something to silo.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is no longer needed as the first nullifier (could be the protocol nullifier) has non-empty contract address and should be treated the same as other nullifiers.

@LeilaWang LeilaWang force-pushed the lw/reset_hints_builder branch from 1945f0b to d15876c Compare February 23, 2026 12:51
Copy link
Contributor

@sirasistant sirasistant left a comment

Choose a reason for hiding this comment

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

Thanks!

@LeilaWang LeilaWang added this pull request to the merge queue Feb 23, 2026
Merged via the queue into next with commit 47837a4 Feb 23, 2026
18 checks passed
@LeilaWang LeilaWang deleted the lw/reset_hints_builder branch February 23, 2026 17:44
AztecBot pushed a commit that referenced this pull request Mar 12, 2026
Update the hints building process in PrivateKernelResetPrivateInputsBuilder to match the private kernel reset circuit:
- Do not squash a note hash if a future log is linked to it.
  - It can only be squashed when all its logs are included in the public inputs and can be squashed together.
- Use the contract address to decide the type of a read request:
  - Empty contract address -> settled read request
  - Non-empty contract address -> pending read request
- Clear read requests first when note hashes/nullifiers/private logs will overflow and there's not enough transient data to be reset.
- Remove the assumption that the protocol/first nullifier has empty contract address.
@AztecBot
Copy link
Collaborator

✅ Successfully backported to backport-to-v4-staging #21410.

ludamad added a commit that referenced this pull request Mar 12, 2026
BEGIN_COMMIT_OVERRIDE
fix: fall back to package.json for CLI version detection (#21382)
chore: Removed multiplier config (#21412)
chore: Removed default snapshot url config (#21413)
chore: Read tx filestores from network config (#21416)
feat(p2p): use l2 priority fee only for tx priority (#21420)
fix: update private kernel reset hints builder (#20760)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reset hints builder in typescript should check all its note logs were emitted before squashing a note hash.

3 participants