refactor(pxe): hash oracle registry instead of Oracle class#23907
Merged
Conversation
nchamo
commented
Jun 5, 2026
| @@ -1,55 +0,0 @@ | |||
| import { mkdtempSync, rmSync, writeFileSync } from 'fs'; | |||
Contributor
Author
There was a problem hiding this comment.
This was just moved to another file
…amo/pxe-oracle-hash-calc
vezenovm
approved these changes
Jun 5, 2026
| * changes, not just oracle additions and removals. | ||
| * | ||
| * Type expressions are captured as their source text (e.g. `OPTION(AZTEC_ADDRESS)`, `BOUNDED_VEC(NOTE)`), so the | ||
| * signature tracks the composition of types. A change to how a leaf `TypeMapping` serializes without renaming it is |
Contributor
There was a problem hiding this comment.
I'm not sure what this last sentence means, can you elaborate? Is this referencing a possible extension that doesn't exist here?
Contributor
Author
There was a problem hiding this comment.
I rewrote it as:
* Type expressions are captured as their source text (e.g. `OPTION(AZTEC_ADDRESS)`, `BOUNDED_VEC(NOTE)`), so the
* signature tracks the composition of types. However, if the internal serialization logic of a `TypeMapping` constant
* (e.g. `FIELD`) changes without the constant being renamed, the hash will not change.
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.
Summary
ORACLE_INTERFACE_HASH) is now computed by AST-parsing theORACLE_REGISTRYdeclaration instead of theOracleclass. The old approach only captured oracle names (every method shared the same erasedACVMFieldsignature), so changes to parameter types, parameter names, or return types went undetected. The registry-based hash is sensitive to all of these.getOracleRegistrySignatureto parse registry entries, capturing each oracle'smakeEntryparams and return type as source text. Spread elements (used byTXE_ORACLE_REGISTRY) are explicitly rejected for now.oracle_version_helpers.test.tsto match the module it tests.