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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
7a7428a0
Unverified
Commit
7a7428a0
authored
Apr 27, 2018
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
core, eth: fix tracer dirty finalization
parent
cfe8f5fd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/state/statedb.go
+0
-21
0 additions, 21 deletions
core/state/statedb.go
core/vm/evm.go
+5
-0
5 additions, 0 deletions
core/vm/evm.go
eth/api_tracer.go
+3
-2
3 additions, 2 deletions
eth/api_tracer.go
with
8 additions
and
23 deletions
core/state/statedb.go
+
0
−
21
View file @
7a7428a0
...
@@ -572,27 +572,6 @@ func (self *StateDB) Prepare(thash, bhash common.Hash, ti int) {
...
@@ -572,27 +572,6 @@ func (self *StateDB) Prepare(thash, bhash common.Hash, ti int) {
self
.
txIndex
=
ti
self
.
txIndex
=
ti
}
}
// DeleteSuicides flags the suicided objects for deletion so that it
// won't be referenced again when called / queried up on.
//
// DeleteSuicides should not be used for consensus related updates
// under any circumstances.
func
(
s
*
StateDB
)
DeleteSuicides
()
{
// Reset refund so that any used-gas calculations can use this method.
s
.
clearJournalAndRefund
()
for
addr
:=
range
s
.
stateObjectsDirty
{
stateObject
:=
s
.
stateObjects
[
addr
]
// If the object has been removed by a suicide
// flag the object as deleted.
if
stateObject
.
suicided
{
stateObject
.
deleted
=
true
}
delete
(
s
.
stateObjectsDirty
,
addr
)
}
}
func
(
s
*
StateDB
)
clearJournalAndRefund
()
{
func
(
s
*
StateDB
)
clearJournalAndRefund
()
{
s
.
journal
=
newJournal
()
s
.
journal
=
newJournal
()
s
.
validRevisions
=
s
.
validRevisions
[
:
0
]
s
.
validRevisions
=
s
.
validRevisions
[
:
0
]
...
...
This diff is collapsed.
Click to expand it.
core/vm/evm.go
+
5
−
0
View file @
7a7428a0
...
@@ -160,6 +160,11 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
...
@@ -160,6 +160,11 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
precompiles
=
PrecompiledContractsByzantium
precompiles
=
PrecompiledContractsByzantium
}
}
if
precompiles
[
addr
]
==
nil
&&
evm
.
ChainConfig
()
.
IsEIP158
(
evm
.
BlockNumber
)
&&
value
.
Sign
()
==
0
{
if
precompiles
[
addr
]
==
nil
&&
evm
.
ChainConfig
()
.
IsEIP158
(
evm
.
BlockNumber
)
&&
value
.
Sign
()
==
0
{
// Calling a non existing account, don't do antything, but ping the tracer
if
evm
.
vmConfig
.
Debug
&&
evm
.
depth
==
0
{
evm
.
vmConfig
.
Tracer
.
CaptureStart
(
caller
.
Address
(),
addr
,
false
,
input
,
gas
,
value
)
evm
.
vmConfig
.
Tracer
.
CaptureEnd
(
ret
,
0
,
0
,
nil
)
}
return
nil
,
gas
,
nil
return
nil
,
gas
,
nil
}
}
evm
.
StateDB
.
CreateAccount
(
addr
)
evm
.
StateDB
.
CreateAccount
(
addr
)
...
...
This diff is collapsed.
Click to expand it.
eth/api_tracer.go
+
3
−
2
View file @
7a7428a0
...
@@ -201,7 +201,7 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
...
@@ -201,7 +201,7 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
log
.
Warn
(
"Tracing failed"
,
"hash"
,
tx
.
Hash
(),
"block"
,
task
.
block
.
NumberU64
(),
"err"
,
err
)
log
.
Warn
(
"Tracing failed"
,
"hash"
,
tx
.
Hash
(),
"block"
,
task
.
block
.
NumberU64
(),
"err"
,
err
)
break
break
}
}
task
.
statedb
.
DeleteSuicides
(
)
task
.
statedb
.
Finalise
(
true
)
task
.
results
[
i
]
=
&
txTraceResult
{
Result
:
res
}
task
.
results
[
i
]
=
&
txTraceResult
{
Result
:
res
}
}
}
// Stream the result back to the user or abort on teardown
// Stream the result back to the user or abort on teardown
...
@@ -640,7 +640,8 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree
...
@@ -640,7 +640,8 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree
if
_
,
_
,
_
,
err
:=
core
.
ApplyMessage
(
vmenv
,
msg
,
new
(
core
.
GasPool
)
.
AddGas
(
tx
.
Gas
()));
err
!=
nil
{
if
_
,
_
,
_
,
err
:=
core
.
ApplyMessage
(
vmenv
,
msg
,
new
(
core
.
GasPool
)
.
AddGas
(
tx
.
Gas
()));
err
!=
nil
{
return
nil
,
vm
.
Context
{},
nil
,
fmt
.
Errorf
(
"tx %x failed: %v"
,
tx
.
Hash
(),
err
)
return
nil
,
vm
.
Context
{},
nil
,
fmt
.
Errorf
(
"tx %x failed: %v"
,
tx
.
Hash
(),
err
)
}
}
statedb
.
DeleteSuicides
()
// Ensure any modifications are committed to the state
statedb
.
Finalise
(
true
)
}
}
return
nil
,
vm
.
Context
{},
nil
,
fmt
.
Errorf
(
"tx index %d out of range for block %x"
,
txIndex
,
blockHash
)
return
nil
,
vm
.
Context
{},
nil
,
fmt
.
Errorf
(
"tx index %d out of range for block %x"
,
txIndex
,
blockHash
)
}
}
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