good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
673007d7
Commit
673007d7
authored
7 years ago
by
Casey Detrio
Committed by
Felix Lange
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
core/vm: standard vm traces (#15035)
parent
d558a595
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/evm/json_logger.go
+1
-1
1 addition, 1 deletion
cmd/evm/json_logger.go
core/vm/interpreter.go
+19
-3
19 additions, 3 deletions
core/vm/interpreter.go
with
20 additions
and
4 deletions
cmd/evm/json_logger.go
+
1
−
1
View file @
673007d7
...
...
@@ -40,7 +40,7 @@ func (l *JSONLogger) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cos
log
:=
vm
.
StructLog
{
Pc
:
pc
,
Op
:
op
,
Gas
:
gas
+
cost
,
Gas
:
gas
,
GasCost
:
cost
,
MemorySize
:
memory
.
Len
(),
Storage
:
nil
,
...
...
This diff is collapsed.
Click to expand it.
core/vm/interpreter.go
+
19
−
3
View file @
673007d7
...
...
@@ -137,12 +137,17 @@ func (in *Interpreter) Run(snapshot int, contract *Contract, input []byte) (ret
// to be uint256. Practically much less so feasible.
pc
=
uint64
(
0
)
// program counter
cost
uint64
// copies used by tracer
stackCopy
=
newstack
()
// stackCopy needed for Tracer since stack is mutated by 63/64 gas rule
pcCopy
uint64
// needed for the deferred Tracer
gasCopy
uint64
// for Tracer to log gas remaining before execution
logged
bool
// deferred Tracer should ignore already logged steps
)
contract
.
Input
=
input
defer
func
()
{
if
err
!=
nil
&&
in
.
cfg
.
Debug
{
in
.
cfg
.
Tracer
.
CaptureState
(
in
.
evm
,
pc
,
op
,
contract
.
Gas
,
cost
,
mem
,
stack
,
contract
,
in
.
evm
.
depth
,
err
)
if
err
!=
nil
&&
!
logged
&&
in
.
cfg
.
Debug
{
in
.
cfg
.
Tracer
.
CaptureState
(
in
.
evm
,
pc
Copy
,
op
,
gasCopy
,
cost
,
mem
,
stack
Copy
,
contract
,
in
.
evm
.
depth
,
err
)
}
}()
...
...
@@ -154,6 +159,16 @@ func (in *Interpreter) Run(snapshot int, contract *Contract, input []byte) (ret
// Get the memory location of pc
op
=
contract
.
GetOp
(
pc
)
if
in
.
cfg
.
Debug
{
logged
=
false
pcCopy
=
uint64
(
pc
)
gasCopy
=
uint64
(
contract
.
Gas
)
stackCopy
=
newstack
()
for
_
,
val
:=
range
stack
.
data
{
stackCopy
.
push
(
val
)
}
}
// get the operation from the jump table matching the opcode
operation
:=
in
.
cfg
.
JumpTable
[
op
]
if
err
:=
in
.
enforceRestrictions
(
op
,
operation
,
stack
);
err
!=
nil
{
...
...
@@ -199,7 +214,8 @@ func (in *Interpreter) Run(snapshot int, contract *Contract, input []byte) (ret
}
if
in
.
cfg
.
Debug
{
in
.
cfg
.
Tracer
.
CaptureState
(
in
.
evm
,
pc
,
op
,
contract
.
Gas
,
cost
,
mem
,
stack
,
contract
,
in
.
evm
.
depth
,
err
)
in
.
cfg
.
Tracer
.
CaptureState
(
in
.
evm
,
pc
,
op
,
gasCopy
,
cost
,
mem
,
stackCopy
,
contract
,
in
.
evm
.
depth
,
err
)
logged
=
true
}
// execute the operation
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment