diff --git a/evm/src/cpu/gas.rs b/evm/src/cpu/gas.rs index ae923fde6b..694fb0f47e 100644 --- a/evm/src/cpu/gas.rs +++ b/evm/src/cpu/gas.rs @@ -70,6 +70,10 @@ fn eval_packed_accumulate( }) .sum(); + // TODO: This may cause soundness issue if the recomputed gas (as u64) overflows the field size. + // This is fine as we are only using two-limbs for testing purposes (to support all cases from + // the Ethereum test suite). + // This should be changed back to a single 32-bit limb before going into production! let gas_diff = nv.gas[1] * P::Scalar::from_canonical_u64(1 << 32) + nv.gas[0] - (lv.gas[1] * P::Scalar::from_canonical_u64(1 << 32) + lv.gas[0]); let constr = gas_diff - gas_used; @@ -157,6 +161,10 @@ fn eval_ext_circuit_accumulate, const D: usize>( }, ); + // TODO: This may cause soundness issue if the recomputed gas (as u64) overflows the field size. + // This is fine as we are only using two-limbs for testing purposes (to support all cases from + // the Ethereum test suite). + // This should be changed back to a single 32-bit limb before going into production! let nv_gas = builder.mul_const_add_extension(F::from_canonical_u64(1 << 32), nv.gas[1], nv.gas[0]); let lv_gas = diff --git a/evm/src/proof.rs b/evm/src/proof.rs index d63ddc8914..fd6c4f3e9a 100644 --- a/evm/src/proof.rs +++ b/evm/src/proof.rs @@ -89,6 +89,10 @@ pub struct BlockHashes { pub cur_hash: H256, } +// TODO: Before going into production, `block_gas_used` and `block_gaslimit` here +// as well as `gas_used_before` / `gas_used_after` in `ExtraBlockData` should be +// updated to fit in a single 32-bit limb, as supporting 64-bit values for those +// fields is only necessary for testing purposes. /// Metadata contained in a block header. Those are identical between /// all state transition proofs within the same block. #[derive(Debug, Clone, Default, Deserialize, Serialize)]