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
aefb7b42
Unverified
Commit
aefb7b42
authored
Sep 05, 2023
by
mergify[bot]
Committed by
GitHub
Sep 05, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into aj/recreate-dir
parents
c3d04d3b
2ef2087d
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
243 additions
and
98 deletions
+243
-98
codecov.yml
codecov.yml
+1
-4
init_game.sh
op-challenger/scripts/alphabet/init_game.sh
+1
-1
deposit_test.go
op-e2e/deposit_test.go
+138
-0
peers.go
op-e2e/e2eutils/geth/peers.go
+49
-0
l2_gossip_test.go
op-e2e/l2_gossip_test.go
+32
-0
setup.go
op-e2e/setup.go
+2
-2
system_test.go
op-e2e/system_test.go
+0
-62
tx_helper.go
op-e2e/tx_helper.go
+10
-8
main.go
op-node/cmd/stateviz/main.go
+1
-1
p2p_flags.go
op-node/flags/p2p_flags.go
+0
-1
metrics.go
op-node/metrics/metrics.go
+1
-1
server.go
op-node/node/server.go
+1
-1
load_config.go
op-node/p2p/cli/load_config.go
+6
-5
http.go
op-service/httputil/http.go
+1
-1
server.go
op-service/httputil/server.go
+0
-11
No files found.
codecov.yml
View file @
aefb7b42
comment
:
layout
:
"
reach,
diff,
flags,
files"
behavior
:
default
require_changes
:
true
# only post the comment if coverage changes
comment
:
false
ignore
:
-
"
op-e2e"
-
"
**/*.t.sol"
...
...
op-challenger/scripts/alphabet/init_game.sh
View file @
aefb7b42
...
...
@@ -18,7 +18,7 @@ DEVNET_SPONSOR="ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
DISPUTE_GAME_FACTORY
=
$(
jq
-r
.DisputeGameFactoryProxy
$MONOREPO_DIR
/.devnet/addresses.json
)
echo
"----------------------------------------------------------------"
echo
" Dispute Game Factory at
$DISPUTE_GAME_
PROX
Y
"
echo
" Dispute Game Factory at
$DISPUTE_GAME_
FACTOR
Y
"
echo
"----------------------------------------------------------------"
L2_OUTPUT_ORACLE_PROXY
=
$(
jq
-r
.L2OutputOracleProxy
$MONOREPO_DIR
/.devnet/addresses.json
)
...
...
op-e2e/deposit_test.go
0 → 100644
View file @
aefb7b42
package
op_e2e
import
(
"context"
"math/big"
"testing"
"time"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/stretchr/testify/require"
)
func
TestMintOnRevertedDeposit
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
sys
,
err
:=
cfg
.
Start
(
t
)
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
l1Client
:=
sys
.
Clients
[
"l1"
]
l2Verif
:=
sys
.
Clients
[
"verifier"
]
// create signer
aliceKey
:=
cfg
.
Secrets
.
Alice
opts
,
err
:=
bind
.
NewKeyedTransactorWithChainID
(
aliceKey
,
cfg
.
L1ChainIDBig
())
require
.
Nil
(
t
,
err
)
fromAddr
:=
opts
.
From
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
startBalance
,
err
:=
l2Verif
.
BalanceAt
(
ctx
,
fromAddr
,
nil
)
cancel
()
require
.
Nil
(
t
,
err
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
startNonce
,
err
:=
l2Verif
.
NonceAt
(
ctx
,
fromAddr
,
nil
)
require
.
NoError
(
t
,
err
)
cancel
()
toAddr
:=
common
.
Address
{
0xff
,
0xff
}
mintAmount
:=
big
.
NewInt
(
9
_000_000
)
opts
.
Value
=
mintAmount
SendDepositTx
(
t
,
cfg
,
l1Client
,
l2Verif
,
opts
,
func
(
l2Opts
*
DepositTxOpts
)
{
l2Opts
.
ToAddr
=
toAddr
// trigger a revert by transferring more than we have available
l2Opts
.
Value
=
new
(
big
.
Int
)
.
Mul
(
common
.
Big2
,
startBalance
)
l2Opts
.
ExpectedStatus
=
types
.
ReceiptStatusFailed
})
// Confirm balance
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
endBalance
,
err
:=
l2Verif
.
BalanceAt
(
ctx
,
fromAddr
,
nil
)
cancel
()
require
.
Nil
(
t
,
err
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
toAddrBalance
,
err
:=
l2Verif
.
BalanceAt
(
ctx
,
toAddr
,
nil
)
require
.
NoError
(
t
,
err
)
cancel
()
diff
:=
new
(
big
.
Int
)
diff
=
diff
.
Sub
(
endBalance
,
startBalance
)
require
.
Equal
(
t
,
mintAmount
,
diff
,
"Did not get expected balance change"
)
require
.
Equal
(
t
,
common
.
Big0
.
Int64
(),
toAddrBalance
.
Int64
(),
"The recipient account balance should be zero"
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
endNonce
,
err
:=
l2Verif
.
NonceAt
(
ctx
,
fromAddr
,
nil
)
require
.
NoError
(
t
,
err
)
cancel
()
require
.
Equal
(
t
,
startNonce
+
1
,
endNonce
,
"Nonce of deposit sender should increment on L2, even if the deposit fails"
)
}
func
TestDepositTxCreateContract
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
delete
(
cfg
.
Nodes
,
"verifier"
)
sys
,
err
:=
cfg
.
Start
(
t
)
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
l1Client
:=
sys
.
Clients
[
"l1"
]
l2Client
:=
sys
.
Clients
[
"sequencer"
]
opts
,
err
:=
bind
.
NewKeyedTransactorWithChainID
(
cfg
.
Secrets
.
Alice
,
cfg
.
L1ChainIDBig
())
require
.
Nil
(
t
,
err
)
// Simple constructor that is prefixed to the actual contract code
// Results in the contract code being returned as the code for the new contract
deployPrefixSize
:=
byte
(
16
)
deployPrefix
:=
[]
byte
{
// Copy input data after this prefix into memory starting at address 0x00
// CODECOPY arg size
byte
(
vm
.
PUSH1
),
deployPrefixSize
,
byte
(
vm
.
CODESIZE
),
byte
(
vm
.
SUB
),
// CODECOPY arg offset
byte
(
vm
.
PUSH1
),
deployPrefixSize
,
// CODECOPY arg destOffset
byte
(
vm
.
PUSH1
),
0x00
,
byte
(
vm
.
CODECOPY
),
// Return code from memory
// RETURN arg size
byte
(
vm
.
PUSH1
),
deployPrefixSize
,
byte
(
vm
.
CODESIZE
),
byte
(
vm
.
SUB
),
// RETURN arg offset
byte
(
vm
.
PUSH1
),
0x00
,
byte
(
vm
.
RETURN
),
}
// Stores the first word from call data code to storage slot 0
sstoreContract
:=
[]
byte
{
// Load first word from call data
byte
(
vm
.
PUSH1
),
0x00
,
byte
(
vm
.
CALLDATALOAD
),
// Store it to slot 0
byte
(
vm
.
PUSH1
),
0x00
,
byte
(
vm
.
SSTORE
),
}
deployData
:=
append
(
deployPrefix
,
sstoreContract
...
)
l2Receipt
:=
SendDepositTx
(
t
,
cfg
,
l1Client
,
l2Client
,
opts
,
func
(
l2Opts
*
DepositTxOpts
)
{
l2Opts
.
Data
=
deployData
l2Opts
.
Value
=
common
.
Big0
l2Opts
.
IsCreation
=
true
l2Opts
.
ToAddr
=
common
.
Address
{}
l2Opts
.
GasLimit
=
1
_000_000
})
require
.
NotEqual
(
t
,
common
.
Address
{},
l2Receipt
.
ContractAddress
,
"should not have zero address"
)
code
,
err
:=
l2Client
.
CodeAt
(
context
.
Background
(),
l2Receipt
.
ContractAddress
,
nil
)
require
.
NoError
(
t
,
err
,
"get deployed contract code"
)
require
.
Equal
(
t
,
sstoreContract
,
code
,
"should have deployed correct contract code"
)
}
op-e2e/e2eutils/geth/peers.go
0 → 100644
View file @
aefb7b42
package
geth
import
(
"context"
"testing"
"time"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/stretchr/testify/require"
)
// ConnectP2P creates a p2p peer connection between node1 and node2.
func
ConnectP2P
(
t
*
testing
.
T
,
node1
*
ethclient
.
Client
,
node2
*
ethclient
.
Client
)
{
var
targetInfo
p2p
.
NodeInfo
require
.
NoError
(
t
,
node2
.
Client
()
.
Call
(
&
targetInfo
,
"admin_nodeInfo"
),
"get node info"
)
var
peerAdded
bool
require
.
NoError
(
t
,
node1
.
Client
()
.
Call
(
&
peerAdded
,
"admin_addPeer"
,
targetInfo
.
Enode
),
"add peer"
)
require
.
True
(
t
,
peerAdded
,
"should have added peer successfully"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
30
*
time
.
Second
)
defer
cancel
()
err
:=
wait
.
For
(
ctx
,
time
.
Second
,
func
()
(
bool
,
error
)
{
var
peerCount
hexutil
.
Uint64
if
err
:=
node1
.
Client
()
.
Call
(
&
peerCount
,
"net_peerCount"
);
err
!=
nil
{
return
false
,
err
}
t
.
Logf
(
"Peer count %v"
,
uint64
(
peerCount
))
return
peerCount
>=
hexutil
.
Uint64
(
1
),
nil
})
require
.
NoError
(
t
,
err
,
"wait for a peer to be connected"
)
}
func
WithP2P
()
func
(
ethCfg
*
ethconfig
.
Config
,
nodeCfg
*
node
.
Config
)
error
{
return
func
(
ethCfg
*
ethconfig
.
Config
,
nodeCfg
*
node
.
Config
)
error
{
ethCfg
.
RollupDisableTxPoolGossip
=
false
nodeCfg
.
P2P
=
p2p
.
Config
{
NoDiscovery
:
true
,
ListenAddr
:
"127.0.0.1:0"
,
MaxPeers
:
10
,
}
return
nil
}
}
op-e2e/l2_gossip_test.go
0 → 100644
View file @
aefb7b42
package
op_e2e
import
(
"testing"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
func
TestTxGossip
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
gethOpts
:=
[]
GethOption
{
geth
.
WithP2P
(),
}
cfg
.
GethOptions
[
"sequencer"
]
=
gethOpts
cfg
.
GethOptions
[
"verifier"
]
=
gethOpts
sys
,
err
:=
cfg
.
Start
(
t
)
require
.
NoError
(
t
,
err
,
"Start system"
)
seqClient
:=
sys
.
Clients
[
"sequencer"
]
verifClient
:=
sys
.
Clients
[
"verifier"
]
geth
.
ConnectP2P
(
t
,
seqClient
,
verifClient
)
// Send a transaction to the verifier and it should be gossiped to the sequencer and included in a block.
SendL2Tx
(
t
,
cfg
,
verifClient
,
cfg
.
Secrets
.
Alice
,
func
(
opts
*
TxOpts
)
{
opts
.
ToAddr
=
&
common
.
Address
{
0xaa
}
opts
.
Value
=
common
.
Big1
opts
.
VerifyOnClients
(
seqClient
,
verifClient
)
})
}
op-e2e/setup.go
View file @
aefb7b42
...
...
@@ -84,7 +84,7 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
require
.
NoError
(
t
,
err
)
deployConfig
:=
config
.
DeployConfig
.
Copy
()
deployConfig
.
L1GenesisBlockTimestamp
=
hexutil
.
Uint64
(
time
.
Now
()
.
Unix
())
require
.
NoError
(
t
,
deployConfig
.
Check
())
require
.
NoError
(
t
,
deployConfig
.
Check
()
,
"Deploy config is invalid, do you need to run make devnet-allocs?"
)
l1Deployments
:=
config
.
L1Deployments
.
Copy
()
require
.
NoError
(
t
,
l1Deployments
.
Check
())
...
...
@@ -457,7 +457,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
ethClient
=
gethInst
}
else
{
if
len
(
cfg
.
GethOptions
[
name
])
>
0
{
t
.
Errorf
(
"External L2 nodes do not support configuration through GethOptions"
)
t
.
Skip
(
"External L2 nodes do not support configuration through GethOptions"
)
}
ethClient
=
(
&
ExternalRunner
{
Name
:
name
,
...
...
op-e2e/system_test.go
View file @
aefb7b42
...
...
@@ -11,7 +11,6 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
...
...
@@ -337,67 +336,6 @@ func TestFinalize(t *testing.T) {
require
.
NotZerof
(
t
,
l2Finalized
.
NumberU64
(),
"must have finalized L2 block"
)
}
func
TestMintOnRevertedDeposit
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
sys
,
err
:=
cfg
.
Start
(
t
)
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
l1Client
:=
sys
.
Clients
[
"l1"
]
l2Verif
:=
sys
.
Clients
[
"verifier"
]
l1Node
:=
sys
.
EthInstances
[
"l1"
]
.
(
*
GethInstance
)
.
Node
// create signer
ks
:=
l1Node
.
AccountManager
()
.
Backends
(
keystore
.
KeyStoreType
)[
0
]
.
(
*
keystore
.
KeyStore
)
opts
,
err
:=
bind
.
NewKeyStoreTransactorWithChainID
(
ks
,
ks
.
Accounts
()[
0
],
cfg
.
L1ChainIDBig
())
require
.
Nil
(
t
,
err
)
fromAddr
:=
opts
.
From
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
startBalance
,
err
:=
l2Verif
.
BalanceAt
(
ctx
,
fromAddr
,
nil
)
cancel
()
require
.
Nil
(
t
,
err
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
startNonce
,
err
:=
l2Verif
.
NonceAt
(
ctx
,
fromAddr
,
nil
)
require
.
NoError
(
t
,
err
)
cancel
()
toAddr
:=
common
.
Address
{
0xff
,
0xff
}
mintAmount
:=
big
.
NewInt
(
9
_000_000
)
opts
.
Value
=
mintAmount
SendDepositTx
(
t
,
cfg
,
l1Client
,
l2Verif
,
opts
,
func
(
l2Opts
*
DepositTxOpts
)
{
l2Opts
.
ToAddr
=
toAddr
// trigger a revert by transferring more than we have available
l2Opts
.
Value
=
new
(
big
.
Int
)
.
Mul
(
common
.
Big2
,
startBalance
)
l2Opts
.
ExpectedStatus
=
types
.
ReceiptStatusFailed
})
// Confirm balance
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
endBalance
,
err
:=
l2Verif
.
BalanceAt
(
ctx
,
fromAddr
,
nil
)
cancel
()
require
.
Nil
(
t
,
err
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
toAddrBalance
,
err
:=
l2Verif
.
BalanceAt
(
ctx
,
toAddr
,
nil
)
require
.
NoError
(
t
,
err
)
cancel
()
diff
:=
new
(
big
.
Int
)
diff
=
diff
.
Sub
(
endBalance
,
startBalance
)
require
.
Equal
(
t
,
mintAmount
,
diff
,
"Did not get expected balance change"
)
require
.
Equal
(
t
,
common
.
Big0
.
Int64
(),
toAddrBalance
.
Int64
(),
"The recipient account balance should be zero"
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
endNonce
,
err
:=
l2Verif
.
NonceAt
(
ctx
,
fromAddr
,
nil
)
require
.
NoError
(
t
,
err
)
cancel
()
require
.
Equal
(
t
,
startNonce
+
1
,
endNonce
,
"Nonce of deposit sender should increment on L2, even if the deposit fails"
)
}
func
TestMissingBatchE2E
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
// Note this test zeroes the balance of the batch-submitter to make the batches unable to go into L1.
...
...
op-e2e/tx_helper.go
View file @
aefb7b42
...
...
@@ -21,7 +21,8 @@ import (
// The L1 transaction, including sender, is configured by the l1Opts param.
// The L2 transaction options can be configured by modifying the DepositTxOps value supplied to applyL2Opts
// Will verify that the transaction is included with the expected status on L1 and L2
func
SendDepositTx
(
t
*
testing
.
T
,
cfg
SystemConfig
,
l1Client
*
ethclient
.
Client
,
l2Client
*
ethclient
.
Client
,
l1Opts
*
bind
.
TransactOpts
,
applyL2Opts
DepositTxOptsFn
)
{
// Returns the receipt of the L2 transaction
func
SendDepositTx
(
t
*
testing
.
T
,
cfg
SystemConfig
,
l1Client
*
ethclient
.
Client
,
l2Client
*
ethclient
.
Client
,
l1Opts
*
bind
.
TransactOpts
,
applyL2Opts
DepositTxOptsFn
)
*
types
.
Receipt
{
l2Opts
:=
defaultDepositTxOpts
(
l1Opts
)
applyL2Opts
(
l2Opts
)
...
...
@@ -38,16 +39,17 @@ func SendDepositTx(t *testing.T, cfg SystemConfig, l1Client *ethclient.Client, l
require
.
Nil
(
t
,
err
,
"with deposit tx"
)
// Wait for transaction on L1
r
eceipt
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l1Client
,
10
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
l1R
eceipt
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l1Client
,
10
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
require
.
Nil
(
t
,
err
,
"Waiting for deposit tx on L1"
)
// Wait for transaction to be included on L2
reconstructedDep
,
err
:=
derive
.
UnmarshalDepositLogEvent
(
r
eceipt
.
Logs
[
0
])
reconstructedDep
,
err
:=
derive
.
UnmarshalDepositLogEvent
(
l1R
eceipt
.
Logs
[
0
])
require
.
NoError
(
t
,
err
,
"Could not reconstruct L2 Deposit"
)
tx
=
types
.
NewTx
(
reconstructedDep
)
receipt
,
err
=
waitForTransaction
(
tx
.
Hash
(),
l2Client
,
10
*
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
)
*
time
.
Second
)
l2Receipt
,
err
:
=
waitForTransaction
(
tx
.
Hash
(),
l2Client
,
10
*
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
)
*
time
.
Second
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
l2Opts
.
ExpectedStatus
,
receipt
.
Status
,
"l2 transaction status"
)
require
.
Equal
(
t
,
l2Opts
.
ExpectedStatus
,
l2Receipt
.
Status
,
"l2 transaction status"
)
return
l2Receipt
}
type
DepositTxOptsFn
func
(
l2Opts
*
DepositTxOpts
)
...
...
@@ -91,16 +93,16 @@ func SendL2Tx(t *testing.T, cfg SystemConfig, l2Client *ethclient.Client, privKe
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
30
*
time
.
Second
)
defer
cancel
()
err
:=
l2Client
.
SendTransaction
(
ctx
,
tx
)
require
.
N
il
(
t
,
err
,
"Sending L2 tx"
)
require
.
N
oError
(
t
,
err
,
"Sending L2 tx"
)
receipt
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l2Client
,
10
*
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
)
*
time
.
Second
)
require
.
N
il
(
t
,
err
,
"Waiting for L2 tx"
)
require
.
N
oError
(
t
,
err
,
"Waiting for L2 tx"
)
require
.
Equal
(
t
,
opts
.
ExpectedStatus
,
receipt
.
Status
,
"TX should have expected status"
)
for
i
,
client
:=
range
opts
.
VerifyClients
{
t
.
Logf
(
"Waiting for tx %v on verification client %d"
,
tx
.
Hash
(),
i
)
receiptVerif
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
client
,
10
*
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
)
*
time
.
Second
)
require
.
N
il
f
(
t
,
err
,
"Waiting for L2 tx on verification client %d"
,
i
)
require
.
N
oError
f
(
t
,
err
,
"Waiting for L2 tx on verification client %d"
,
i
)
require
.
Equalf
(
t
,
receipt
,
receiptVerif
,
"Receipts should be the same on sequencer and verification client %d"
,
i
)
}
return
receipt
...
...
op-node/cmd/stateviz/main.go
View file @
aefb7b42
...
...
@@ -18,8 +18,8 @@ import (
"sync"
"time"
ophttp
"github.com/ethereum-optimism/optimism/op-node/http"
"github.com/ethereum-optimism/optimism/op-service/eth"
ophttp
"github.com/ethereum-optimism/optimism/op-service/httputil"
"github.com/ethereum/go-ethereum/log"
)
...
...
op-node/flags/p2p_flags.go
View file @
aefb7b42
...
...
@@ -156,7 +156,6 @@ var (
Name
:
"p2p.netrestrict"
,
Usage
:
"Comma-separated list of CIDR masks. P2P will only try to connect on these networks"
,
Required
:
false
,
Value
:
""
,
EnvVars
:
p2pEnv
(
"NETRESTRICT"
),
}
HostMux
=
&
cli
.
StringFlag
{
...
...
op-node/metrics/metrics.go
View file @
aefb7b42
...
...
@@ -10,8 +10,8 @@ import (
"strconv"
"time"
ophttp
"github.com/ethereum-optimism/optimism/op-node/http"
"github.com/ethereum-optimism/optimism/op-node/p2p/store"
ophttp
"github.com/ethereum-optimism/optimism/op-service/httputil"
"github.com/ethereum-optimism/optimism/op-service/metrics"
pb
"github.com/libp2p/go-libp2p-pubsub/pb"
...
...
op-node/node/server.go
View file @
aefb7b42
...
...
@@ -7,7 +7,7 @@ import (
"net/http"
"strconv"
ophttp
"github.com/ethereum-optimism/optimism/op-
node/http
"
ophttp
"github.com/ethereum-optimism/optimism/op-
service/httputil
"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/rpc"
...
...
op-node/p2p/cli/load_config.go
View file @
aefb7b42
...
...
@@ -194,13 +194,14 @@ func loadDiscoveryOpts(conf *p2p.Config, ctx *cli.Context) error {
conf
.
Bootnodes
=
p2p
.
DefaultBootnodes
}
netRestrict
,
err
:=
netutil
.
ParseNetlist
(
ctx
.
String
(
flags
.
NetRestrict
.
Name
))
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to parse net list: %w"
,
err
)
if
ctx
.
IsSet
(
flags
.
NetRestrict
.
Name
)
{
netRestrict
,
err
:=
netutil
.
ParseNetlist
(
ctx
.
String
(
flags
.
NetRestrict
.
Name
))
if
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to parse net list: %w"
,
err
)
}
conf
.
NetRestrict
=
netRestrict
}
conf
.
NetRestrict
=
netRestrict
return
nil
}
...
...
op-
node/http
/http.go
→
op-
service/httputil
/http.go
View file @
aefb7b42
package
http
package
http
util
import
(
"net/http"
...
...
op-service/httputil/server.go
View file @
aefb7b42
...
...
@@ -3,9 +3,7 @@ package httputil
import
(
"context"
"errors"
"fmt"
"net/http"
"time"
)
func
ListenAndServeContext
(
ctx
context
.
Context
,
server
*
http
.
Server
)
error
{
...
...
@@ -14,15 +12,6 @@ func ListenAndServeContext(ctx context.Context, server *http.Server) error {
errCh
<-
server
.
ListenAndServe
()
}()
// verify that the server comes up
tick
:=
time
.
NewTimer
(
10
*
time
.
Millisecond
)
select
{
case
err
:=
<-
errCh
:
return
fmt
.
Errorf
(
"http server failed: %w"
,
err
)
case
<-
tick
.
C
:
break
}
select
{
case
err
:=
<-
errCh
:
if
errors
.
Is
(
err
,
http
.
ErrServerClosed
)
{
...
...
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