mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
core/vm: implement BLOBBASEFEE opcode 0x4a (#28098)
This commit is contained in:
parent
d1b72bf8ac
commit
af4a3b0f9f
3 changed files with 21 additions and 0 deletions
|
|
@ -256,6 +256,23 @@ func opMcopy(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// opBlobBaseFee implements BLOBBASEFEE opcode
|
||||||
|
func opBlobBaseFee(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
|
blobBaseFee := new(uint256.Int)
|
||||||
|
scope.Stack.push(blobBaseFee)
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// enable7516 applies EIP-7516 (BLOBBASEFEE opcode)
|
||||||
|
func enable7516(jt *JumpTable) {
|
||||||
|
jt[BLOBBASEFEE] = &operation{
|
||||||
|
execute: opBlobBaseFee,
|
||||||
|
constantGas: GasQuickStep,
|
||||||
|
minStack: minStack(0, 1),
|
||||||
|
maxStack: maxStack(0, 1),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// enable6780 applies EIP-6780 (deactivate SELFDESTRUCT)
|
// enable6780 applies EIP-6780 (deactivate SELFDESTRUCT)
|
||||||
func enable6780(jt *JumpTable) {
|
func enable6780(jt *JumpTable) {
|
||||||
jt[SELFDESTRUCT] = &operation{
|
jt[SELFDESTRUCT] = &operation{
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ func validate(jt JumpTable) JumpTable {
|
||||||
|
|
||||||
func newCancunInstructionSet() JumpTable {
|
func newCancunInstructionSet() JumpTable {
|
||||||
instructionSet := newEip1559InstructionSet()
|
instructionSet := newEip1559InstructionSet()
|
||||||
|
enable7516(&instructionSet) // EIP-7516 (BLOBBASEFEE opcode)
|
||||||
enable1153(&instructionSet) // EIP-1153 "Transient Storage"
|
enable1153(&instructionSet) // EIP-1153 "Transient Storage"
|
||||||
enable5656(&instructionSet) // EIP-5656 (MCOPY opcode)
|
enable5656(&instructionSet) // EIP-5656 (MCOPY opcode)
|
||||||
enable6780(&instructionSet) // EIP-6780 SELFDESTRUCT only in same transaction
|
enable6780(&instructionSet) // EIP-6780 SELFDESTRUCT only in same transaction
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ const (
|
||||||
CHAINID OpCode = 0x46
|
CHAINID OpCode = 0x46
|
||||||
SELFBALANCE OpCode = 0x47
|
SELFBALANCE OpCode = 0x47
|
||||||
BASEFEE OpCode = 0x48
|
BASEFEE OpCode = 0x48
|
||||||
|
BLOBBASEFEE OpCode = 0x4a
|
||||||
)
|
)
|
||||||
|
|
||||||
// 0x50 range - 'storage' and execution.
|
// 0x50 range - 'storage' and execution.
|
||||||
|
|
@ -284,6 +285,7 @@ var opCodeToString = [256]string{
|
||||||
CHAINID: "CHAINID",
|
CHAINID: "CHAINID",
|
||||||
SELFBALANCE: "SELFBALANCE",
|
SELFBALANCE: "SELFBALANCE",
|
||||||
BASEFEE: "BASEFEE",
|
BASEFEE: "BASEFEE",
|
||||||
|
BLOBBASEFEE: "BLOBBASEFEE",
|
||||||
|
|
||||||
// 0x50 range - 'storage' and execution.
|
// 0x50 range - 'storage' and execution.
|
||||||
POP: "POP",
|
POP: "POP",
|
||||||
|
|
@ -458,6 +460,7 @@ var stringToOp = map[string]OpCode{
|
||||||
"GASLIMIT": GASLIMIT,
|
"GASLIMIT": GASLIMIT,
|
||||||
"SELFBALANCE": SELFBALANCE,
|
"SELFBALANCE": SELFBALANCE,
|
||||||
"BASEFEE": BASEFEE,
|
"BASEFEE": BASEFEE,
|
||||||
|
"BLOBBASEFEE": BLOBBASEFEE,
|
||||||
"POP": POP,
|
"POP": POP,
|
||||||
"MLOAD": MLOAD,
|
"MLOAD": MLOAD,
|
||||||
"MSTORE": MSTORE,
|
"MSTORE": MSTORE,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue