From 39309e0b21666b25b1fef1a89a5b8f0496d46084 Mon Sep 17 00:00:00 2001 From: Austin Chandra Date: Fri, 2 Dec 2022 05:00:46 -0800 Subject: [PATCH] chore(evm): add comment regarding RANDOM opcode (#1520) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: add random field to BlockContext using block header hash * add comment Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- x/evm/keeper/state_transition.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 3103a45cad..2179ee55fd 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -72,6 +72,11 @@ func (k *Keeper) TxConfig(ctx sdk.Context, txHash common.Hash) statedb.TxConfig // (ChainConfig and module Params). It additionally sets the validator operator address as the // coinbase address to make it available for the COINBASE opcode, even though there is no // beneficiary of the coinbase transaction (since we're not mining). +// +// NOTE: the RANDOM opcode is currently not supported since it requires +// RANDAO implementation. See https://github.com/evmos/ethermint/pull/1520#pullrequestreview-1200504697 +// for more information. + func (k *Keeper) NewEVM( ctx sdk.Context, msg core.Message, @@ -89,6 +94,7 @@ func (k *Keeper) NewEVM( Time: big.NewInt(ctx.BlockHeader().Time.Unix()), Difficulty: big.NewInt(0), // unused. Only required in PoW context BaseFee: cfg.BaseFee, + Random: nil, // not supported } txCtx := core.NewEVMTxContext(msg)