feat: Use PartialAccount in TransactionInputs#1840
Merged
Conversation
mmagician
reviewed
Sep 3, 2025
mmagician
reviewed
Sep 3, 2025
bobbinth
reviewed
Sep 3, 2025
Contributor
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you! I left a few comments inline - but they are mostly naming and code organization related.
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.
Use
PartialAccountinTransactionInputsas preparation for lazy account loading.Changes:
ExecutedTransactionno longer contains the fullAccountstate, and this creates issues forProvenTransaction(see below).LocalTransactionProverby returning the input notes when destructuring the prover host into its parts.From<ExecutedTransaction> for TxContextInput, which we can no longer support due to the above change.TransactionContext, for convenience in tests (which was previously taken fromTransactionInputs).Notes:
PartialAccountshould eventually implementSequentialCommit, but doing that is out of scope since it requires a few changes. We can update this in one go together withAccount::commitment.Since we no longer have the full account state after executing a transaction, the main question here is how we want new public accounts to be represented in
ProvenTransaction:Accountstate directly like now.AccountDeltathat, when applied to an "empty account", results in the fullAccountstate.The second option could be nicer as we reduce the number of variants of
AccountUpdateDetailsto two and it could look like this:Moreover, it would mean:
SigningInputs::TransactionSummary, for example.TxAccountUpdatecontains the account delta commitment which can be used to check that the delta contained inAccountUpdateDetails::Deltamatches that commitment. However, we can't do that forAccountUpdateDetails::New. RemovingNewwould allow validating the delta of a new account as well.We can't easily do the account delta option yet, due to missing account code tracking and other things as mentioned here. So, for now, option 1 is implemented in this PR, but I would consider it a temporary solution.
Part of #401