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
bd10a31d
Commit
bd10a31d
authored
Oct 12, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding logger allows interpreter to be stock
parent
920aa20b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
348 additions
and
35 deletions
+348
-35
files_minigeth
files_minigeth
+2
-1
interpreter.go
minigeth/core/vm/interpreter.go
+2
-34
logger.go
minigeth/core/vm/logger.go
+344
-0
No files found.
files_minigeth
View file @
bd10a31d
...
@@ -43,8 +43,9 @@ core/vm/gas_table.go
...
@@ -43,8 +43,9 @@ core/vm/gas_table.go
core/vm/gas.go
core/vm/gas.go
core/vm/instructions.go
core/vm/instructions.go
core/vm/interface.go
core/vm/interface.go
#
core/vm/interpreter.go
core/vm/interpreter.go
core/vm/jump_table.go
core/vm/jump_table.go
core/vm/logger.go
core/vm/memory_table.go
core/vm/memory_table.go
core/vm/memory.go
core/vm/memory.go
core/vm/opcodes.go
core/vm/opcodes.go
...
...
minigeth/core/vm/interpreter.go
View file @
bd10a31d
...
@@ -18,41 +18,13 @@ package vm
...
@@ -18,41 +18,13 @@ package vm
import
(
import
(
"hash"
"hash"
"math/big"
"sync/atomic"
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/common/math"
//
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
)
)
// **** stub Tracer ****
type
Tracer
interface
{
CaptureStart
(
env
*
EVM
,
from
common
.
Address
,
to
common
.
Address
,
create
bool
,
input
[]
byte
,
gas
uint64
,
value
*
big
.
Int
)
CaptureState
(
env
*
EVM
,
pc
uint64
,
op
OpCode
,
gas
,
cost
uint64
,
scope
*
ScopeContext
,
rData
[]
byte
,
depth
int
,
err
error
)
CaptureFault
(
env
*
EVM
,
pc
uint64
,
op
OpCode
,
gas
,
cost
uint64
,
scope
*
ScopeContext
,
depth
int
,
err
error
)
CaptureEnd
(
output
[]
byte
,
gasUsed
uint64
,
t
time
.
Duration
,
err
error
)
}
/*type StubTracer struct{}
// CaptureStart implements the Tracer interface to initialize the tracing operation.
func (jst *StubTracer) CaptureStart(env *EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) {
}
// CaptureState implements the Tracer interface to trace a single step of VM execution.
func (jst *StubTracer) CaptureState(env *EVM, pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, rData []byte, depth int, err error) {
}
// CaptureFault implements the Tracer interface to trace an execution fault
func (jst *StubTracer) CaptureFault(env *EVM, pc uint64, op OpCode, gas, cost uint64, scope *ScopeContext, depth int, err error) {
}
// CaptureEnd is called after the call finishes to finalize the tracing.
func (jst *StubTracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) {
}*/
// Config are the configuration options for the Interpreter
// Config are the configuration options for the Interpreter
type
Config
struct
{
type
Config
struct
{
Debug
bool
// Enables debugging
Debug
bool
// Enables debugging
...
@@ -125,7 +97,7 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
...
@@ -125,7 +97,7 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
if
err
:=
EnableEIP
(
eip
,
&
jt
);
err
!=
nil
{
if
err
:=
EnableEIP
(
eip
,
&
jt
);
err
!=
nil
{
// Disable it, so caller can check if it's activated or not
// Disable it, so caller can check if it's activated or not
cfg
.
ExtraEips
=
append
(
cfg
.
ExtraEips
[
:
i
],
cfg
.
ExtraEips
[
i
+
1
:
]
...
)
cfg
.
ExtraEips
=
append
(
cfg
.
ExtraEips
[
:
i
],
cfg
.
ExtraEips
[
i
+
1
:
]
...
)
//
log.Error("EIP activation failed", "eip", eip, "error", err)
log
.
Error
(
"EIP activation failed"
,
"eip"
,
eip
,
"error"
,
err
)
}
}
}
}
cfg
.
JumpTable
=
jt
cfg
.
JumpTable
=
jt
...
@@ -137,10 +109,6 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
...
@@ -137,10 +109,6 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter {
}
}
}
}
func
(
in
*
EVMInterpreter
)
GetCfg
()
*
Config
{
return
&
in
.
cfg
}
// Run loops and evaluates the contract's code with the given input data and returns
// Run loops and evaluates the contract's code with the given input data and returns
// the return byte-slice and an error if one occurred.
// the return byte-slice and an error if one occurred.
//
//
...
...
minigeth/core/vm/logger.go
0 → 100644
View file @
bd10a31d
This diff is collapsed.
Click to expand it.
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