Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
c495bca4
Commit
c495bca4
authored
Jan 02, 2018
by
cdetrio
Committed by
Felix Lange
Jan 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth: enable preimage recording when tracing (#15787)
parent
413cc5b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
api_tracer.go
eth/api_tracer.go
+4
-1
No files found.
eth/api_tracer.go
View file @
c495bca4
...
...
@@ -667,12 +667,15 @@ func (api *PrivateDebugAPI) traceTx(ctx context.Context, message core.Message, v
tracer
=
vm
.
NewStructLogger
(
config
.
LogConfig
)
}
// Run the transaction with tracing enabled.
vmenv
:=
vm
.
NewEVM
(
vmctx
,
statedb
,
api
.
config
,
vm
.
Config
{
Debug
:
true
,
Tracer
:
tracer
})
vmenv
:=
vm
.
NewEVM
(
vmctx
,
statedb
,
api
.
config
,
vm
.
Config
{
Debug
:
true
,
Tracer
:
tracer
,
EnablePreimageRecording
:
true
})
ret
,
gas
,
failed
,
err
:=
core
.
ApplyMessage
(
vmenv
,
message
,
new
(
core
.
GasPool
)
.
AddGas
(
message
.
Gas
()))
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"tracing failed: %v"
,
err
)
}
if
err
:=
core
.
WritePreimages
(
api
.
eth
.
ChainDb
(),
vmctx
.
BlockNumber
.
Uint64
(),
statedb
.
Preimages
());
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Error writing preimage from trace: %v"
,
err
)
}
// Depending on the tracer type, format and return the output
switch
tracer
:=
tracer
.
(
type
)
{
case
*
vm
.
StructLogger
:
...
...
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