Skip to content

Conversation

@Farukest
Copy link
Contributor

Summary

Removes the asset_witnesses field from TransactionInputs struct.

Changes

  • Remove asset_witnesses field from TransactionInputs - witnesses are now added directly to advice_inputs via with_asset_witnesses()
  • Skip fetching witnesses that already exist in advice inputs (per @PhilippGackstatter's suggestion)
  • Update prepare_tx_inputs to return (TransactionInputs, u64) tuple
  • Update notes_checker for new signature

Closes #2261

@Farukest Farukest force-pushed the feat/remove-asset-witnesses-field branch 2 times, most recently from 950514f to 74af7e5 Compare January 14, 2026 13:18
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

I left some small comments about the structure, but directionally this looks great.

@Farukest Farukest force-pushed the feat/remove-asset-witnesses-field branch from 74af7e5 to 187297f Compare January 15, 2026 13:38
Address review feedback:
- Keep asset_witnesses field in TransactionInputs (revert removal)
- Refactor with_asset_witnesses() to use TransactionAdviceInputs::add_asset_witness()
- Restore data extractor methods (read_storage_map_witness, etc.)
- Add explicit error handling for non-fungible fee assets
- Make account_id_map_key() public in TransactionAdviceInputs

Closes 0xMiden#2261
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! I left one comment that may be difficult to address, but I hope it's clear enough. Let me know if you need help.

@Farukest Farukest force-pushed the feat/remove-asset-witnesses-field branch from 476bd07 to 4c4e5e5 Compare January 16, 2026 11:44
@Farukest
Copy link
Contributor Author

Looks good to me!

I left some small comments about the structure, but directionally this looks great.

Thank you for detailed guide. I handled all @PhilippGackstatter . needs review. let me know if anything I missed :)

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think we're pretty close now 😃

@Farukest
Copy link
Contributor Author

I think we do need the correct fee balance here. I think we just don't have a test that uses the checker with non-zero fees, but if we did, I expect we would run into TransactionExecutorError::InsufficientFee.

So, I think we should pass in the initial_fee_balance. We'd have to pass it around quite a bit here so maybe it make sense to create a small internal wrapper in crates/miden-tx/src/executor/notes_checker.rs that wraps TransactionInputs and initial_fee_balance: u64, wdyt?

@PhilippGackstatter now all must be okay. still I'm ready to change if you need anything else 😅

@Farukest Farukest force-pushed the feat/remove-asset-witnesses-field branch from fd1087a to 8a79662 Compare January 16, 2026 14:47
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for your work, and apologies for the back and forth. There's one issue that's causing the test failures - left a comment.

Comment on lines 434 to 436
// Copy the tx_args advice inputs to self.advice_inputs first, so that any data
// from a previous execution (e.g., during re-execution) is preserved.
self.advice_inputs.extend(tx_args.advice_inputs().clone());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure why, but this line cause the test failures, e.g. in test_nested_fpi_native_account_invocation. Let's revert this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for your work, and apologies for the back and forth. There's one issue that's causing the test failures - left a comment.

No problem at all. I like work for Miden fun and educational :)
will handle now

Comment on lines 54 to 55
/// Pre-fetched asset witnesses for note assets and the fee asset.
asset_witnesses: Vec<AssetWitness>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't one of the objects to remove the asset_witnesses fields from TransactionInputs?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created #2298 as an alternative.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what should I do now @bobbinth .. wait ? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get some feedback from @PhilippGackstatter. Depending on that, we can decide which approach to take.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these PRs are mostly doing the same now, but #2298 handles the initial fee balance in a less intrusive way and avoids the need for PreparedTransactionInputs, so I think that's the better way to go.
Thank you for providing a basis to work from @Farukest!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these PRs are mostly doing the same now, but #2298 handles the initial fee balance in a less intrusive way and avoids the need for PreparedTransactionInputs, so I think that's the better way to go. Thank you for providing a basis to work from @Farukest!

Hi @PhilippGackstatter, @bobbinth should I close #2274 since this one is moving forward ? Also, would appreciate a co-author tag if possible. Thanks in advance :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll close this now. Thank you for your help on this! I added the co-author tag - hopefully, it worked as intended.

@bobbinth
Copy link
Contributor

Superseded by #2298.

@bobbinth bobbinth closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove TransactionInputs::asset_witnesses

3 participants