Skip to content

Commit b49008a

Browse files
committed
Support EVMC_PARIS with randao from merge block
1 parent 5df92a3 commit b49008a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/EVMHost.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,15 @@ EVMHost::EVMHost(langutil::EVMVersion _evmVersion, evmc::VM& _vm):
122122
m_evmRevision = EVMC_BERLIN;
123123
else if (_evmVersion == langutil::EVMVersion::london())
124124
m_evmRevision = EVMC_LONDON;
125+
// TODO: support EVMVersion::paris()
125126
else
126127
assertThrow(false, Exception, "Unsupported EVM version");
127128

128-
tx_context.block_prev_randao = evmc::uint256be{200000000}; // TODO: should make it >2**64 for >Paris
129+
if (m_evmRevision >= EVMC_PARIS)
130+
// This is the value from the merge block.
131+
tx_context.block_prev_randao = 0xa86c2e601b6c44eb4848f7d23d9df3113fbcac42041c49cbed5000cb4f118777_bytes32;
132+
else
133+
tx_context.block_prev_randao = evmc::uint256be{200000000};
129134
tx_context.block_gas_limit = 20000000;
130135
tx_context.block_coinbase = 0x7878787878787878787878787878787878787878_address;
131136
tx_context.tx_gas_price = evmc::uint256be{3000000000};

0 commit comments

Comments
 (0)