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
56becf19
Commit
56becf19
authored
Sep 07, 2021
by
hezhengjun
Committed by
33cn
Sep 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct the gasLimit processing mechanism
parent
fc1057d4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
exec.go
plugin/dapp/evm/executor/exec.go
+4
-5
errors.go
plugin/dapp/evm/executor/vm/model/errors.go
+2
-0
No files found.
plugin/dapp/evm/executor/exec.go
View file @
56becf19
...
@@ -209,20 +209,19 @@ func (evm *EVMExecutor) GetMessage(tx *types.Transaction, index int, fromPtr *co
...
@@ -209,20 +209,19 @@ func (evm *EVMExecutor) GetMessage(tx *types.Transaction, index int, fromPtr *co
return
msg
,
types
.
ErrInvalidAddress
return
msg
,
types
.
ErrInvalidAddress
}
}
gasLimit
:=
action
.
GasLimit
gasPrice
:=
action
.
GasPrice
gasPrice
:=
action
.
GasPrice
if
gasLimit
==
0
{
//gasLimit 直接从交易费1:1转化而来,忽略action.GasLimit
gasLimit
=
uint64
(
evm
.
GetTxFee
(
tx
,
index
))
gasLimit
:
=
uint64
(
evm
.
GetTxFee
(
tx
,
index
))
//如果未设置交易费,则尝试读取免交易费联盟链模式下的gas设置
//如果未设置交易费,则尝试读取免交易费联盟链模式下的gas设置
if
0
==
gasLimit
{
if
0
==
gasLimit
{
cfg
:=
evm
.
GetAPI
()
.
GetConfig
()
cfg
:=
evm
.
GetAPI
()
.
GetConfig
()
conf
:=
types
.
ConfSub
(
cfg
,
evmtypes
.
ExecutorName
)
conf
:=
types
.
ConfSub
(
cfg
,
evmtypes
.
ExecutorName
)
gasLimit
=
uint64
(
conf
.
GInt
(
"evmGasLimit"
))
gasLimit
=
uint64
(
conf
.
GInt
(
"evmGasLimit"
))
if
0
==
gasLimit
{
if
0
==
gasLimit
{
panic
(
"evmGasLimit is not configured for permission blockchain"
)
return
nil
,
model
.
ErrNoGasConfigured
}
}
}
}
}
if
gasPrice
==
0
{
if
gasPrice
==
0
{
gasPrice
=
uint32
(
1
)
gasPrice
=
uint32
(
1
)
}
}
...
...
plugin/dapp/evm/executor/vm/model/errors.go
View file @
56becf19
...
@@ -52,4 +52,6 @@ var (
...
@@ -52,4 +52,6 @@ var (
ErrInvalidJump
=
errors
.
New
(
"invalid jump destination"
)
ErrInvalidJump
=
errors
.
New
(
"invalid jump destination"
)
// ErrInvalidRetsub invalid retsub
// ErrInvalidRetsub invalid retsub
ErrInvalidRetsub
=
errors
.
New
(
"invalid retsub"
)
ErrInvalidRetsub
=
errors
.
New
(
"invalid retsub"
)
// 没有配置gas
ErrNoGasConfigured
=
errors
.
New
(
"ErrNoGasConfigured"
)
)
)
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