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 GTF getters for tx bytes size and address #556

Merged
merged 3 commits into from
Mar 8, 2024
Merged

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Mar 7, 2024

Closes #554

VM PR: FuelLabs/fuel-vm#692

@Dentosal Dentosal marked this pull request as ready for review March 7, 2024 11:57
@Dentosal Dentosal requested review from a team and luizstacio March 7, 2024 11:58
@@ -2473,6 +2473,8 @@ Get [fields from the transaction](../tx-format/transaction.md).
| `GTF_SCRIPT_INPUT_AT_INDEX` | `0x00B` | Memory address of `tx.inputs[$rB]` |
| `GTF_SCRIPT_OUTPUT_AT_INDEX` | `0x00C` | Memory address of `t.outputs[$rB]` |
| `GTF_SCRIPT_WITNESS_AT_INDEX` | `0x00D` | Memory address of `tx.witnesses[$rB]` |
| `GTF_TX_START_ADDRESS` | `0x0A0` | Memory address of the raw transaction bytes |
Copy link
Member

Choose a reason for hiding this comment

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

Should we remove the address at the end, to follow other gtfs?

@@ -2473,6 +2473,8 @@ Get [fields from the transaction](../tx-format/transaction.md).
| `GTF_SCRIPT_INPUT_AT_INDEX` | `0x00B` | Memory address of `tx.inputs[$rB]` |
| `GTF_SCRIPT_OUTPUT_AT_INDEX` | `0x00C` | Memory address of `t.outputs[$rB]` |
| `GTF_SCRIPT_WITNESS_AT_INDEX` | `0x00D` | Memory address of `tx.witnesses[$rB]` |
| `GTF_TX_START_ADDRESS` | `0x0A0` | Memory address of the raw transaction bytes |
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should consider using GM for it. Since it is not TX fields=D Just a thought

Copy link
Member Author

@Dentosal Dentosal Mar 8, 2024

Choose a reason for hiding this comment

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

Sure

@@ -2473,6 +2473,8 @@ Get [fields from the transaction](../tx-format/transaction.md).
| `GTF_SCRIPT_INPUT_AT_INDEX` | `0x00B` | Memory address of `tx.inputs[$rB]` |
| `GTF_SCRIPT_OUTPUT_AT_INDEX` | `0x00C` | Memory address of `t.outputs[$rB]` |
| `GTF_SCRIPT_WITNESS_AT_INDEX` | `0x00D` | Memory address of `tx.witnesses[$rB]` |
| `GTF_TX_START_ADDRESS` | `0x0A0` | Memory address of the raw transaction bytes |
| `GTF_TX_LENGTH` | `0x0A1` | Length of raw transaction types in memory |
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we want to put size and offset under 0x0A1 and 0x0A0? Maybe it is better to put them at the end

Copy link
Member Author

@Dentosal Dentosal Mar 8, 2024

Choose a reason for hiding this comment

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

No real reason. The location just seemed appropriate. I'll move them.

@Dentosal Dentosal requested review from xgreenx and luizstacio March 8, 2024 13:55
@Dentosal Dentosal merged commit d2ae22c into master Mar 8, 2024
6 checks passed
@Dentosal Dentosal deleted the dento/gtf-tx-bytes branch March 8, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:FVM Component: FuelVM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GTF for allowing getting raw payload of the transaction
3 participants