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
ede11f1a
Unverified
Commit
ede11f1a
authored
3 years ago
by
Alex Sharov
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Revert "buy gas optimize (#2360)" (#2367)
This reverts commit
7c95f391
.
parent
7c95f391
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/state_transition.go
+2
-10
2 additions, 10 deletions
core/state_transition.go
with
2 additions
and
10 deletions
core/state_transition.go
+
2
−
10
View file @
ede11f1a
...
...
@@ -58,10 +58,6 @@ type StateTransition struct {
data
[]
byte
state
vm
.
IntraBlockState
evm
*
vm
.
EVM
//some pre-allocated intermediate variables
sharedBuyGas
*
uint256
.
Int
sharedBuyGasBalance
*
uint256
.
Int
}
// Message represents a message sent to a contract.
...
...
@@ -169,9 +165,6 @@ func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool) *StateTransition
value
:
msg
.
Value
(),
data
:
msg
.
Data
(),
state
:
evm
.
IntraBlockState
,
sharedBuyGas
:
uint256
.
NewInt
(
0
),
sharedBuyGasBalance
:
uint256
.
NewInt
(
0
),
}
}
...
...
@@ -198,12 +191,11 @@ func (st *StateTransition) to() common.Address {
}
func
(
st
*
StateTransition
)
buyGas
(
gasBailout
bool
)
error
{
mgval
:=
st
.
sharedBuyGas
mgval
.
SetUint64
(
st
.
msg
.
Gas
())
mgval
:=
uint256
.
NewInt
(
st
.
msg
.
Gas
())
mgval
=
mgval
.
Mul
(
mgval
,
st
.
gasPrice
)
balanceCheck
:=
mgval
if
st
.
gasFeeCap
!=
nil
{
balanceCheck
=
st
.
sharedBuyGasBalance
.
SetUint64
(
st
.
msg
.
Gas
())
balanceCheck
=
uint256
.
NewInt
(
st
.
msg
.
Gas
())
balanceCheck
=
balanceCheck
.
Mul
(
balanceCheck
,
st
.
gasFeeCap
)
}
if
have
,
want
:=
st
.
state
.
GetBalance
(
st
.
msg
.
From
()),
balanceCheck
;
have
.
Cmp
(
want
)
<
0
{
...
...
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