Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
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
link33
plugin
Commits
e869c482
Commit
e869c482
authored
Nov 19, 2021
by
pengjun
Committed by
vipwzw
Nov 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 修复evm delegatecall操作outOfGas报错
2. 放开delegatecall只读调用的限制
parent
ae43c3cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
evm.go
plugin/dapp/evm/executor/vm/runtime/evm.go
+1
-1
gas_table.go
plugin/dapp/evm/executor/vm/runtime/gas_table.go
+7
-0
No files found.
plugin/dapp/evm/executor/vm/runtime/evm.go
View file @
e869c482
...
@@ -329,7 +329,7 @@ func (evm *EVM) DelegateCall(caller ContractRef, addr common.Address, input []by
...
@@ -329,7 +329,7 @@ func (evm *EVM) DelegateCall(caller ContractRef, addr common.Address, input []by
contract
.
SetCallCode
(
&
addr
,
evm
.
StateDB
.
GetCodeHash
(
addr
.
String
()),
evm
.
StateDB
.
GetCode
(
addr
.
String
()))
contract
.
SetCallCode
(
&
addr
,
evm
.
StateDB
.
GetCodeHash
(
addr
.
String
()),
evm
.
StateDB
.
GetCode
(
addr
.
String
()))
// 其它逻辑同StaticCall
// 其它逻辑同StaticCall
ret
,
err
=
run
(
evm
,
contract
,
input
,
tru
e
)
ret
,
err
=
run
(
evm
,
contract
,
input
,
fals
e
)
}
}
...
...
plugin/dapp/evm/executor/vm/runtime/gas_table.go
View file @
e869c482
...
@@ -277,6 +277,13 @@ func gasDelegateCall(evm *EVM, contract *Contract, stack *Stack, mem *Memory, me
...
@@ -277,6 +277,13 @@ func gasDelegateCall(evm *EVM, contract *Contract, stack *Stack, mem *Memory, me
if
err
!=
nil
{
if
err
!=
nil
{
return
0
,
err
return
0
,
err
}
}
evm
.
callGasTemp
,
err
=
callGas
(
true
,
contract
.
Gas
,
gas
,
stack
.
Back
(
0
))
if
err
!=
nil
{
return
0
,
err
}
log15
.
Info
(
"gasDelegateCall"
,
"gas"
,
gas
,
"evm.callGasTemp"
,
evm
.
callGasTemp
)
var
overflow
bool
var
overflow
bool
if
gas
,
overflow
=
math
.
SafeAdd
(
gas
,
evm
.
callGasTemp
);
overflow
{
if
gas
,
overflow
=
math
.
SafeAdd
(
gas
,
evm
.
callGasTemp
);
overflow
{
return
0
,
ErrGasUintOverflow
return
0
,
ErrGasUintOverflow
...
...
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