good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Erigon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
a
Erigon
Commits
db86092c
Unverified
Commit
db86092c
authored
3 years ago
by
Andrew Ashikhmin
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove unnecessary value transfer check from TransitionDb (#2424)
parent
054581f5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/error.go
+0
-4
0 additions, 4 deletions
core/error.go
core/state_transition.go
+2
-11
2 additions, 11 deletions
core/state_transition.go
with
2 additions
and
15 deletions
core/error.go
+
0
−
4
View file @
db86092c
...
...
@@ -65,10 +65,6 @@ var (
// by a transaction is higher than what's left in the block.
ErrGasLimitReached
=
errors
.
New
(
"gas limit reached"
)
// ErrInsufficientFundsForTransfer is returned if the transaction sender doesn't
// have enough funds for transfer(topmost call only).
ErrInsufficientFundsForTransfer
=
errors
.
New
(
"insufficient funds for transfer"
)
// ErrInsufficientFunds is returned if the total cost of executing a transaction
// is higher than the balance of the user's account.
ErrInsufficientFunds
=
errors
.
New
(
"insufficient funds for gas * price + value"
)
...
...
This diff is collapsed.
Click to expand it.
core/state_transition.go
+
2
−
11
View file @
db86092c
...
...
@@ -287,7 +287,7 @@ func (st *StateTransition) TransitionDb(refunds bool, gasBailout bool) (*Executi
// 5. there is no overflow when calculating intrinsic gas
// 6. caller has enough balance to cover asset transfer for **topmost** call
// Check clauses 1-3, buy gas if everything is correct
// Check clauses 1-3
and 6
, buy gas if everything is correct
if
err
:=
st
.
preCheck
(
gasBailout
);
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -308,15 +308,6 @@ func (st *StateTransition) TransitionDb(refunds bool, gasBailout bool) (*Executi
}
st
.
gas
-=
gas
// Check clause 6
var
bailout
bool
if
!
msg
.
Value
()
.
IsZero
()
&&
!
st
.
evm
.
Context
.
CanTransfer
(
st
.
state
,
msg
.
From
(),
msg
.
Value
())
{
if
gasBailout
{
bailout
=
true
}
else
{
return
nil
,
fmt
.
Errorf
(
"%w: address %v"
,
ErrInsufficientFundsForTransfer
,
msg
.
From
()
.
Hex
())
}
}
// Set up the initial access list.
if
st
.
evm
.
ChainRules
.
IsBerlin
{
st
.
state
.
PrepareAccessList
(
msg
.
From
(),
msg
.
To
(),
st
.
evm
.
ActivePrecompiles
(),
msg
.
AccessList
())
...
...
@@ -335,7 +326,7 @@ func (st *StateTransition) TransitionDb(refunds bool, gasBailout bool) (*Executi
}
else
{
// Increment the nonce for the next transaction
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
,
b
ailout
)
ret
,
st
.
gas
,
vmerr
=
st
.
evm
.
Call
(
sender
,
st
.
to
(),
st
.
data
,
st
.
gas
,
st
.
value
,
gasB
ailout
)
}
if
refunds
{
if
london
{
...
...
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