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
63adcd53
Unverified
Commit
63adcd53
authored
Dec 21, 2022
by
mergify[bot]
Committed by
GitHub
Dec 21, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jg/blocktime_test
parents
f78901da
ea396762
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
14 deletions
+28
-14
driver.go
op-batcher/batcher/driver.go
+1
-1
txmgr.go
op-batcher/batcher/txmgr.go
+3
-3
l2_proposer.go
op-e2e/actions/l2_proposer.go
+6
-1
driver.go
op-proposer/proposer/driver.go
+11
-5
l2_output_submitter.go
op-proposer/proposer/l2_output_submitter.go
+7
-4
No files found.
op-batcher/batcher/driver.go
View file @
63adcd53
...
@@ -84,7 +84,7 @@ func NewBatchSubmitter(cfg Config, l log.Logger) (*BatchSubmitter, error) {
...
@@ -84,7 +84,7 @@ func NewBatchSubmitter(cfg Config, l log.Logger) (*BatchSubmitter, error) {
signer
:=
func
(
chainID
*
big
.
Int
)
SignerFn
{
signer
:=
func
(
chainID
*
big
.
Int
)
SignerFn
{
s
:=
types
.
LatestSignerForChainID
(
chainID
)
s
:=
types
.
LatestSignerForChainID
(
chainID
)
return
func
(
rawTx
types
.
TxData
)
(
*
types
.
Transaction
,
error
)
{
return
func
(
_
context
.
Context
,
rawTx
types
.
TxData
)
(
*
types
.
Transaction
,
error
)
{
return
types
.
SignNewTx
(
sequencerPrivKey
,
s
,
rawTx
)
return
types
.
SignNewTx
(
sequencerPrivKey
,
s
,
rawTx
)
}
}
}
}
...
...
op-batcher/batcher/txmgr.go
View file @
63adcd53
...
@@ -16,7 +16,7 @@ import (
...
@@ -16,7 +16,7 @@ import (
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
type
SignerFn
func
(
rawTx
types
.
TxData
)
(
*
types
.
Transaction
,
error
)
type
SignerFn
func
(
ctx
context
.
Context
,
rawTx
types
.
TxData
)
(
*
types
.
Transaction
,
error
)
// TransactionManager wraps the simple txmgr package to make it easy to send & wait for transactions
// TransactionManager wraps the simple txmgr package to make it easy to send & wait for transactions
type
TransactionManager
struct
{
type
TransactionManager
struct
{
...
@@ -121,7 +121,7 @@ func (t *TransactionManager) CraftTx(ctx context.Context, data []byte) (*types.T
...
@@ -121,7 +121,7 @@ func (t *TransactionManager) CraftTx(ctx context.Context, data []byte) (*types.T
}
}
rawTx
.
Gas
=
gas
rawTx
.
Gas
=
gas
return
t
.
signerFn
(
rawTx
)
return
t
.
signerFn
(
ctx
,
rawTx
)
}
}
// UpdateGasPrice signs an otherwise identical txn to the one provided but with
// UpdateGasPrice signs an otherwise identical txn to the one provided but with
...
@@ -146,5 +146,5 @@ func (t *TransactionManager) UpdateGasPrice(ctx context.Context, tx *types.Trans
...
@@ -146,5 +146,5 @@ func (t *TransactionManager) UpdateGasPrice(ctx context.Context, tx *types.Trans
// Only log the new tip/fee cap because the updateGasPrice closure reuses the same initial transaction
// Only log the new tip/fee cap because the updateGasPrice closure reuses the same initial transaction
t
.
log
.
Trace
(
"updating gas price"
,
"tip_cap"
,
gasTipCap
,
"fee_cap"
,
gasFeeCap
)
t
.
log
.
Trace
(
"updating gas price"
,
"tip_cap"
,
gasTipCap
,
"fee_cap"
,
gasFeeCap
)
return
t
.
signerFn
(
rawTx
)
return
t
.
signerFn
(
ctx
,
rawTx
)
}
}
op-e2e/actions/l2_proposer.go
View file @
63adcd53
package
actions
package
actions
import
(
import
(
"context"
"crypto/ecdsa"
"crypto/ecdsa"
"math/big"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
@@ -32,6 +34,7 @@ type L2Proposer struct {
...
@@ -32,6 +34,7 @@ type L2Proposer struct {
func
NewL2Proposer
(
t
Testing
,
log
log
.
Logger
,
cfg
*
ProposerCfg
,
l1
*
ethclient
.
Client
,
rollupCl
*
sources
.
RollupClient
)
*
L2Proposer
{
func
NewL2Proposer
(
t
Testing
,
log
log
.
Logger
,
cfg
*
ProposerCfg
,
l1
*
ethclient
.
Client
,
rollupCl
*
sources
.
RollupClient
)
*
L2Proposer
{
chainID
,
err
:=
l1
.
ChainID
(
t
.
Ctx
())
chainID
,
err
:=
l1
.
ChainID
(
t
.
Ctx
())
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
signer
:=
opcrypto
.
PrivateKeySignerFn
(
cfg
.
ProposerKey
,
chainID
)
dr
,
err
:=
proposer
.
NewDriver
(
proposer
.
DriverConfig
{
dr
,
err
:=
proposer
.
NewDriver
(
proposer
.
DriverConfig
{
Log
:
log
,
Log
:
log
,
Name
:
"proposer"
,
Name
:
"proposer"
,
...
@@ -40,7 +43,9 @@ func NewL2Proposer(t Testing, log log.Logger, cfg *ProposerCfg, l1 *ethclient.Cl
...
@@ -40,7 +43,9 @@ func NewL2Proposer(t Testing, log log.Logger, cfg *ProposerCfg, l1 *ethclient.Cl
AllowNonFinalized
:
cfg
.
AllowNonFinalized
,
AllowNonFinalized
:
cfg
.
AllowNonFinalized
,
L2OOAddr
:
cfg
.
OutputOracleAddr
,
L2OOAddr
:
cfg
.
OutputOracleAddr
,
From
:
crypto
.
PubkeyToAddress
(
cfg
.
ProposerKey
.
PublicKey
),
From
:
crypto
.
PubkeyToAddress
(
cfg
.
ProposerKey
.
PublicKey
),
SignerFn
:
opcrypto
.
PrivateKeySignerFn
(
cfg
.
ProposerKey
,
chainID
),
SignerFn
:
func
(
_
context
.
Context
,
addr
common
.
Address
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
return
signer
(
addr
,
tx
)
},
})
})
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
return
&
L2Proposer
{
return
&
L2Proposer
{
...
...
op-proposer/proposer/driver.go
View file @
63adcd53
...
@@ -22,6 +22,8 @@ import (
...
@@ -22,6 +22,8 @@ import (
var
bigOne
=
big
.
NewInt
(
1
)
var
bigOne
=
big
.
NewInt
(
1
)
var
supportedL2OutputVersion
=
eth
.
Bytes32
{}
var
supportedL2OutputVersion
=
eth
.
Bytes32
{}
type
SignerFn
func
(
context
.
Context
,
common
.
Address
,
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
type
DriverConfig
struct
{
type
DriverConfig
struct
{
Log
log
.
Logger
Log
log
.
Logger
Name
string
Name
string
...
@@ -44,7 +46,7 @@ type DriverConfig struct {
...
@@ -44,7 +46,7 @@ type DriverConfig struct {
From
common
.
Address
From
common
.
Address
// SignerFn is the function used to sign transactions
// SignerFn is the function used to sign transactions
SignerFn
bind
.
SignerFn
SignerFn
SignerFn
}
}
type
Driver
struct
{
type
Driver
struct
{
...
@@ -183,7 +185,9 @@ func (d *Driver) CraftTx(ctx context.Context, start, end, nonce *big.Int) (*type
...
@@ -183,7 +185,9 @@ func (d *Driver) CraftTx(ctx context.Context, start, end, nonce *big.Int) (*type
opts
:=
&
bind
.
TransactOpts
{
opts
:=
&
bind
.
TransactOpts
{
From
:
d
.
cfg
.
From
,
From
:
d
.
cfg
.
From
,
Signer
:
d
.
cfg
.
SignerFn
,
Signer
:
func
(
addr
common
.
Address
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
return
d
.
cfg
.
SignerFn
(
ctx
,
addr
,
tx
)
},
Context
:
ctx
,
Context
:
ctx
,
Nonce
:
nonce
,
Nonce
:
nonce
,
NoSend
:
true
,
NoSend
:
true
,
...
@@ -226,7 +230,9 @@ func (d *Driver) CraftTx(ctx context.Context, start, end, nonce *big.Int) (*type
...
@@ -226,7 +230,9 @@ func (d *Driver) CraftTx(ctx context.Context, start, end, nonce *big.Int) (*type
func
(
d
*
Driver
)
UpdateGasPrice
(
ctx
context
.
Context
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
func
(
d
*
Driver
)
UpdateGasPrice
(
ctx
context
.
Context
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
opts
:=
&
bind
.
TransactOpts
{
opts
:=
&
bind
.
TransactOpts
{
From
:
d
.
cfg
.
From
,
From
:
d
.
cfg
.
From
,
Signer
:
d
.
cfg
.
SignerFn
,
Signer
:
func
(
addr
common
.
Address
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
return
d
.
cfg
.
SignerFn
(
ctx
,
addr
,
tx
)
},
Context
:
ctx
,
Context
:
ctx
,
Nonce
:
new
(
big
.
Int
)
.
SetUint64
(
tx
.
Nonce
()),
Nonce
:
new
(
big
.
Int
)
.
SetUint64
(
tx
.
Nonce
()),
NoSend
:
true
,
NoSend
:
true
,
...
...
op-proposer/proposer/l2_output_submitter.go
View file @
63adcd53
...
@@ -15,8 +15,8 @@ import (
...
@@ -15,8 +15,8 @@ import (
hdwallet
"github.com/ethereum-optimism/go-ethereum-hdwallet"
hdwallet
"github.com/ethereum-optimism/go-ethereum-hdwallet"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
...
@@ -161,13 +161,16 @@ func NewL2OutputSubmitter(
...
@@ -161,13 +161,16 @@ func NewL2OutputSubmitter(
}
}
}
}
signer
:=
func
(
chainID
*
big
.
Int
)
bind
.
SignerFn
{
signer
:=
func
(
chainID
*
big
.
Int
)
SignerFn
{
return
opcrypto
.
PrivateKeySignerFn
(
l2OutputPrivKey
,
chainID
)
s
:=
opcrypto
.
PrivateKeySignerFn
(
l2OutputPrivKey
,
chainID
)
return
func
(
_
context
.
Context
,
addr
common
.
Address
,
tx
*
types
.
Transaction
)
(
*
types
.
Transaction
,
error
)
{
return
s
(
addr
,
tx
)
}
}
}
return
NewL2OutputSubmitterWithSigner
(
cfg
,
crypto
.
PubkeyToAddress
(
l2OutputPrivKey
.
PublicKey
),
signer
,
gitVersion
,
l
)
return
NewL2OutputSubmitterWithSigner
(
cfg
,
crypto
.
PubkeyToAddress
(
l2OutputPrivKey
.
PublicKey
),
signer
,
gitVersion
,
l
)
}
}
type
SignerFactory
func
(
chainID
*
big
.
Int
)
bind
.
SignerFn
type
SignerFactory
func
(
chainID
*
big
.
Int
)
SignerFn
func
NewL2OutputSubmitterWithSigner
(
func
NewL2OutputSubmitterWithSigner
(
cfg
Config
,
cfg
Config
,
...
...
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