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
272dbde3
Unverified
Commit
272dbde3
authored
Jan 25, 2023
by
mergify[bot]
Committed by
GitHub
Jan 25, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into clabby/op-chain-ops/eof-crawler
parents
848f0bcc
438745c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
txmgr.go
op-batcher/batcher/txmgr.go
+10
-1
No files found.
op-batcher/batcher/txmgr.go
View file @
272dbde3
...
@@ -12,6 +12,7 @@ import (
...
@@ -12,6 +12,7 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
)
)
const
networkTimeout
=
2
*
time
.
Second
// How long a single network request can take. TODO: put in a config somewhere
const
networkTimeout
=
2
*
time
.
Second
// How long a single network request can take. TODO: put in a config somewhere
...
@@ -78,12 +79,20 @@ func (t *TransactionManager) calcGasTipAndFeeCap(ctx context.Context) (gasTipCap
...
@@ -78,12 +79,20 @@ func (t *TransactionManager) calcGasTipAndFeeCap(ctx context.Context) (gasTipCap
return
nil
,
nil
,
fmt
.
Errorf
(
"failed to get suggested gas tip cap: %w"
,
err
)
return
nil
,
nil
,
fmt
.
Errorf
(
"failed to get suggested gas tip cap: %w"
,
err
)
}
}
if
gasTipCap
==
nil
{
t
.
log
.
Warn
(
"unexpected unset gasTipCap, using default 2 gwei"
)
gasTipCap
=
new
(
big
.
Int
)
.
SetUint64
(
params
.
GWei
*
2
)
}
childCtx
,
cancel
=
context
.
WithTimeout
(
ctx
,
networkTimeout
)
childCtx
,
cancel
=
context
.
WithTimeout
(
ctx
,
networkTimeout
)
head
,
err
:=
t
.
l1Client
.
HeaderByNumber
(
childCtx
,
nil
)
head
,
err
:=
t
.
l1Client
.
HeaderByNumber
(
childCtx
,
nil
)
cancel
()
cancel
()
if
err
!=
nil
{
if
err
!=
nil
||
head
==
nil
{
return
nil
,
nil
,
fmt
.
Errorf
(
"failed to get L1 head block for fee cap: %w"
,
err
)
return
nil
,
nil
,
fmt
.
Errorf
(
"failed to get L1 head block for fee cap: %w"
,
err
)
}
}
if
head
.
BaseFee
==
nil
{
return
nil
,
nil
,
fmt
.
Errorf
(
"failed to get L1 basefee in block %d for fee cap"
,
head
.
Number
)
}
gasFeeCap
=
txmgr
.
CalcGasFeeCap
(
head
.
BaseFee
,
gasTipCap
)
gasFeeCap
=
txmgr
.
CalcGasFeeCap
(
head
.
BaseFee
,
gasTipCap
)
return
gasTipCap
,
gasFeeCap
,
nil
return
gasTipCap
,
gasFeeCap
,
nil
...
...
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