Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
2517e200
Commit
2517e200
authored
Jan 23, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove outofgas checking
parent
7a434782
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
traceAnalyser.js
src/trace/traceAnalyser.js
+2
-7
traceCache.js
src/trace/traceCache.js
+7
-3
No files found.
src/trace/traceAnalyser.js
View file @
2517e200
...
@@ -90,7 +90,6 @@ TraceAnalyser.prototype.buildStorage = function (index, step, context) {
...
@@ -90,7 +90,6 @@ TraceAnalyser.prototype.buildStorage = function (index, step, context) {
}
}
TraceAnalyser
.
prototype
.
buildDepth
=
function
(
index
,
step
,
tx
,
callStack
,
context
)
{
TraceAnalyser
.
prototype
.
buildDepth
=
function
(
index
,
step
,
tx
,
callStack
,
context
)
{
var
outOfGas
=
runOutOfGas
(
step
)
if
(
traceHelper
.
isCallInstruction
(
step
)
&&
!
traceHelper
.
isCallToPrecompiledContract
(
index
,
this
.
trace
))
{
if
(
traceHelper
.
isCallInstruction
(
step
)
&&
!
traceHelper
.
isCallToPrecompiledContract
(
index
,
this
.
trace
))
{
var
newAddress
var
newAddress
if
(
traceHelper
.
isCreateInstruction
(
step
))
{
if
(
traceHelper
.
isCreateInstruction
(
step
))
{
...
@@ -111,10 +110,10 @@ TraceAnalyser.prototype.buildDepth = function (index, step, tx, callStack, conte
...
@@ -111,10 +110,10 @@ TraceAnalyser.prototype.buildDepth = function (index, step, tx, callStack, conte
this
.
traceCache
.
pushSteps
(
index
,
context
.
currentCallIndex
)
this
.
traceCache
.
pushSteps
(
index
,
context
.
currentCallIndex
)
context
.
lastCallIndex
=
context
.
currentCallIndex
context
.
lastCallIndex
=
context
.
currentCallIndex
context
.
currentCallIndex
=
0
context
.
currentCallIndex
=
0
}
else
if
(
traceHelper
.
isReturnInstruction
(
step
)
||
traceHelper
.
isStopInstruction
(
step
)
||
outOfGas
||
step
.
error
||
step
.
invalidDepthChange
)
{
}
else
if
(
traceHelper
.
isReturnInstruction
(
step
)
||
traceHelper
.
isStopInstruction
(
step
)
||
step
.
error
||
step
.
invalidDepthChange
)
{
if
(
index
<
this
.
trace
.
length
)
{
if
(
index
<
this
.
trace
.
length
)
{
callStack
.
pop
()
callStack
.
pop
()
this
.
traceCache
.
pushCall
(
step
,
index
+
1
,
null
,
callStack
.
slice
(
0
),
outOfGas
||
step
.
error
||
step
.
invalidDepthChange
,
outOfGas
)
this
.
traceCache
.
pushCall
(
step
,
index
+
1
,
null
,
callStack
.
slice
(
0
),
step
.
error
||
step
.
invalidDepthChange
)
this
.
buildCalldata
(
index
,
step
,
tx
,
false
)
this
.
buildCalldata
(
index
,
step
,
tx
,
false
)
this
.
traceCache
.
pushSteps
(
index
,
context
.
currentCallIndex
)
this
.
traceCache
.
pushSteps
(
index
,
context
.
currentCallIndex
)
context
.
currentCallIndex
=
context
.
lastCallIndex
+
1
context
.
currentCallIndex
=
context
.
lastCallIndex
+
1
...
@@ -126,8 +125,4 @@ TraceAnalyser.prototype.buildDepth = function (index, step, tx, callStack, conte
...
@@ -126,8 +125,4 @@ TraceAnalyser.prototype.buildDepth = function (index, step, tx, callStack, conte
return
context
return
context
}
}
function
runOutOfGas
(
step
)
{
return
parseInt
(
step
.
gas
)
-
parseInt
(
step
.
gasCost
)
<
0
}
module
.
exports
=
TraceAnalyser
module
.
exports
=
TraceAnalyser
src/trace/traceCache.js
View file @
2517e200
...
@@ -33,12 +33,16 @@ TraceCache.prototype.pushMemoryChanges = function (value) {
...
@@ -33,12 +33,16 @@ TraceCache.prototype.pushMemoryChanges = function (value) {
this
.
memoryChanges
.
push
(
value
)
this
.
memoryChanges
.
push
(
value
)
}
}
TraceCache
.
prototype
.
pushCall
=
function
(
step
,
index
,
address
,
callStack
,
reverted
,
outOfGas
)
{
// outOfGas has been removed because gas left logging is apparently made differently
if
(
step
.
op
===
'RETURN'
||
step
.
op
===
'STOP'
||
reverted
)
{
// in the vm/geth/eth. TODO add the error property (with about the error in all clients)
TraceCache
.
prototype
.
pushCall
=
function
(
step
,
index
,
address
,
callStack
,
reverted
)
{
var
validReturnStep
=
step
.
op
===
'RETURN'
||
step
.
op
===
'STOP'
if
(
validReturnStep
||
reverted
)
{
if
(
this
.
currentCall
)
{
if
(
this
.
currentCall
)
{
this
.
currentCall
.
call
.
return
=
index
-
1
this
.
currentCall
.
call
.
return
=
index
-
1
if
(
!
validReturnStep
)
{
this
.
currentCall
.
call
.
reverted
=
reverted
this
.
currentCall
.
call
.
reverted
=
reverted
this
.
currentCall
.
call
.
outOfGas
=
outOfGas
}
var
parent
=
this
.
currentCall
.
parent
var
parent
=
this
.
currentCall
.
parent
this
.
currentCall
=
parent
?
{
call
:
parent
.
call
,
parent
:
parent
.
parent
}
:
null
this
.
currentCall
=
parent
?
{
call
:
parent
.
call
,
parent
:
parent
.
parent
}
:
null
}
}
...
...
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