feat: skip RANDOM & PREVRANDAO opcodes (#811)

fix opRandom
This commit is contained in:
HAOYUatHZ 2024-06-08 17:01:33 +08:00 committed by GitHub
parent 20a7093f4c
commit b3920abc9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 13 deletions

View file

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

View file

@ -94,8 +94,9 @@ const (
TIMESTAMP OpCode = 0x42 TIMESTAMP OpCode = 0x42
NUMBER OpCode = 0x43 NUMBER OpCode = 0x43
DIFFICULTY OpCode = 0x44 DIFFICULTY OpCode = 0x44
RANDOM OpCode = 0x44 // Same as DIFFICULTY // RANDOM & PREVRANDAO are not supported in scroll
PREVRANDAO OpCode = 0x44 // Same as DIFFICULTY // RANDOM OpCode = 0x44 // Same as DIFFICULTY
// PREVRANDAO OpCode = 0x44 // Same as DIFFICULTY
GASLIMIT OpCode = 0x45 GASLIMIT OpCode = 0x45
CHAINID OpCode = 0x46 CHAINID OpCode = 0x46
SELFBALANCE OpCode = 0x47 SELFBALANCE OpCode = 0x47