refactor(stdlib): consolidate find-function-by-selector helpers#23008
Open
dbanks12 wants to merge 1 commit intodb/fastforward-contract-updatefrom
Open
refactor(stdlib): consolidate find-function-by-selector helpers#23008dbanks12 wants to merge 1 commit intodb/fastforward-contract-updatefrom
dbanks12 wants to merge 1 commit intodb/fastforward-contract-updatefrom
Conversation
ee7d882 to
fca916d
Compare
4620c69 to
544c520
Compare
fca916d to
0b5052d
Compare
544c520 to
bd45d90
Compare
This was referenced May 7, 2026
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bd45d90 to
761b425
Compare
0b5052d to
50fe709
Compare
761b425 to
dc6a7b5
Compare
50fe709 to
cf63e74
Compare
dc6a7b5 to
ee3005d
Compare
cf63e74 to
721ca99
Compare
ee3005d to
52a8355
Compare
52a8355 to
875d840
Compare
721ca99 to
7b2bf7e
Compare
2 tasks
7b2bf7e to
f752939
Compare
952c942 to
9ea80fe
Compare
f752939 to
5eab42b
Compare
9ea80fe to
d93eec1
Compare
5eab42b to
bad11ee
Compare
d93eec1 to
7cdc4d6
Compare
6ee0009 to
bc31ce0
Compare
61dc935 to
48179ec
Compare
1f320fd to
c05adb8
Compare
48179ec to
7f6ff8d
Compare
c05adb8 to
e7a14dc
Compare
7f6ff8d to
9204319
Compare
The same artifact lookup loop was duplicated three times — as ContractStore's private #findFunctionArtifactBySelector and #findFunctionAbiBySelector, and as a local helper inside ProxiedContractStoreFactory. Hoist the two variants into stdlib/abi as findFunctionArtifactBySelector and findFunctionAbiBySelector so both ContractStore and the proxied store call the same primitive. Also have the existing throwing getFunctionArtifact helper reuse findFunctionArtifactBySelector for its selector branch.
e7a14dc to
aef8c87
Compare
9204319 to
191de66
Compare
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
Addresses comment #22957 (comment)
The same artifact-lookup loop was duplicated three times. Puts two helper fns in
stdlib/abi:findFunctionArtifactBySelector(artifact, selector)— searchesartifact.functions, returnsFunctionArtifact | undefined.findFunctionAbiBySelector(artifact, selector)— searchesartifact.functions ∪ nonDispatchPublicFunctionsviagetAllFunctionAbis, returnsFunctionAbi | undefined.Both
ContractStoreandProxiedContractStoreFactorynow call the same stdlib primitive. The existing throwinggetFunctionArtifacthelper also reusesfindFunctionArtifactBySelector.Test plan
yarn workspace @aztec/pxe test src/storage/contract_store/contract_store.test.tsyarn workspace @aztec/stdlib test src/abi/abi.test.tsyarn lint pxe,yarn lint stdlib