Compute gas with uint32
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 28/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- cpp
- 领域
- blockchain
调研方向
Start from the gas fields listed in the issue: gas_left in the interpreter and Result/TermResult, StateGas in lib/evmone/state_gas.hpp, and the evmc_message / evmc_result ABI fields. Read how the interpreter currently uses a signed subtract-and-compare-to-zero check, and TX_MAX_GAS_LIMIT in test/state/transaction.hpp. Done means a coherent uint32 (or documented ABI) plan for those counters, not a drive-by type swap.
由索引模型根据 Issue 内容生成。
描述
Every gas counter in evmone is int64_t, but all per-transaction gas quantities fit in 32 bits.
EIP-7825 caps a transaction's gas limit at TX_MAX_GAS_LIMIT = 2^24 (MAX_TX_GAS_LIMIT, test/state/transaction.hpp), and block gas limits are far below 2^32. A pending EIP-8037 change would additionally cap tx.gas itself at 2^32-1, so the whole two-dimensional budget stays inside an unsigned 32-bit integer.
Candidates:
gas_leftthreaded through the interpreter andResult/TermResultStateGas::leftandStateGas::spilled(lib/evmone/state_gas.hpp)evmc_message::gas,evmc_message::state_gasevmc_result::gas_left,gas_refund,state_gas_left,state_gas_spilled
Two things to settle first:
- The interpreter relies on gas going negative (
(gas_left -= cost) < 0). An unsigned counter needs a borrow-based check instead, e.g.__builtin_usub_overflow. - The
evmc_*fields are public ABI, so changing them is a breaking change.
- 主要语言
- C++
- 星标
- 979
- 派生
- 340
- 平均合并
- 12 小时 16 分钟
- 30 天内合并 PR
- 25
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ipsilon/evmone 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 56/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 57/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 12/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 71/100
ROCm/rocm-libraries#16108 ·
维护者通常 2 天内回复
-
asr pass bug intrinsic low priority wrong result
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
👀 needs triage enhancement
难度 2/5 1-3 小时 新手友好度 72/100
rerun-io/rerun#13021 · 1 条评论 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
audit-reference-check
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复