-
Notifications
You must be signed in to change notification settings - Fork 42
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
Rework procedure authentication #934
Comments
If I understood correctly, we have some incorrect behavior when native and foreign accounts have different interfaces (i.e., expose a different set of procedures). I think the issue may be related to how we build Assuming this is the issue, the fix should be to make the cc @igamigo as this will also be relevant to how the client provides this info during transaction execution. |
I think I'm a bit confused. Originally when testing on the client as I hit this issue the problem was as follows:
EDIT: I force pushed to my branch and erased commit history. Hopefully the scenarios are understood without looking at the code but otherwise feel free to let me know and we can repro it. I think this might have the same root cause (not familiar with |
My hunch is that this is all due to the issue I described above - just different manifestations of it, and the errors seems to be consistent with it. The question though is how to fix it. One option (which I mentioned above), is to modify pub struct TransactionArgs {
tx_script: Option<TransactionScript>,
foreign_accounts: Vec<AccountHeader>,
note_args: BTreeMap<NoteId, Word>,
advice_inputs: AdviceInputs,
} Or if we wanted to keep extra data to the minimum, we could just track foreign account code commitments - but I'm not sure it is worth it. Then, in the transaction host we'd build the correct map for all accounts and things should work (hopefully). On the client side, we'd just need to add headers (which I think we already have anyway) to the args and things should work there too. |
One other option is to introduce a pub struct ForeignAccountHeader {
account: AccountHeader,
storage: AccountStorageHeader,
code: AccountCodeHeader,
} Where pub struct AccountCodeHeader {
commitment: Digest,
procedures: Vec<AccountProcedureInfo>,
} Then, pub struct TransactionArgs {
tx_script: Option<TransactionScript>,
foreign_accounts: Vec<ForeignAccountHeader>,
note_args: BTreeMap<NoteId, Word>,
advice_inputs: AdviceInputs,
} This would mean that the client would just need to populate I think one remaining question is how we actually get account code loaded into the |
Closed by #940. |
Packages versions
miden-base: 0.5.0
branch: next
Bug description
The problem appeared during the testing of Foreign Procedure Invocation.
Context:
The native account have some "foreign" procedures, which could be used to get some information from the foreign account. Foreign account, on the other hand, potentially could have no procedures at all.Edit: my understanding of how FPI works was not correct. The foreign procedure is a part of the foreign account, so during the invocation of
execute_foreign_procedure
we pass there the hash of the procedure in the foreign account, not native.To make a successful call to the foreign account it should be provided to the merkle store (and then later will be loaded to the memory).
The bug occurs on the stage of the procedure authentication (here).
The
authenticate_procedure
procedure works like thisWhat goes wrong
How can this be reproduced?
Call the foreign procedure which is provided in the native account against the foreign account where this procedure is not provided.
Relevant log output
The text was updated successfully, but these errors were encountered: