From 26b8a1d8617d4d1178a82aa07fa74de69de2a438 Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Mon, 24 Jun 2024 09:54:15 +0200 Subject: [PATCH] Set random in CeloBackend to ensure IsMerge If this is not set, the PUSH0 instruction is not enabled, since both IsMerge and IsShanghai have to be true to enable it. Not enabling it can lead to reverts when calling core contracts from within op-geth (not via RPC). --- contracts/celo_backend.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/celo_backend.go b/contracts/celo_backend.go index 361e33e6f7..8d3817164a 100644 --- a/contracts/celo_backend.go +++ b/contracts/celo_backend.go @@ -40,7 +40,11 @@ func (b *CeloBackend) CallContract(ctx context.Context, call ethereum.CallMsg, b if blockNumber == nil { blockNumber = common.Big0 } - blockCtx := vm.BlockContext{BlockNumber: blockNumber, Time: 0} + blockCtx := vm.BlockContext{ + BlockNumber: blockNumber, + Time: 0, + Random: &common.Hash{}, // Setting this is important since it is used to set IsMerge + } txCtx := vm.TxContext{} vmConfig := vm.Config{}