Split aux tables based on size#504
Open
robknight wants to merge 3 commits into
Open
Conversation
ax0
approved these changes
May 15, 2026
Collaborator
|
If I understand this correctly, the saving comes from replacing:
I wonder if we can apply this change for all cases, and we can move back to a single table. |
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 aux table holds supporting data for certain operations, including Merkle container and state transition ops, SignedBy, PublicKeyOf, and custom predicate operations. It has a fixed row size, based on the largest possible value. Most aux table entries are quite small -
MerkleTreeStateTransitionClaimTargetis 18 field elements, and all others are smaller. However,CustomPredicateVerifyQueryTargetis 314 field elements. Because of this outlier, the table rows are much larger than is needed for typical cases, making lookups more expensive than they need to be.This change splits
CustomPredicateVerifyQueryTargetout:custom_pred_verify_hashes) stores just the query hash for eachCustomPredVerifyentry, indexed by the sameaux_index.verify_custom_circuitlooks up the stored hash and compares it to a freshly-computed hash of(statement, op_type, op_args), instead of unhashing a wide row and doing flattened equality.Both tables are identical in length (every push to one is paired with a
Nonepadding push to the other), enforced via helpers on a newOperationAuxTablesstruct.This reduces measured gate count by 3445.