mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
core/vm: Make INVALID a defined opcode (#118)
core/vm: Make INVALID a defined opcode (#24017) * core/vm: Define 0xfe opcode as INVALID * core/vm: Remove opInvalid as opUndefined handles it Co-authored-by: Alex Beregszaszi <alex@rtfs.hu> Co-authored-by: Andrei Maiboroda <andrei@ethereum.org> Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
This commit is contained in:
parent
e15d0d35cb
commit
21b65f4944
4 changed files with 6 additions and 3 deletions
|
|
@ -496,7 +496,7 @@ func TestEstimateGas(t *testing.T) {
|
||||||
GasPrice: big.NewInt(0),
|
GasPrice: big.NewInt(0),
|
||||||
Value: nil,
|
Value: nil,
|
||||||
Data: common.Hex2Bytes("b9b046f9"),
|
Data: common.Hex2Bytes("b9b046f9"),
|
||||||
}, 0, errors.New("invalid opcode: opcode 0xfe not defined"), nil},
|
}, 0, errors.New("invalid opcode: INVALID"), nil},
|
||||||
|
|
||||||
{"Valid", ethereum.CallMsg{
|
{"Valid", ethereum.CallMsg{
|
||||||
From: addr,
|
From: addr,
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,7 @@ const (
|
||||||
|
|
||||||
STATICCALL OpCode = 0xfa
|
STATICCALL OpCode = 0xfa
|
||||||
REVERT OpCode = 0xfd
|
REVERT OpCode = 0xfd
|
||||||
|
INVALID OpCode = 0xfe
|
||||||
SELFDESTRUCT OpCode = 0xff
|
SELFDESTRUCT OpCode = 0xff
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -390,6 +391,7 @@ var opCodeToString = map[OpCode]string{
|
||||||
CREATE2: "CREATE2",
|
CREATE2: "CREATE2",
|
||||||
STATICCALL: "STATICCALL",
|
STATICCALL: "STATICCALL",
|
||||||
REVERT: "REVERT",
|
REVERT: "REVERT",
|
||||||
|
INVALID: "INVALID",
|
||||||
SELFDESTRUCT: "SELFDESTRUCT",
|
SELFDESTRUCT: "SELFDESTRUCT",
|
||||||
|
|
||||||
PUSH: "PUSH",
|
PUSH: "PUSH",
|
||||||
|
|
@ -548,6 +550,7 @@ var stringToOp = map[string]OpCode{
|
||||||
"RETURN": RETURN,
|
"RETURN": RETURN,
|
||||||
"CALLCODE": CALLCODE,
|
"CALLCODE": CALLCODE,
|
||||||
"REVERT": REVERT,
|
"REVERT": REVERT,
|
||||||
|
"INVALID": INVALID,
|
||||||
"SELFDESTRUCT": SELFDESTRUCT,
|
"SELFDESTRUCT": SELFDESTRUCT,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
"result": {
|
"result": {
|
||||||
"calls": [
|
"calls": [
|
||||||
{
|
{
|
||||||
"error": "invalid opcode: opcode 0xfe not defined",
|
"error": "invalid opcode: INVALID",
|
||||||
"from": "0x33056b5dcac09a9b4becad0e1dcf92c19bd0af76",
|
"from": "0x33056b5dcac09a9b4becad0e1dcf92c19bd0af76",
|
||||||
"gas": "0x75fe3",
|
"gas": "0x75fe3",
|
||||||
"gasUsed": "0x75fe3",
|
"gasUsed": "0x75fe3",
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
"result": {
|
"result": {
|
||||||
"calls": [
|
"calls": [
|
||||||
{
|
{
|
||||||
"error": "invalid opcode: opcode 0xfe not defined",
|
"error": "invalid opcode: INVALID",
|
||||||
"from": "0x33056b5dcac09a9b4becad0e1dcf92c19bd0af76",
|
"from": "0x33056b5dcac09a9b4becad0e1dcf92c19bd0af76",
|
||||||
"gas": "0x75fe3",
|
"gas": "0x75fe3",
|
||||||
"gasUsed": "0x75fe3",
|
"gasUsed": "0x75fe3",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue