Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
fbd508bf
Unverified
Commit
fbd508bf
authored
Aug 13, 2021
by
Mark Tyneway
Committed by
GitHub
Aug 13, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1320 from ethereum-optimism/fix/reduce-diff-evm-id
l2geth: removes the id from the evm
parents
0f6f7e35
101b942c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
15 deletions
+11
-15
new-elephants-rush.md
.changeset/new-elephants-rush.md
+5
-0
state_transition.go
l2geth/core/state_transition.go
+1
-1
evm.go
l2geth/core/vm/evm.go
+5
-14
No files found.
.changeset/new-elephants-rush.md
0 → 100644
View file @
fbd508bf
---
'
@eth-optimism/l2geth'
:
patch
---
Removes
`id`
field from EVM and no longer logs the EVM execution id
l2geth/core/state_transition.go
View file @
fbd508bf
...
@@ -249,7 +249,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
...
@@ -249,7 +249,7 @@ func (st *StateTransition) TransitionDb() (ret []byte, usedGas uint64, failed bo
l1MessageSender
=
msg
.
L1MessageSender
()
.
Hex
()
l1MessageSender
=
msg
.
L1MessageSender
()
.
Hex
()
}
}
if
st
.
evm
.
EthCallSender
==
nil
{
if
st
.
evm
.
EthCallSender
==
nil
{
log
.
Debug
(
"Applying transaction"
,
"
ID"
,
st
.
evm
.
Id
,
"
from"
,
sender
.
Address
()
.
Hex
(),
"to"
,
to
,
"nonce"
,
msg
.
Nonce
(),
"gasPrice"
,
msg
.
GasPrice
()
.
Uint64
(),
"gasLimit"
,
msg
.
Gas
(),
"value"
,
msg
.
Value
()
.
Uint64
(),
"l1MessageSender"
,
l1MessageSender
,
"data"
,
hexutil
.
Encode
(
msg
.
Data
()))
log
.
Debug
(
"Applying transaction"
,
"from"
,
sender
.
Address
()
.
Hex
(),
"to"
,
to
,
"nonce"
,
msg
.
Nonce
(),
"gasPrice"
,
msg
.
GasPrice
()
.
Uint64
(),
"gasLimit"
,
msg
.
Gas
(),
"value"
,
msg
.
Value
()
.
Uint64
(),
"l1MessageSender"
,
l1MessageSender
,
"data"
,
hexutil
.
Encode
(
msg
.
Data
()))
}
}
}
}
...
...
l2geth/core/vm/evm.go
View file @
fbd508bf
...
@@ -18,8 +18,6 @@ package vm
...
@@ -18,8 +18,6 @@ package vm
import
(
import
(
"bytes"
"bytes"
"crypto/rand"
"encoding/hex"
"fmt"
"fmt"
"math/big"
"math/big"
"strings"
"strings"
...
@@ -120,7 +118,7 @@ func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, err
...
@@ -120,7 +118,7 @@ func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, err
// OVM_ENABLED
// OVM_ENABLED
// Only log for non `eth_call`s
// Only log for non `eth_call`s
if
evm
.
Context
.
EthCallSender
==
nil
{
if
evm
.
Context
.
EthCallSender
==
nil
{
log
.
Debug
(
"Calling contract"
,
"
ID"
,
evm
.
Id
,
"
Address"
,
contract
.
Address
()
.
Hex
(),
"Data"
,
hexutil
.
Encode
(
input
))
log
.
Debug
(
"Calling contract"
,
"Address"
,
contract
.
Address
()
.
Hex
(),
"Data"
,
hexutil
.
Encode
(
input
))
}
}
// Uncomment to make Safety checker always returns true.
// Uncomment to make Safety checker always returns true.
...
@@ -132,7 +130,7 @@ func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, err
...
@@ -132,7 +130,7 @@ func run(evm *EVM, contract *Contract, input []byte, readOnly bool) ([]byte, err
if
contract
.
Address
()
==
evm
.
Context
.
OvmStateManager
.
Address
{
if
contract
.
Address
()
==
evm
.
Context
.
OvmStateManager
.
Address
{
// The caller must be the execution manager
// The caller must be the execution manager
if
contract
.
Caller
()
!=
evm
.
Context
.
OvmExecutionManager
.
Address
{
if
contract
.
Caller
()
!=
evm
.
Context
.
OvmExecutionManager
.
Address
{
log
.
Error
(
"StateManager called by non ExecutionManager"
,
"
ID"
,
evm
.
Id
,
"
caller"
,
contract
.
Caller
()
.
Hex
())
log
.
Error
(
"StateManager called by non ExecutionManager"
,
"caller"
,
contract
.
Caller
()
.
Hex
())
return
nil
,
ErrOvmSandboxEscape
return
nil
,
ErrOvmSandboxEscape
}
}
return
callStateManager
(
input
,
evm
,
contract
)
return
callStateManager
(
input
,
evm
,
contract
)
...
@@ -238,8 +236,6 @@ type EVM struct {
...
@@ -238,8 +236,6 @@ type EVM struct {
// available gas is calculated in gasCall* according to the 63/64 rule and later
// available gas is calculated in gasCall* according to the 63/64 rule and later
// applied in opCall*.
// applied in opCall*.
callGasTemp
uint64
callGasTemp
uint64
Id
string
}
}
// NewEVM returns a new EVM. The returned EVM is not thread safe and should
// NewEVM returns a new EVM. The returned EVM is not thread safe and should
...
@@ -256,9 +252,6 @@ func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmCon
...
@@ -256,9 +252,6 @@ func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmCon
ctx
.
OvmL2StandardBridge
=
chainConfig
.
StateDump
.
Accounts
[
"OVM_L2StandardBridge"
]
ctx
.
OvmL2StandardBridge
=
chainConfig
.
StateDump
.
Accounts
[
"OVM_L2StandardBridge"
]
}
}
id
:=
make
([]
byte
,
4
)
rand
.
Read
(
id
)
evm
:=
&
EVM
{
evm
:=
&
EVM
{
Context
:
ctx
,
Context
:
ctx
,
StateDB
:
statedb
,
StateDB
:
statedb
,
...
@@ -266,8 +259,6 @@ func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmCon
...
@@ -266,8 +259,6 @@ func NewEVM(ctx Context, statedb StateDB, chainConfig *params.ChainConfig, vmCon
chainConfig
:
chainConfig
,
chainConfig
:
chainConfig
,
chainRules
:
chainConfig
.
Rules
(
ctx
.
BlockNumber
),
chainRules
:
chainConfig
.
Rules
(
ctx
.
BlockNumber
),
interpreters
:
make
([]
Interpreter
,
0
,
1
),
interpreters
:
make
([]
Interpreter
,
0
,
1
),
Id
:
hex
.
EncodeToString
(
id
),
}
}
if
chainConfig
.
IsEWASM
(
ctx
.
BlockNumber
)
{
if
chainConfig
.
IsEWASM
(
ctx
.
BlockNumber
)
{
...
@@ -467,7 +458,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
...
@@ -467,7 +458,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
}
}
}
}
if
evm
.
Context
.
EthCallSender
==
nil
{
if
evm
.
Context
.
EthCallSender
==
nil
{
log
.
Debug
(
"Reached the end of an OVM execution"
,
"
ID"
,
evm
.
Id
,
"
Return Data"
,
hexutil
.
Encode
(
ret
),
"Error"
,
err
)
log
.
Debug
(
"Reached the end of an OVM execution"
,
"Return Data"
,
hexutil
.
Encode
(
ret
),
"Error"
,
err
)
}
}
}
}
}
}
...
@@ -700,7 +691,7 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I
...
@@ -700,7 +691,7 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I
contractAddr
=
evm
.
OvmADDRESS
()
contractAddr
=
evm
.
OvmADDRESS
()
if
evm
.
Context
.
EthCallSender
==
nil
{
if
evm
.
Context
.
EthCallSender
==
nil
{
log
.
Debug
(
"[EM] Creating contract."
,
"
ID"
,
evm
.
Id
,
"
New contract address"
,
contractAddr
.
Hex
(),
"Caller Addr"
,
caller
.
Address
()
.
Hex
(),
"Caller nonce"
,
evm
.
StateDB
.
GetNonce
(
caller
.
Address
()))
log
.
Debug
(
"[EM] Creating contract."
,
"New contract address"
,
contractAddr
.
Hex
(),
"Caller Addr"
,
caller
.
Address
()
.
Hex
(),
"Caller nonce"
,
evm
.
StateDB
.
GetNonce
(
caller
.
Address
()))
}
}
}
}
...
@@ -726,7 +717,7 @@ func (evm *EVM) Create2(caller ContractRef, code []byte, gas uint64, endowment *
...
@@ -726,7 +717,7 @@ func (evm *EVM) Create2(caller ContractRef, code []byte, gas uint64, endowment *
contractAddr
=
evm
.
OvmADDRESS
()
contractAddr
=
evm
.
OvmADDRESS
()
if
evm
.
Context
.
EthCallSender
==
nil
{
if
evm
.
Context
.
EthCallSender
==
nil
{
log
.
Debug
(
"[EM] Creating contract [create2]."
,
"
ID"
,
evm
.
Id
,
"
New contract address"
,
contractAddr
.
Hex
(),
"Caller Addr"
,
caller
.
Address
()
.
Hex
(),
"Caller nonce"
,
evm
.
StateDB
.
GetNonce
(
caller
.
Address
()))
log
.
Debug
(
"[EM] Creating contract [create2]."
,
"New contract address"
,
contractAddr
.
Hex
(),
"Caller Addr"
,
caller
.
Address
()
.
Hex
(),
"Caller nonce"
,
evm
.
StateDB
.
GetNonce
(
caller
.
Address
()))
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment