Skip to content

feat: add --gas to contract deploy and write - #413

Open
MuncleUscles wants to merge 1 commit into
v0.40-devfrom
feat/unified-transaction-gas
Open

feat: add --gas to contract deploy and write#413
MuncleUscles wants to merge 1 commit into
v0.40-devfrom
feat/unified-transaction-gas

Conversation

@MuncleUscles

Copy link
Copy Markdown
Member

Delivery context

Depends-On: genlayerlabs/genlayer-js#215

Problem and outcome

Contract deploy/write commands expose GenLayer fee controls but previously offered no way to set the outer EVM transaction gas limit. Large deployment calldata could therefore hit the SDK's old 200,000 fallback and fail with intrinsic gas too low before GenLayer accepted the transaction.

This PR:

  • adds --gas <units> to genlayer deploy and genlayer write;
  • accepts positive decimal or hexadecimal integer quantities;
  • forwards the parsed bigint as the SDK's top-level gas option;
  • describes it explicitly as the outer EVM limit, separate from GenLayer fee budgets;
  • pins genlayer-js commit 869ef09a0a54c2f47a5ecf59a6caa6c2d0db6208, the exact implementation in dependency PR chore: renovate updates #215;
  • updates generated deploy/write command references.

This is an organization-owned replacement for #404 and credits @ygd58 for the original CLI gas-option proposal and test approach.

Implementation and validation

  • npm test -- --run — 808 tests passed against the pinned genlayer-js commit.
  • npm run build — passed.
  • npm run docs:cli — generated and verified the deploy/write references.
  • Added parser coverage for decimal, hex, absent, zero, negative, fractional, underscore, and non-numeric values.
  • Added action and command wiring coverage for both deploy and write.

The full wallet-session suite was run at host level because those tests bind to loopback; its initial sandbox-only failures were all listen EPERM 127.0.0.1 and passed unchanged at host level.

Decisions, risks, and rollback

  • --gas remains a sibling of --fees, not a field inside it: the former controls the outer EVM envelope while the latter controls GenLayer budgets.
  • The CLI does not invent a fallback or recommend a network-wide magic number; omission delegates to SDK estimation/headroom.
  • The dependency is pinned to the exact reviewed JS commit, so the CLI cannot silently ship this flag against an older runtime.
  • Reverting this commit removes the flag and restores the previous dependency pin.

Expose --gas for deploy and write, keep it separate from GenLayer fee budgets, and pin the genlayer-js commit that provides the corresponding SDK runtime support.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e9f07f20-13a9-41e1-b087-f52433f05036

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MuncleUscles MuncleUscles self-assigned this Aug 31, 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.

1 participant