feat: expose gas overrides for intelligent contract transactions - #215
Open
MuncleUscles wants to merge 1 commit into
Open
feat: expose gas overrides for intelligent contract transactions#215MuncleUscles wants to merge 1 commit into
MuncleUscles wants to merge 1 commit into
Conversation
Unify writeContract and deployContract with sendTransaction's gas option, preserve estimation headroom by default, and stop before broadcast when estimation fails.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
gas?: biginttowriteContractanddeployContract.gasis omitted.ConsensusMain.addTransactioncall and is separate from GenLayerfees.Why
Large intelligent-contract deployment calldata can require more intrinsic EVM gas than the old 200,000 fallback. When estimation reverts, callers currently cannot supply the correct outer transaction limit, so the fallback can be rejected with
intrinsic gas too lowbefore GenLayer receives a deployment.This unifies the intelligent-contract actions with viem's existing top-level
sendTransaction({ gas })convention. It does not change GenLayer consensus/execution budgets or protocol fee accounting.This is an organization-owned replacement for #205 and credits @ygd58 for the original gas-override proposal and test approach.
Testing done
npm test -- --run— 130 tests passed; no type errors.npm run build— ESM, CJS, and declaration builds passed.npx eslint . --ext .ts— passed.Decisions made
gasrather than introducing a GenLayer-specific name.Risk and rollback
The behavioral change is limited to intelligent-contract writes/deployments whose gas estimation fails: they now fail early instead of broadcasting with 200,000. Reverting this commit restores the previous fallback.
Checks
Reviewing tips
Start with
_sendTransactioninsrc/contracts/actions.ts, then review the public types and the focused tests.User facing release notes
writeContractanddeployContractnow accept an optional top-levelgaslimit for the outer EVM transaction. This is separate from GenLayerfees. If estimation fails and no limit is supplied, the SDK stops before broadcast with a clear error.