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 {
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)
}

View file

@ -94,8 +94,9 @@ const (
TIMESTAMP OpCode = 0x42
NUMBER OpCode = 0x43
DIFFICULTY OpCode = 0x44
RANDOM OpCode = 0x44 // Same as DIFFICULTY
PREVRANDAO OpCode = 0x44 // Same as DIFFICULTY
// 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