Skip to content

Commit

Permalink
Set random in CeloBackend to ensure IsMerge
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
karlb committed Jun 24, 2024
1 parent eb460e4 commit 26b8a1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/celo_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand Down

0 comments on commit 26b8a1d

Please sign in to comment.