fix: raise DEFAULT_GAS_LIMIT to 1M for Tempo AA transactions#90
fix: raise DEFAULT_GAS_LIMIT to 1M for Tempo AA transactions#90brendanjryan merged 2 commits intomainfrom
Conversation
Tempo type-0x76 (AA) transactions have ~270k intrinsic gas for a single TIP-20 transfer, well above the previous 100k default. The legacy-style eth_estimateGas call doesn't send the full AA envelope, so the estimate always failed and silently fell back to the 100k hardcode — causing 'Insufficient gas for AA transaction' errors on settlement. Bump the static limit to 1M, matching the approach used by mpp-rs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 836b431aca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Tempo AA (type-0x76) transactions have higher intrinsic gas than legacy txs | ||
| # (~270k for a single TIP-20 transfer). A safe static limit avoids the need for | ||
| # AA-aware eth_estimateGas calls, matching the approach used by mpp-rs. | ||
| DEFAULT_GAS_LIMIT = 1_000_000 |
There was a problem hiding this comment.
Use 1M gas only as the estimation fallback
Because _build_tempo_transfer() later does gas_limit = max(DEFAULT_GAS_LIMIT, estimated + 5_000), raising DEFAULT_GAS_LIMIT to 1_000_000 makes every Tempo transaction carry a 1M cap, even when eth_estimateGas succeeds with a much smaller AA cost (~270k). For self-paid transfers (fee_token=currency) and fee-payer flows alike, Tempo validates balances against gas_limit * max_fee_per_gas before execution, so accounts that can afford the real gas but not a 1M reserve will now fail with insufficient-funds errors. The larger number should be kept as the fallback when estimation fails, not as the floor for all transactions.
Useful? React with 👍 / 👎.
Problem
Payment settlement failing with the following in some mainnet transactions:
Cause
Tempo type-0x76 (AA) transactions have ~270k intrinsic gas for a single TIP-20 transfer. The legacy-style
eth_estimateGascall doesn't send the full AA envelope (calls,feeToken,nonceKey, etc.), so estimation always fails and silently falls back to the hardcodedDEFAULT_GAS_LIMIT = 100_000— which is below intrinsic gas.Fix
Bump
DEFAULT_GAS_LIMITfrom100_000to1_000_000, matching the approach used by mpp-rs.