Skip to content
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

Add new tx specific GTFArgs and make new generic GTFArgs to replace duplication #882

Merged
merged 10 commits into from
Feb 13, 2025

Conversation

AurelienFT
Copy link
Contributor

@AurelienFT AurelienFT commented Dec 10, 2024

#812

Add new transactions specific GTFArgs, creates new GTFArgs to deprecate duplicated one between Script and Create and make them generic for all transactions implementing ExecutableTransaction.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • If performance characteristic of an instruction change, update gas costs as well or make a follow-up PR for that
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself
  • I have created follow-up issues caused by this PR and linked them here

After merging, notify other teams

[Add or remove entries as needed]

@AurelienFT AurelienFT changed the title Add new GTF args for all transactions type and deprecated specific ol… Add new tx specific GTFArgs and make new generic GTFArgs to replace duplication Dec 10, 2024
@AurelienFT AurelienFT marked this pull request as ready for review January 31, 2025 10:54
@AurelienFT AurelienFT self-assigned this Jan 31, 2025
@AurelienFT AurelienFT requested a review from a team January 31, 2025 10:55
Comment on lines -554 to -565
// Maybe use predicates to check create context?
// TODO GTFArgs::CreateBytecodeLength
// TODO GTFArgs::CreateBytecodeWitnessIndex
// TODO GTFArgs::CreateStorageSlotsCount
// TODO GTFArgs::CreateSalt
// TODO GTFArgs::CreateStorageSlotAtIndex
// TODO GTFArgs::OutputContractCreatedContractId
// TODO GTFArgs::OutputContractCreatedStateRoot

// blocked by https://github.com/FuelLabs/fuel-vm/issues/59
// TODO GTFArgs::InputCoinTxPointer
// TODO GTFArgs::InputContractTxPointer
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we remove these todos?=D

Copy link
Contributor Author

@AurelienFT AurelienFT Feb 6, 2025

Choose a reason for hiding this comment

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

Because I added all the tests to tests them all in the PR héhé (it was loooong)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see where we test CreateBytecodeLength, CreateBytecodeWitnessIndex, CreateSalt, CreateStorageSlotAtIndex, OutputContractCreatedContractId, OutputContractCreatedStateRoot, InputCoinTxPointer, InputContractTxPointer GTF opcodes. Could you point to corresponding tests please?

Copy link
Contributor Author

@AurelienFT AurelienFT Feb 12, 2025

Choose a reason for hiding this comment

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

It starts here :

fn get__create_specific_transaction_fields__success() {
and there is a test for each transaction type with their specific gtf.

Side node : InputContractTxPointer and InputCoinTxPointer do not exist anymore.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My bad, search in browser was not working=( Thank you!

@@ -33,3 +38,19 @@ impl From<&Transaction> for TransactionRepr {
}
}
}

impl TryFrom<Word> for TransactionRepr {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see where do we use it. Could you point please?=)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's used here :

<Tx as ExecutableTransaction>::transaction_type().try_into()?;

Which is a internal type that allow more clean matching for tx specific GTF here :
match (tx_type, specific_args) {

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, I see. I think we don't need to put unreachable use cases(InvalidTransactionType) into a panic reason. I think we should use Bug in the case if Mint transaction presents in VM, but it is not possible right now, because it doesn't implement ExecutableTransaction trait .

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'm not sure I understand, I do nothing for now and open an issue ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Removed in a01e2a9

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okey ty

@AurelienFT AurelienFT requested a review from xgreenx February 6, 2025 23:36
@AurelienFT AurelienFT requested a review from rymnc February 12, 2025 21:18
@AurelienFT AurelienFT added this pull request to the merge queue Feb 13, 2025
Merged via the queue into master with commit a340921 Feb 13, 2025
40 checks passed
@AurelienFT AurelienFT deleted the new_global_gtf branch February 13, 2025 09:00
@Dentosal Dentosal mentioned this pull request Feb 26, 2025
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