Skip to content

Commit

Permalink
feat: skip RANDOM & PREVRANDAO opcodes (#811)
Browse files Browse the repository at this point in the history
fix opRandom
  • Loading branch information
0xmountaintop authored Jun 8, 2024
1 parent 20a7093 commit b3920ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions core/vm/jump_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ func newShanghaiInstructionSet() JumpTable {

func newMergeInstructionSet() JumpTable {
instructionSet := newLondonInstructionSet()
instructionSet[PREVRANDAO] = &operation{
execute: opRandom,
constantGas: GasQuickStep,
minStack: minStack(0, 1),
maxStack: maxStack(0, 1),
}
// instructionSet[PREVRANDAO] = &operation{
// execute: opRandom,
// constantGas: GasQuickStep,
// minStack: minStack(0, 1),
// maxStack: maxStack(0, 1),
// }
return validate(instructionSet)
}

Expand Down
15 changes: 8 additions & 7 deletions core/vm/opcodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ const (

// 0x40 range - block operations.
const (
BLOCKHASH OpCode = 0x40
COINBASE OpCode = 0x41
TIMESTAMP OpCode = 0x42
NUMBER OpCode = 0x43
DIFFICULTY OpCode = 0x44
RANDOM OpCode = 0x44 // Same as DIFFICULTY
PREVRANDAO OpCode = 0x44 // Same as DIFFICULTY
BLOCKHASH OpCode = 0x40
COINBASE OpCode = 0x41
TIMESTAMP OpCode = 0x42
NUMBER OpCode = 0x43
DIFFICULTY OpCode = 0x44
// RANDOM & PREVRANDAO are not supported in scroll
// RANDOM OpCode = 0x44 // Same as DIFFICULTY
// PREVRANDAO OpCode = 0x44 // Same as DIFFICULTY
GASLIMIT OpCode = 0x45
CHAINID OpCode = 0x46
SELFBALANCE OpCode = 0x47
Expand Down

0 comments on commit b3920ab

Please sign in to comment.