-
Notifications
You must be signed in to change notification settings - Fork 115
Description
Discussed in 0xMiden/node#1490
TransactionInputs::asset_witnesses only contains prefetched asset witnesses (note assets + fee asset).
On re-execution, AFAICT, dynamic calls to DataStore::get_vault_asset_witnesses() are skipped because the Merkle paths are already in advice data, but prefetched witnesses are still fetched every time, so DataStore implementors .
This introduces an inconsistent, under-documented behavior and forces validator implementations to special-case prefetched assets.
Keeping this in mind, we could remove TransactionInputs::asset_witnesses in favor of adding the witnesses directly in TransactionInputs::with_asset_witnesses as suggested here 0xMiden/node#1490 (comment) and consider skipping prefetch on re-execution by checking advice inputs before fetching.