Zero CELO gas balance is reported as a contract revert: "gas required exceeds allowance (0)"
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 50/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript
- 领域
- cli
调研方向
从 celocli multisig:approve 命令开始,使用没有 CELO 的已授权发送方重现该失败,然后检查 gas 估算错误在到达 CLI 之前是如何被包装的。完成的标准是 CLI 能识别 gas 资金不足,而不是报告合约 revert,并在可能的情况下保留嵌套错误以便调试。
由索引模型根据 Issue 内容生成。
描述
Package
@celo/celocli9.0.1viem2.55.11 (dependency bundled by celocli)
Environment
- Celo Mainnet via
https://forno.celo.org - macOS on Apple Silicon
- Ledger signer (the issue appears to be independent of the signer type)
Command
celocli multisig:approve \
--for <multisig> \
--tx <transaction-id> \
--from <owner-with-zero-CELO-balance> \
--useLedger \
--node https://forno.celo.org
Describe the bug
When the sending account has a zero native CELO balance and therefore cannot pay gas, celocli reports the gas-estimation failure as a contract execution revert:
Sending Transaction: multisig: approving transaction ... failed:
Execution reverted with reason: gas required exceeds allowance (0).
ContractFunctionExecutionError: Execution reverted with reason:
gas required exceeds allowance (0).
This is misleading because the contract call itself does not revert. The account simply has no CELO with which to pay transaction fees.
In the observed case:
- the sender's native CELO balance was exactly
0; - all celocli multisig checks passed;
confirmations(transactionId, sender)remainedfalse, confirming that nothing was submitted;- a read-only trace of the same
confirmTransactioncall succeeded; - the trace estimated approximately 211,260 gas;
- funding the sender is the required remedy.
The message led us to investigate the multisig transaction and contract logic, even though neither was the source of the failure.
Expected behavior
celocli should identify this as an insufficient gas-funds error and provide an actionable message, for example:
The sender does not have enough CELO to pay transaction fees.
Sender balance: 0 CELO.
Fund the sender or select a supported --gasCurrency with sufficient balance.
It should not describe this condition as an execution revert.
Actual behavior
The underlying RPC text:
gas required exceeds allowance (0)
is wrapped as EstimateGasExecutionError, ExecutionRevertedError, TransactionExecutionError, and finally ContractFunctionExecutionError, resulting in the incorrect user-facing statement that contract execution reverted.
Suggested fix
Before sending or estimating a transaction, celocli could:
- retrieve the sender's native balance (or selected gas-currency balance);
- compare it with the estimated/upfront fee requirement where possible; and
- fail with a dedicated insufficient-gas-funds message.
Alternatively, the transaction error handler could recognize node errors matching gas required exceeds allowance (<amount>) during gas estimation and translate them into an insufficient-funds error rather than an execution revert.
The exact string may originate from the RPC client and the incorrect classification may occur in viem, but celocli should still present an actionable CLI error. Preserving the original nested error for debugging would be useful.
Reproduction outline
- Use an account that is authorized to perform a transaction but has
0CELO. - Run a celocli write command using that account as
--from. - Observe
Execution reverted with reason: gas required exceeds allowance (0)during gas estimation. - Simulate/trace the contract call independently and observe that it succeeds.
- Fund the sender with enough CELO for gas and retry.
- 主要语言
- TypeScript
- 星标
- 43
- 派生
- 36
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
celo-org/developer-tooling 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
celo-org/developer-tooling#793 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
celo-org/developer-tooling#786 ·
-
难度 3/5 1-2 天 新手友好度 55/100
celo-org/developer-tooling#800 · 1 条评论 ·
-
Bridge commands duplicate signer construction and miss new signer types可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 68/100
celo-org/developer-tooling#794 ·
-
--ledgerLiveMode iterates the BIP-44 change index instead of the hardened account index可能已有人在做 @Steve0x2a 于 48 天前认领。 未关闭bug celocli
难度 3/5 1-2 天 新手友好度 78/100
celo-org/developer-tooling#789 ·
查看 celo-org/developer-tooling 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
openremote/openremote#3487 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
coollabsio/jean#867 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
ehmpathy/rhachet-roles-bhuild#616 ·
维护者通常 1 天内回复
-
📘 Docs supabase/cli
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
bug(cli): theme file home-directory check uses startsWith (sibling dirs pass, Windows casing fails)未关闭area/core kind/bug priority/p2 status/bot-triaged
难度 2/5 1-3 小时 新手友好度 79/100
google-gemini/gemini-cli#29955 · 2 条评论 ·
维护者通常 1 天内回复