Support EVMC_PARIS with randao from merge block

This commit is contained in:
Alex Beregszaszi 2022-09-16 13:04:12 +02:00
parent 5df92a374b
commit b49008af9e

View File

@ -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};