-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Account on-chain tracking #485
Conversation
7a4a711
to
dabbbc8
Compare
miden-tx/src/prover/mod.rs
Outdated
let builder = match on_chain_account { | ||
true => { | ||
let account_details = if tx_witness.account().is_new() { | ||
AccountDetails::Full(tx_witness.account().clone()) | ||
} else { | ||
AccountDetails::Delta(account_delta) | ||
}; | ||
|
||
builder.account_details(account_details) | ||
}, | ||
tx_outputs.account.hash(), | ||
input_notes, | ||
tx_outputs.output_notes.into(), | ||
tx_script_root, | ||
block_hash, | ||
proof, | ||
)) | ||
false => builder, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not particularly fond of this API. But as the things are currently set, this seems to be the best place to have it.
An alternative would be to decouple the ProvenTransaction
from the account/note state. But at the same time I don't think that would be worth the effort.
dabbbc8
to
bdb7b8e
Compare
@bobbinth ping. In case you missed this PR :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good. I left some comments inline.
Looking into how to determine which notes should be tracked
One option could be to modify TransactionProver::prove_transaction()
method to take a vector of notes as an extra parameter (i.e., it would be Vec<Note>
).
Another option is to modify TransactionWitness
to add something like expected_output_notes
field to it. I think this might be cleaner - but I haven't considered all pros/cons.
bdb7b8e
to
e1c6e32
Compare
In the issue it was describe this should be determined by the MASM code. Any reason to change that? |
e1c6e32
to
1fbafe9
Compare
closing/reopening to trigger the ci |
afa034e
to
e9623b4
Compare
Note: I changed a few tests from using an ON_CHAIN account type to an OFF_CHAIN account type, because this PR does not implement the delta yet. |
e9623b4
to
41aa4ce
Compare
@bobbinth ping, the PR is ready for another review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good! I left a few more comments inline - but pretty much all are minor.
Also, could you create an issue mentioned in #485 (comment)?
Oh - and let's also update the changelog. |
decfbbb
to
9010e7b
Compare
9010e7b
to
fa535cb
Compare
fa535cb
to
8c6fefc
Compare
added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you! I left a couple of small comments inline. After these, let's merge.
30cdf8c
to
68b0afb
Compare
Built on top of: #481
This PR does:
ProvenTransaction
sAdd a flag so that the transaction prover will track the account detailsUse the on-chain flag from the account idWill come on follow-ups: