feat: fetch note asset and fee asset witnesses before transaction execution#2113
Merged
PhilippGackstatter merged 12 commits intonextfrom Dec 1, 2025
Merged
feat: fetch note asset and fee asset witnesses before transaction execution#2113PhilippGackstatter merged 12 commits intonextfrom
PhilippGackstatter merged 12 commits intonextfrom
Conversation
bobbinth
approved these changes
Nov 30, 2025
Contributor
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you! I left just a couple of small comments/questions inline.
igamigo
approved these changes
Nov 30, 2025
Collaborator
igamigo
left a comment
There was a problem hiding this comment.
Left a couple comments/questions on the implementation (one involving a potential different design), but looks good to me!
bobbinth
approved these changes
Dec 1, 2025
Contributor
bobbinth
left a comment
There was a problem hiding this comment.
All looks good! Thank you!
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.
Removes the temporary code for lazy loading note asset witnesses during the prologue and instead pre-fetches them from the
DataStore.This means changing the
DataStore::get_transaction_inputsto take a set ofAssetVaultKeys and returning a set ofAssetWitnesses. The data store is expected to also return an asset witness for the fee asset, since it will also be needed unconditionally, and it does not have to be loaded inTransactionExecutorHost::on_before_tx_fee_removed_from_accountanymore.The asset witnesses are stored in
TransactionInputs, though other options exist, like returning(TransactionInputs, Vec<AssetWitness>)fromTransactionExecutor::prepare_tx_inputs. This option is a bit nicer, but adds more duplicate data inTransactionInputs, since the asset witnesses will be contained inAdviceInputsat the end of the transaction.TransactionContext::execute_codedid not call into theDataStoreso far, and so the asset witnesses were never fetched, causing test failures. This was changed to also callDataStore::get_transaction_inputsto load the witnesses. I'm hoping this could be done more nicely when splitting theTransactionContextBuilderinto two APIs as mentioned underInternal API Changesin #1919.closes #1852