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
0f5260dc
Unverified
Commit
0f5260dc
authored
Oct 07, 2022
by
mergify[bot]
Committed by
GitHub
Oct 07, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3671 from ethereum-optimism/action-rpcs
op-node: make rollup node RPC testable in op-e2e
parents
9e0151d5
e9628932
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
156 additions
and
65 deletions
+156
-65
batch_submitter.go
op-batcher/batch_submitter.go
+9
-9
l1_replica.go
op-e2e/actions/l1_replica.go
+10
-3
l2_engine.go
op-e2e/actions/l2_engine.go
+9
-0
l2_sequencer.go
op-e2e/actions/l2_sequencer.go
+1
-1
l2_verifier.go
op-e2e/actions/l2_verifier.go
+86
-7
l2_verifier_test.go
op-e2e/actions/l2_verifier_test.go
+13
-14
system_test.go
op-e2e/system_test.go
+3
-2
api.go
op-node/node/api.go
+9
-5
node.go
op-node/node/node.go
+1
-1
server.go
op-node/node/server.go
+1
-1
rollupclient.go
op-node/sources/rollupclient.go
+3
-3
metrics.go
op-node/testutils/metrics.go
+6
-0
l2_output_submitter.go
op-proposer/l2_output_submitter.go
+5
-5
rollupclient.go
op-proposer/rollupclient/rollupclient.go
+0
-14
No files found.
op-batcher/batch_submitter.go
View file @
0f5260dc
...
...
@@ -16,18 +16,16 @@ import (
"syscall"
"time"
"github.com/ethereum-optimism/optimism/op-batcher/sequencer"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
opmetrics
"github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc
"github.com/ethereum-optimism/optimism/op-service/rpc"
hdwallet
"github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-batcher/sequencer"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
...
...
@@ -36,6 +34,8 @@ import (
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
hdwallet
"github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli"
)
const
(
...
...
@@ -495,12 +495,12 @@ func dialRollupClientWithTimeout(ctx context.Context, url string) (*sources.Roll
ctxt
,
cancel
:=
context
.
WithTimeout
(
ctx
,
defaultDialTimeout
)
defer
cancel
()
client
,
err
:=
rpc
.
DialContext
(
ctxt
,
url
)
rpcCl
,
err
:=
rpc
.
DialContext
(
ctxt
,
url
)
if
err
!=
nil
{
return
nil
,
err
}
return
sources
.
NewRollupClient
(
client
),
nil
return
sources
.
NewRollupClient
(
client
.
NewBaseRPCClient
(
rpcCl
)
),
nil
}
// parseAddress parses an ETH address from a hex string. This method will fail if
...
...
op-e2e/actions/l1_replica.go
View file @
0f5260dc
...
...
@@ -4,6 +4,10 @@ import (
"errors"
"fmt"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
...
...
@@ -15,9 +19,6 @@ import (
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/testutils"
)
// L1CanonSrc is used to sync L1 from another node.
...
...
@@ -170,6 +171,12 @@ func (s *L1Replica) RPCClient() client.RPC {
}
}
func
(
s
*
L1Replica
)
L1Client
(
t
Testing
,
cfg
*
rollup
.
Config
)
*
sources
.
L1Client
{
l1F
,
err
:=
sources
.
NewL1Client
(
s
.
RPCClient
(),
s
.
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
cfg
,
false
))
require
.
NoError
(
t
,
err
)
return
l1F
}
// ActL1FinalizeNext finalizes the next block, which must be marked as safe before doing so (see ActL1SafeNext).
func
(
s
*
L1Replica
)
ActL1FinalizeNext
(
t
Testing
)
{
safe
:=
s
.
l1Chain
.
CurrentSafeBlock
()
...
...
op-e2e/actions/l2_engine.go
View file @
0f5260dc
...
...
@@ -4,6 +4,8 @@ import (
"errors"
"fmt"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/beacon"
...
...
@@ -21,6 +23,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testutils"
)
...
...
@@ -130,6 +133,12 @@ func (e *L2Engine) RPCClient() client.RPC {
}
}
func
(
e
*
L2Engine
)
EngineClient
(
t
Testing
,
cfg
*
rollup
.
Config
)
*
sources
.
EngineClient
{
l2Cl
,
err
:=
sources
.
NewEngineClient
(
e
.
RPCClient
(),
e
.
log
,
nil
,
sources
.
EngineClientDefaultConfig
(
cfg
))
require
.
NoError
(
t
,
err
)
return
l2Cl
}
// ActL2RPCFail makes the next L2 RPC request fail
func
(
e
*
L2Engine
)
ActL2RPCFail
(
t
Testing
)
{
if
e
.
failL2RPC
!=
nil
{
// already set to fail?
...
...
op-e2e/actions/l2_sequencer.go
View file @
0f5260dc
...
...
@@ -22,7 +22,7 @@ type L2Sequencer struct {
failL2GossipUnsafeBlock
error
// mock error
}
func
NewL2Sequencer
(
log
log
.
Logger
,
l1
derive
.
L1Fetcher
,
eng
derive
.
Engine
,
cfg
*
rollup
.
Config
,
seqConfDepth
uint64
)
*
L2Sequencer
{
func
NewL2Sequencer
(
log
log
.
Logger
,
l1
derive
.
L1Fetcher
,
eng
L2API
,
cfg
*
rollup
.
Config
,
seqConfDepth
uint64
)
*
L2Sequencer
{
ver
:=
NewL2Verifier
(
log
,
l1
,
eng
,
cfg
)
return
&
L2Sequencer
{
L2Verifier
:
*
ver
,
...
...
op-e2e/actions/l2_verifier.go
View file @
0f5260dc
package
actions
import
(
"context"
"errors"
"io"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/node"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
gnode
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/rpc"
"github.com/stretchr/testify/require"
)
// L2Verifier is an actor that functions like a rollup node,
...
...
@@ -32,13 +37,25 @@ type L2Verifier struct {
l2Building
bool
rollupCfg
*
rollup
.
Config
rpc
*
rpc
.
Server
failRPC
error
// mock error
}
type
L2API
interface
{
derive
.
Engine
InfoByRpcNumber
(
ctx
context
.
Context
,
num
rpc
.
BlockNumber
)
(
eth
.
BlockInfo
,
error
)
// GetProof returns a proof of the account, it may return a nil result without error if the address was not found.
GetProof
(
ctx
context
.
Context
,
address
common
.
Address
,
blockTag
string
)
(
*
eth
.
AccountResult
,
error
)
}
func
NewL2Verifier
(
log
log
.
Logger
,
l1
derive
.
L1Fetcher
,
eng
derive
.
Engine
,
cfg
*
rollup
.
Config
)
*
L2Verifier
{
func
NewL2Verifier
(
log
log
.
Logger
,
l1
derive
.
L1Fetcher
,
eng
L2API
,
cfg
*
rollup
.
Config
)
*
L2Verifier
{
metrics
:=
&
testutils
.
TestDerivationMetrics
{}
pipeline
:=
derive
.
NewDerivationPipeline
(
log
,
cfg
,
l1
,
eng
,
metrics
)
pipeline
.
Reset
()
return
&
L2Verifier
{
rollupNode
:=
&
L2Verifier
{
log
:
log
,
eng
:
eng
,
derivation
:
pipeline
,
...
...
@@ -47,7 +64,44 @@ func NewL2Verifier(log log.Logger, l1 derive.L1Fetcher, eng derive.Engine, cfg *
l2PipelineIdle
:
true
,
l2Building
:
false
,
rollupCfg
:
cfg
,
rpc
:
rpc
.
NewServer
(),
}
// setup RPC server for rollup node, hooked to the actor as backend
m
:=
&
testutils
.
TestRPCMetrics
{}
backend
:=
&
l2VerifierBackend
{
verifier
:
rollupNode
}
apis
:=
[]
rpc
.
API
{
{
Namespace
:
"optimism"
,
Service
:
node
.
NewNodeAPI
(
cfg
,
eng
,
backend
,
log
,
m
),
Public
:
true
,
Authenticated
:
false
,
},
{
Namespace
:
"admin"
,
Version
:
""
,
Service
:
node
.
NewAdminAPI
(
backend
,
m
),
Public
:
true
,
// TODO: this field is deprecated. Do we even need this anymore?
Authenticated
:
false
,
},
}
if
err
:=
gnode
.
RegisterApis
(
apis
,
nil
,
rollupNode
.
rpc
);
err
!=
nil
{
panic
(
err
)
}
return
rollupNode
}
type
l2VerifierBackend
struct
{
verifier
*
L2Verifier
}
func
(
s
*
l2VerifierBackend
)
SyncStatus
(
ctx
context
.
Context
)
(
*
eth
.
SyncStatus
,
error
)
{
return
s
.
verifier
.
SyncStatus
(),
nil
}
func
(
s
*
l2VerifierBackend
)
ResetDerivationPipeline
(
ctx
context
.
Context
)
error
{
s
.
verifier
.
derivation
.
Reset
()
return
nil
}
func
(
s
*
L2Verifier
)
SyncStatus
()
*
eth
.
SyncStatus
{
...
...
@@ -62,6 +116,31 @@ func (s *L2Verifier) SyncStatus() *eth.SyncStatus {
}
}
func
(
s
*
L2Verifier
)
RollupClient
()
*
sources
.
RollupClient
{
return
sources
.
NewRollupClient
(
s
.
RPCClient
())
}
func
(
s
*
L2Verifier
)
RPCClient
()
client
.
RPC
{
cl
:=
rpc
.
DialInProc
(
s
.
rpc
)
return
testutils
.
RPCErrFaker
{
RPC
:
client
.
NewBaseRPCClient
(
cl
),
ErrFn
:
func
()
error
{
err
:=
s
.
failRPC
s
.
failRPC
=
nil
// reset back, only error once.
return
err
},
}
}
// ActRPCFail makes the next L2 RPC request fail
func
(
s
*
L2Verifier
)
ActRPCFail
(
t
Testing
)
{
if
s
.
failRPC
!=
nil
{
// already set to fail?
t
.
InvalidAction
(
"already set a mock rpc error"
)
return
}
s
.
failRPC
=
errors
.
New
(
"mock RPC error"
)
}
func
(
s
*
L2Verifier
)
ActL1HeadSignal
(
t
Testing
)
{
head
,
err
:=
s
.
l1
.
L1BlockRefByLabel
(
t
.
Ctx
(),
eth
.
Unsafe
)
require
.
NoError
(
t
,
err
)
...
...
op-e2e/actions/l2_verifier_test.go
View file @
0f5260dc
...
...
@@ -3,27 +3,26 @@ package actions
import
(
"testing"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog"
)
func
setupVerifier
Test
(
t
Testing
,
sd
*
e2eutils
.
SetupData
,
log
log
.
Logger
)
(
*
L1Miner
,
*
L2Engine
,
*
L2Verifier
)
{
func
setupVerifier
(
t
Testing
,
sd
*
e2eutils
.
SetupData
,
log
log
.
Logger
,
l1F
derive
.
L1Fetcher
)
(
*
L2Engine
,
*
L2Verifier
)
{
jwtPath
:=
e2eutils
.
WriteDefaultJWT
(
t
)
miner
:=
NewL1Miner
(
log
,
sd
.
L1Cfg
)
l1F
,
err
:=
sources
.
NewL1Client
(
miner
.
RPCClient
(),
log
,
nil
,
sources
.
L1ClientDefaultConfig
(
sd
.
RollupCfg
,
false
))
require
.
NoError
(
t
,
err
)
engine
:=
NewL2Engine
(
log
,
sd
.
L2Cfg
,
sd
.
RollupCfg
.
Genesis
.
L1
,
jwtPath
)
l2Cl
,
err
:=
sources
.
NewEngineClient
(
engine
.
RPCClient
(),
log
,
nil
,
sources
.
EngineClientDefaultConfig
(
sd
.
RollupCfg
))
require
.
NoError
(
t
,
err
)
engCl
:=
engine
.
EngineClient
(
t
,
sd
.
RollupCfg
)
verifier
:=
NewL2Verifier
(
log
,
l1F
,
engCl
,
sd
.
RollupCfg
)
return
engine
,
verifier
}
verifier
:=
NewL2Verifier
(
log
,
l1F
,
l2Cl
,
sd
.
RollupCfg
)
func
setupVerifierOnlyTest
(
t
Testing
,
sd
*
e2eutils
.
SetupData
,
log
log
.
Logger
)
(
*
L1Miner
,
*
L2Engine
,
*
L2Verifier
)
{
miner
:=
NewL1Miner
(
log
,
sd
.
L1Cfg
)
l1Cl
:=
miner
.
L1Client
(
t
,
sd
.
RollupCfg
)
engine
,
verifier
:=
setupVerifier
(
t
,
sd
,
log
,
l1Cl
)
return
miner
,
engine
,
verifier
}
...
...
@@ -37,7 +36,7 @@ func TestL2Verifier_SequenceWindow(gt *testing.T) {
dp
:=
e2eutils
.
MakeDeployParams
(
t
,
p
)
sd
:=
e2eutils
.
Setup
(
t
,
dp
,
defaultAlloc
)
log
:=
testlog
.
Logger
(
t
,
log
.
LvlDebug
)
miner
,
engine
,
verifier
:=
setupVerifierTest
(
t
,
sd
,
log
)
miner
,
engine
,
verifier
:=
setupVerifier
Only
Test
(
t
,
sd
,
log
)
miner
.
ActL1SetFeeRecipient
(
common
.
Address
{
'A'
})
// Make two sequence windows worth of empty L1 blocks. After we pass the first sequence window, the L2 chain should get blocks
...
...
op-e2e/system_test.go
View file @
0f5260dc
...
...
@@ -10,6 +10,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/sources"
...
...
@@ -57,7 +58,7 @@ func TestL2OutputSubmitter(t *testing.T) {
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
())
require
.
Nil
(
t
,
err
)
rollupClient
:=
sources
.
NewRollupClient
(
rollupRPCClient
)
rollupClient
:=
sources
.
NewRollupClient
(
client
.
NewBaseRPCClient
(
rollupRPCClient
)
)
// OutputOracle is already deployed
l2OutputOracle
,
err
:=
bindings
.
NewL2OutputOracleCaller
(
predeploys
.
DevL2OutputOracleAddr
,
l1Client
)
...
...
@@ -212,7 +213,7 @@ func TestSystemE2E(t *testing.T) {
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
())
require
.
Nil
(
t
,
err
)
rollupClient
:=
sources
.
NewRollupClient
(
rollupRPCClient
)
rollupClient
:=
sources
.
NewRollupClient
(
client
.
NewBaseRPCClient
(
rollupRPCClient
)
)
// basic check that sync status works
seqStatus
,
err
:=
rollupClient
.
SyncStatus
(
context
.
Background
())
require
.
Nil
(
t
,
err
)
...
...
op-node/node/api.go
View file @
0f5260dc
...
...
@@ -6,7 +6,6 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/version"
"github.com/ethereum/go-ethereum"
...
...
@@ -26,12 +25,17 @@ type driverClient interface {
ResetDerivationPipeline
(
context
.
Context
)
error
}
type
rpcMetrics
interface
{
// RecordRPCServerRequest returns a function that records the duration of serving the given RPC method
RecordRPCServerRequest
(
method
string
)
func
()
}
type
adminAPI
struct
{
dr
driverClient
m
*
metrics
.
Metrics
m
rpc
Metrics
}
func
newAdminAPI
(
dr
driverClient
,
m
*
metrics
.
Metrics
)
*
adminAPI
{
func
NewAdminAPI
(
dr
driverClient
,
m
rpc
Metrics
)
*
adminAPI
{
return
&
adminAPI
{
dr
:
dr
,
m
:
m
,
...
...
@@ -49,10 +53,10 @@ type nodeAPI struct {
client
l2EthClient
dr
driverClient
log
log
.
Logger
m
*
metrics
.
Metrics
m
rpc
Metrics
}
func
newNodeAPI
(
config
*
rollup
.
Config
,
l2Client
l2EthClient
,
dr
driverClient
,
log
log
.
Logger
,
m
*
metrics
.
Metrics
)
*
nodeAPI
{
func
NewNodeAPI
(
config
*
rollup
.
Config
,
l2Client
l2EthClient
,
dr
driverClient
,
log
log
.
Logger
,
m
rpc
Metrics
)
*
nodeAPI
{
return
&
nodeAPI
{
config
:
config
,
client
:
l2Client
,
...
...
op-node/node/node.go
View file @
0f5260dc
...
...
@@ -171,7 +171,7 @@ func (n *OpNode) initRPCServer(ctx context.Context, cfg *Config) error {
n
.
server
.
EnableP2P
(
p2p
.
NewP2PAPIBackend
(
n
.
p2pNode
,
n
.
log
,
n
.
metrics
))
}
if
cfg
.
RPC
.
EnableAdmin
{
n
.
server
.
EnableAdminAPI
(
n
ewAdminAPI
(
n
.
l2Driver
,
n
.
metrics
))
n
.
server
.
EnableAdminAPI
(
N
ewAdminAPI
(
n
.
l2Driver
,
n
.
metrics
))
}
n
.
log
.
Info
(
"Starting JSON-RPC server"
)
if
err
:=
n
.
server
.
Start
();
err
!=
nil
{
...
...
op-node/node/server.go
View file @
0f5260dc
...
...
@@ -29,7 +29,7 @@ type rpcServer struct {
}
func
newRPCServer
(
ctx
context
.
Context
,
rpcCfg
*
RPCConfig
,
rollupCfg
*
rollup
.
Config
,
l2Client
l2EthClient
,
dr
driverClient
,
log
log
.
Logger
,
appVersion
string
,
m
*
metrics
.
Metrics
)
(
*
rpcServer
,
error
)
{
api
:=
n
ewNodeAPI
(
rollupCfg
,
l2Client
,
dr
,
log
.
New
(
"rpc"
,
"node"
),
m
)
api
:=
N
ewNodeAPI
(
rollupCfg
,
l2Client
,
dr
,
log
.
New
(
"rpc"
,
"node"
),
m
)
// TODO: extend RPC config with options for WS, IPC and HTTP RPC connections
endpoint
:=
net
.
JoinHostPort
(
rpcCfg
.
ListenAddr
,
strconv
.
Itoa
(
rpcCfg
.
ListenPort
))
r
:=
&
rpcServer
{
...
...
op-node/sources/rollupclient.go
View file @
0f5260dc
...
...
@@ -4,17 +4,17 @@ import (
"context"
"math/big"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/rpc"
)
type
RollupClient
struct
{
rpc
*
rpc
.
Client
rpc
client
.
RPC
}
func
NewRollupClient
(
rpc
*
rpc
.
Client
)
*
RollupClient
{
func
NewRollupClient
(
rpc
client
.
RPC
)
*
RollupClient
{
return
&
RollupClient
{
rpc
}
}
...
...
op-node/testutils/metrics.go
View file @
0f5260dc
...
...
@@ -34,3 +34,9 @@ func (t *TestDerivationMetrics) RecordUnsafePayloadsBuffer(length uint64, memSiz
t
.
FnRecordUnsafePayloads
(
length
,
memSize
,
next
)
}
}
type
TestRPCMetrics
struct
{}
func
(
n
*
TestRPCMetrics
)
RecordRPCServerRequest
(
method
string
)
func
()
{
return
func
()
{}
}
op-proposer/l2_output_submitter.go
View file @
0f5260dc
...
...
@@ -12,9 +12,7 @@ import (
"syscall"
"time"
hdwallet
"github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-proposer/drivers/l2output"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr"
...
...
@@ -28,6 +26,8 @@ import (
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
hdwallet
"github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli"
)
const
(
...
...
@@ -250,12 +250,12 @@ func dialRollupClientWithTimeout(ctx context.Context, url string) (*sources.Roll
ctxt
,
cancel
:=
context
.
WithTimeout
(
ctx
,
defaultDialTimeout
)
defer
cancel
()
client
,
err
:=
rpc
.
DialContext
(
ctxt
,
url
)
rpcCl
,
err
:=
rpc
.
DialContext
(
ctxt
,
url
)
if
err
!=
nil
{
return
nil
,
err
}
return
sources
.
NewRollupClient
(
client
),
nil
return
sources
.
NewRollupClient
(
client
.
NewBaseRPCClient
(
rpcCl
)
),
nil
}
// parseAddress parses an ETH address from a hex string. This method will fail if
...
...
op-proposer/rollupclient/rollupclient.go
deleted
100644 → 0
View file @
9e0151d5
package
rollupclient
import
(
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum/go-ethereum/rpc"
)
// Deprecated: use sources.RollupClient instead
type
RollupClient
=
sources
.
RollupClient
// Deprecated: use sources.NewRollupClient instead
func
NewRollupClient
(
rpc
*
rpc
.
Client
)
*
sources
.
RollupClient
{
return
sources
.
NewRollupClient
(
rpc
)
}
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