Skip to content

Conversation

@Dentosal
Copy link
Member

@Dentosal Dentosal commented Oct 20, 2025

Use more accurate names for instruction constructor parameters in fuel-asm. In particular:

  • The first argument to TRO referred to contract id, when it's in fact an address
  • All cases where the register is a pointer to memory are no suffixed with _ptr (or simply called ptr). Previously there was a mix of different conventions, including _addr, _ptr suffixes or no suffix at all.

This is a non-breaking change as only names of function parameters are changed.

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

Note

Standardizes instruction constructor parameter names in fuel-asm, replacing *_addr with *_ptr (and related renames) and correcting several misnamed parameters like TRO’s recipient address.

  • fuel-asm/src/lib.rs:
    • Rename constructor parameters to consistently use pointer semantics:
      • addr -> ptr across memory, I/O, crypto, storage, and hashing ops (e.g., RETD ptr, MCL dst_ptr, MCP dst_ptr/src_ptr, MEQ lhs_ptr/rhs_ptr, LOGD ptr, LB/LW/SB/SW ptr, MCPI dst_ptr/src_ptr, MCLI ptr, BAL asset_id_ptr/contract_id_ptr).
      • Contract and transfer-related renames: TR contract_id_ptr, TRO recipient_address_ptr (was contract id), CALL asset_id_ptr, CCP/CROO/CSIZ contract_id_ptr, LDC src_ptr, SMO recipient_address_ptr/data_ptr.
      • Crypto/hash ops now use *_ptr for buffers: ECK1/ECR1/K256/S256 dst_ptr/src_ptr, ED19 pub_key_ptr/sig_ptr/msg_ptr.
      • Storage ops use key_ptr, dst_ptr, src_ptr: SCWQ/SRW/SRWQ/SWW/SWWQ.
      • Control-flow/other: JAL ret_ptr.
      • Wide-int ops adopt pointer params: WDCM/WQCM/WDOP/WQOP/WDML/WQML/WDDV/WQDV/WDMD/WQMD/WDAM/WQAM/WDMM/WQMM use dst_ptr/lhs_ptr/rhs_ptr and *_ptr for multi-operand args.
      • Elliptic-curve ops: ECOP dst_ptr.
    • Blob ops unchanged aside from existing pointer names reiterated.
  • .changes/changed/977.md: Add changelog entry describing parameter name accuracy improvements.

Written by Cursor Bugbot for commit f9665cd. This will update automatically on new commits. Configure here.

@Dentosal Dentosal self-assigned this Oct 20, 2025
@Dentosal Dentosal added the fuel-asm Related to the `fuel-asm` crate. label Oct 20, 2025
@Dentosal Dentosal marked this pull request as ready for review October 20, 2025 04:17
@cursor
Copy link

cursor bot commented Oct 20, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on November 7.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@xgreenx xgreenx enabled auto-merge November 3, 2025 15:21
@mchristopher mchristopher marked this pull request as draft November 18, 2025 18:08
auto-merge was automatically disabled November 18, 2025 18:08

Pull request was converted to draft

@mchristopher mchristopher marked this pull request as ready for review November 18, 2025 18:08
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 7

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@Dentosal Dentosal added this pull request to the merge queue Nov 27, 2025
Merged via the queue into master with commit be5819a Nov 27, 2025
82 of 83 checks passed
@Dentosal Dentosal deleted the dento/improve-instruction-argument-names branch November 27, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fuel-asm Related to the `fuel-asm` crate.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants