Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Wrong gas estimates for encrypted ParaTime transfers

未关闭
#248 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
go
领域
blockchain, cli

调研方向

首先使用 --encrypted 重现从 secp256k1 账户发起的加密 ParaTime 转账,先不使用 --gas-limit,然后使用报告的限制值。跟踪加密转账的 gas 估算路径,并将其与标准 ParaTime 转账进行比较;当估算值足够且交易无需手动增加限制即可成功执行时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

bug

Trying to transfer tokens from the secp256k1 account on Sapphire and providing --encrypted incorrectly estimates gas:

  1. first attempt (no --gas-limit provided):
Broadcasting transaction...
Error: Transaction check failed with error: module: core code: 12 message: out of gas (limit: 2318 wanted: 11388)
  1. second attempt --gas-limit 11388:
Broadcasting transaction...
Error: Transaction check failed with error: module: core code: 12 message: out of gas (limit: 11388 wanted: 11389)
  1. third attempt --gas-limit 11389:
Broadcasting transaction...
Error: Transaction check failed with error: module: core code: 12 message: out of gas (limit: 11389 wanted: 11390)
  1. fourth attempt --gas-limit 11390:
Broadcasting transaction...
Transaction included in block successfully.
Round:            3995161
Transaction hash: 1dc1246a30e854dede27d48cb1220b4c19d46521ade38622bbda3ea8c2a4e738
                  (Transaction result is encrypted.)
Error: Execution failed with error: module: core code: 12 message: core: out of gas (limit: 11390 wanted: 12389)

^^ the transaction was actually submitted and gas was spent, see: https://explorer.oasis.io/mainnet/sapphire/tx/1dc1246a30e854dede27d48cb1220b4c19d46521ade38622bbda3ea8c2a4e738

  1. fifth attempt --gas-limit 12389 finally worked:
Broadcasting transaction...
Transaction included in block successfully.
Round:            3995186
Transaction hash: 7224d59e6b74d9b2caf55ab40dfe0757cef4f71c66d3a7aba3de1d267d2ea409
                  (Transaction result is encrypted.)
Execution successful.

Since gas estimates are standard for transactions such as ParaTime transfers and withdrawals, we could probably just hardcode those?

主要语言
Go
星标
80
派生
23
平均合并
8 小时 59 分钟
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

oasisprotocol/cli 的其他 Issue

查看 oasisprotocol/cli 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。