Skip to content

Conversation

@MitchTurner
Copy link
Member

@MitchTurner MitchTurner commented May 19, 2025

Part of #955

(followup to #948)

This PR is tackling the bulk of the new "multi-input predicate" model, where a predicate coin will point to a "static witness" on the transaction rather than having the code directly on the input. This allows multiple inputs to share the same predicate and predicate data bytes as well as share the same execution, i.e. if two inputs point at the same predicate and predicate data, that predicate will only be run once!

This will enable in a vast improvement in performance for predicates that need to iterate over all the inputs, moving from O(N^2) to O(N) in those specific cases. We needed to move this to the new ChargeableTransationV2 to avoid old predicates from being abused by the new feature.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests

@MitchTurner MitchTurner changed the base branch from master to feature/v2-chargeable-tx May 19, 2025 16:27
@MitchTurner MitchTurner changed the title Feature/v2 chargeable tx coin V2 Coins with static witness predicates May 22, 2025
@MitchTurner MitchTurner force-pushed the feature/v2-chargeable-tx-coin branch from d046b44 to fd4a8dc Compare May 23, 2025 22:49
@MitchTurner MitchTurner marked this pull request as ready for review May 28, 2025 20:53
// Given
let tx_pointer = fuel_tx_0_59_1::TxPointer::new(1u32.into(), idx);
let expected = latest_fuel_tx::TxPointer::new(1u32.into(), idx.into());
let expected = latest_fuel_tx::TxPointer::new(1u32.into(), idx);
Copy link
Member

Choose a reason for hiding this comment

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

Removal of the .into() here breaks the code, as the type changes based on feature-flags.

#[tokio::test]
async fn script_v2__estimate_predicate__fails_if_predicate_data_not_found_in_static_witnesses()
{
todo!()
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentionally left as todo!?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. I just forgot to add this case. Thanks.

@MitchTurner MitchTurner mentioned this pull request Jun 11, 2025
2 tasks
@Dentosal Dentosal self-requested a review September 29, 2025 13:32
Copy link
Member

@Dentosal Dentosal left a comment

Choose a reason for hiding this comment

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

The above-mentioned test is still todo!()

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.

3 participants