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
4cbc6d1e
Commit
4cbc6d1e
authored
Mar 23, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes to move chain id into txmgr config
parent
de98bbff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
18 deletions
+12
-18
driver.go
op-batcher/batcher/driver.go
+1
-0
l2_proposer.go
op-e2e/actions/l2_proposer.go
+1
-0
l2_output_submitter.go
op-proposer/proposer/l2_output_submitter.go
+6
-0
txmgr.go
op-service/txmgr/txmgr.go
+4
-18
No files found.
op-batcher/batcher/driver.go
View file @
4cbc6d1e
...
@@ -80,6 +80,7 @@ func NewBatchSubmitterFromCLIConfig(cfg CLIConfig, l log.Logger, m metrics.Metri
...
@@ -80,6 +80,7 @@ func NewBatchSubmitterFromCLIConfig(cfg CLIConfig, l log.Logger, m metrics.Metri
NumConfirmations
:
cfg
.
NumConfirmations
,
NumConfirmations
:
cfg
.
NumConfirmations
,
SafeAbortNonceTooLowCount
:
cfg
.
SafeAbortNonceTooLowCount
,
SafeAbortNonceTooLowCount
:
cfg
.
SafeAbortNonceTooLowCount
,
From
:
fromAddress
,
From
:
fromAddress
,
ChainID
:
rcfg
.
L1ChainID
,
Signer
:
signer
(
rcfg
.
L1ChainID
),
Signer
:
signer
(
rcfg
.
L1ChainID
),
}
}
...
...
op-e2e/actions/l2_proposer.go
View file @
4cbc6d1e
...
@@ -51,6 +51,7 @@ func NewL2Proposer(t Testing, log log.Logger, cfg *ProposerCfg, l1 *ethclient.Cl
...
@@ -51,6 +51,7 @@ func NewL2Proposer(t Testing, log log.Logger, cfg *ProposerCfg, l1 *ethclient.Cl
NumConfirmations
:
1
,
NumConfirmations
:
1
,
SafeAbortNonceTooLowCount
:
4
,
SafeAbortNonceTooLowCount
:
4
,
From
:
from
,
From
:
from
,
ChainID
:
big
.
NewInt
(
420
),
// Signer is loaded in `proposer.NewL2OutputSubmitter`
// Signer is loaded in `proposer.NewL2OutputSubmitter`
},
},
L1Client
:
l1
,
L1Client
:
l1
,
...
...
op-proposer/proposer/l2_output_submitter.go
View file @
4cbc6d1e
...
@@ -166,12 +166,18 @@ func NewL2OutputSubmitterFromCLIConfig(cfg CLIConfig, l log.Logger) (*L2OutputSu
...
@@ -166,12 +166,18 @@ func NewL2OutputSubmitterFromCLIConfig(cfg CLIConfig, l log.Logger) (*L2OutputSu
return
nil
,
err
return
nil
,
err
}
}
chainID
,
err
:=
l1Client
.
ChainID
(
context
.
Background
())
if
err
!=
nil
{
return
nil
,
err
}
txMgrConfg
:=
txmgr
.
Config
{
txMgrConfg
:=
txmgr
.
Config
{
ResubmissionTimeout
:
cfg
.
ResubmissionTimeout
,
ResubmissionTimeout
:
cfg
.
ResubmissionTimeout
,
ReceiptQueryInterval
:
time
.
Second
,
ReceiptQueryInterval
:
time
.
Second
,
NumConfirmations
:
cfg
.
NumConfirmations
,
NumConfirmations
:
cfg
.
NumConfirmations
,
SafeAbortNonceTooLowCount
:
cfg
.
SafeAbortNonceTooLowCount
,
SafeAbortNonceTooLowCount
:
cfg
.
SafeAbortNonceTooLowCount
,
From
:
fromAddress
,
From
:
fromAddress
,
ChainID
:
chainID
,
}
}
proposerCfg
:=
Config
{
proposerCfg
:=
Config
{
...
...
op-service/txmgr/txmgr.go
View file @
4cbc6d1e
...
@@ -41,6 +41,9 @@ type Config struct {
...
@@ -41,6 +41,9 @@ type Config struct {
// attempted.
// attempted.
ResubmissionTimeout
time
.
Duration
ResubmissionTimeout
time
.
Duration
// ChainID is the chain ID of the L1 chain.
ChainID
*
big
.
Int
// NetworkTimeout is the allowed duration for a single network request.
// NetworkTimeout is the allowed duration for a single network request.
// This is intended to be used for network requests that can be replayed.
// This is intended to be used for network requests that can be replayed.
//
//
...
@@ -109,8 +112,6 @@ type ETHBackend interface {
...
@@ -109,8 +112,6 @@ type ETHBackend interface {
/// EstimateGas returns an estimate of the amount of gas needed to execute the given
/// EstimateGas returns an estimate of the amount of gas needed to execute the given
/// transaction against the current pending block.
/// transaction against the current pending block.
EstimateGas
(
ctx
context
.
Context
,
msg
ethereum
.
CallMsg
)
(
uint64
,
error
)
EstimateGas
(
ctx
context
.
Context
,
msg
ethereum
.
CallMsg
)
(
uint64
,
error
)
// ChainID returns the chain ID for this ethereum chain.
ChainID
(
ctx
context
.
Context
)
(
*
big
.
Int
,
error
)
}
}
// SimpleTxManager is a implementation of TxManager that performs linear fee
// SimpleTxManager is a implementation of TxManager that performs linear fee
...
@@ -184,18 +185,6 @@ func (m *SimpleTxManager) CraftTx(ctx context.Context, candidate TxCandidate) (*
...
@@ -184,18 +185,6 @@ func (m *SimpleTxManager) CraftTx(ctx context.Context, candidate TxCandidate) (*
return
nil
,
fmt
.
Errorf
(
"failed to get nonce: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to get nonce: %w"
,
err
)
}
}
// If the configured chain ID is nil (can occur if the fetch fails in the constructor),
// we need to try to fetch it again from the backend.
if
m
.
chainID
==
nil
{
childCtx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
m
.
Config
.
NetworkTimeout
)
defer
cancel
()
chainID
,
err
:=
m
.
backend
.
ChainID
(
childCtx
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to get chain ID: %w"
,
err
)
}
m
.
chainID
=
chainID
}
rawTx
:=
&
types
.
DynamicFeeTx
{
rawTx
:=
&
types
.
DynamicFeeTx
{
ChainID
:
m
.
chainID
,
ChainID
:
m
.
chainID
,
Nonce
:
nonce
,
Nonce
:
nonce
,
...
@@ -329,11 +318,8 @@ func NewSimpleTxManager(name string, l log.Logger, cfg Config, backend ETHBacken
...
@@ -329,11 +318,8 @@ func NewSimpleTxManager(name string, l log.Logger, cfg Config, backend ETHBacken
cfg
.
NetworkTimeout
=
2
*
time
.
Second
cfg
.
NetworkTimeout
=
2
*
time
.
Second
}
}
// On error, ignore. We will try to get the chainID again when used.
chainID
,
_
:=
backend
.
ChainID
(
context
.
Background
())
return
&
SimpleTxManager
{
return
&
SimpleTxManager
{
chainID
:
chainID
,
chainID
:
c
fg
.
C
hainID
,
name
:
name
,
name
:
name
,
Config
:
cfg
,
Config
:
cfg
,
backend
:
backend
,
backend
:
backend
,
...
...
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