Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
exchain
nebula
Commits
b6c28d5d
Unverified
Commit
b6c28d5d
authored
Dec 02, 2024
by
zhiqiangxu
Committed by
GitHub
Dec 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
estimate gas correctly for blob tx in increaseGasPrice (#13116)
parent
4c0387b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
txmgr.go
op-service/txmgr/txmgr.go
+18
-11
No files found.
op-service/txmgr/txmgr.go
View file @
b6c28d5d
...
...
@@ -803,14 +803,30 @@ func (m *SimpleTxManager) increaseGasPrice(ctx context.Context, tx *types.Transa
}
// Re-estimate gaslimit in case things have changed or a previous gaslimit estimate was wrong
gas
,
err
:=
m
.
backend
.
EstimateGas
(
ctx
,
ethereum
.
CallMsg
{
callMsg
:=
ethereum
.
CallMsg
{
From
:
m
.
cfg
.
From
,
To
:
tx
.
To
(),
GasTipCap
:
bumpedTip
,
GasFeeCap
:
bumpedFee
,
Data
:
tx
.
Data
(),
Value
:
tx
.
Value
(),
})
}
var
bumpedBlobFee
*
big
.
Int
if
tx
.
Type
()
==
types
.
BlobTxType
{
// Blob transactions have an additional blob gas price we must specify, so we must make sure it is
// getting bumped appropriately.
bumpedBlobFee
=
calcThresholdValue
(
tx
.
BlobGasFeeCap
(),
true
)
if
bumpedBlobFee
.
Cmp
(
blobBaseFee
)
<
0
{
bumpedBlobFee
=
blobBaseFee
}
if
err
:=
m
.
checkBlobFeeLimits
(
blobBaseFee
,
bumpedBlobFee
);
err
!=
nil
{
return
nil
,
err
}
callMsg
.
BlobGasFeeCap
=
bumpedBlobFee
callMsg
.
BlobHashes
=
tx
.
BlobHashes
()
}
gas
,
err
:=
m
.
backend
.
EstimateGas
(
ctx
,
callMsg
)
if
err
!=
nil
{
// If this is a transaction resubmission, we sometimes see this outcome because the
// original tx can get included in a block just before the above call. In this case the
...
...
@@ -836,15 +852,6 @@ func (m *SimpleTxManager) increaseGasPrice(ctx context.Context, tx *types.Transa
var
newTx
*
types
.
Transaction
if
tx
.
Type
()
==
types
.
BlobTxType
{
// Blob transactions have an additional blob gas price we must specify, so we must make sure it is
// getting bumped appropriately.
bumpedBlobFee
:=
calcThresholdValue
(
tx
.
BlobGasFeeCap
(),
true
)
if
bumpedBlobFee
.
Cmp
(
blobBaseFee
)
<
0
{
bumpedBlobFee
=
blobBaseFee
}
if
err
:=
m
.
checkBlobFeeLimits
(
blobBaseFee
,
bumpedBlobFee
);
err
!=
nil
{
return
nil
,
err
}
message
:=
&
types
.
BlobTx
{
Nonce
:
tx
.
Nonce
(),
To
:
*
tx
.
To
(),
...
...
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