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
d60cfd26
Unverified
Commit
d60cfd26
authored
Aug 09, 2021
by
shawn
Committed by
GitHub
Aug 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix london-check to avoid duplication (#23333)
Co-authored-by:
lxex
<
liuxmzc1@163.com
>
parent
9e59474e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
state_transition.go
core/state_transition.go
+4
-2
No files found.
core/state_transition.go
View file @
d60cfd26
...
...
@@ -287,6 +287,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
sender
:=
vm
.
AccountRef
(
msg
.
From
())
homestead
:=
st
.
evm
.
ChainConfig
()
.
IsHomestead
(
st
.
evm
.
Context
.
BlockNumber
)
istanbul
:=
st
.
evm
.
ChainConfig
()
.
IsIstanbul
(
st
.
evm
.
Context
.
BlockNumber
)
london
:=
st
.
evm
.
ChainConfig
()
.
IsLondon
(
st
.
evm
.
Context
.
BlockNumber
)
contractCreation
:=
msg
.
To
()
==
nil
// Check clauses 4-5, subtract intrinsic gas if everything is correct
...
...
@@ -319,7 +320,8 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
st
.
state
.
SetNonce
(
msg
.
From
(),
st
.
state
.
GetNonce
(
sender
.
Address
())
+
1
)
ret
,
st
.
gas
,
vmerr
=
st
.
evm
.
Call
(
sender
,
st
.
to
(),
st
.
data
,
st
.
gas
,
st
.
value
)
}
if
!
st
.
evm
.
ChainConfig
()
.
IsLondon
(
st
.
evm
.
Context
.
BlockNumber
)
{
if
!
london
{
// Before EIP-3529: refunds were capped to gasUsed / 2
st
.
refundGas
(
params
.
RefundQuotient
)
}
else
{
...
...
@@ -327,7 +329,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
st
.
refundGas
(
params
.
RefundQuotientEIP3529
)
}
effectiveTip
:=
st
.
gasPrice
if
st
.
evm
.
ChainConfig
()
.
IsLondon
(
st
.
evm
.
Context
.
BlockNumber
)
{
if
london
{
effectiveTip
=
cmath
.
BigMin
(
st
.
gasTipCap
,
new
(
big
.
Int
)
.
Sub
(
st
.
gasFeeCap
,
st
.
evm
.
Context
.
BaseFee
))
}
st
.
state
.
AddBalance
(
st
.
evm
.
Context
.
Coinbase
,
new
(
big
.
Int
)
.
Mul
(
new
(
big
.
Int
)
.
SetUint64
(
st
.
gasUsed
()),
effectiveTip
))
...
...
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