Skip to content

Commit

Permalink
Support EVMC_PARIS with randao from merge block
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Nov 9, 2022
1 parent 5df92a3 commit b49008a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/EVMHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,15 @@ EVMHost::EVMHost(langutil::EVMVersion _evmVersion, evmc::VM& _vm):
m_evmRevision = EVMC_BERLIN;
else if (_evmVersion == langutil::EVMVersion::london())
m_evmRevision = EVMC_LONDON;
// TODO: support EVMVersion::paris()
else
assertThrow(false, Exception, "Unsupported EVM version");

tx_context.block_prev_randao = evmc::uint256be{200000000}; // TODO: should make it >2**64 for >Paris
if (m_evmRevision >= EVMC_PARIS)
// This is the value from the merge block.
tx_context.block_prev_randao = 0xa86c2e601b6c44eb4848f7d23d9df3113fbcac42041c49cbed5000cb4f118777_bytes32;
else
tx_context.block_prev_randao = evmc::uint256be{200000000};
tx_context.block_gas_limit = 20000000;
tx_context.block_coinbase = 0x7878787878787878787878787878787878787878_address;
tx_context.tx_gas_price = evmc::uint256be{3000000000};
Expand Down

0 comments on commit b49008a

Please sign in to comment.