Commit 0d754217 authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

Merge branch 'develop' into fix/remove-x

parents cf613a35 25b088f9
---
'@eth-optimism/sdk': patch
---
Add wsteth support for DAI bridge to sdk
---
'@eth-optimism/contracts-bedrock': patch
---
Delete hardhat genesis tasks
...@@ -16,16 +16,17 @@ import ( ...@@ -16,16 +16,17 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/sources"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof" oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc" oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
"github.com/ethereum/go-ethereum/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-batcher/sequencer"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-proposer/rollupclient"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr" "github.com/ethereum-optimism/optimism/op-proposer/txmgr"
"github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -34,8 +35,7 @@ import ( ...@@ -34,8 +35,7 @@ import (
"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"
hdwallet "github.com/miguelmota/go-ethereum-hdwallet" "github.com/ethereum/go-ethereum/rpc"
"github.com/urfave/cli"
) )
const ( const (
...@@ -491,7 +491,7 @@ func dialEthClientWithTimeout(ctx context.Context, url string) ( ...@@ -491,7 +491,7 @@ func dialEthClientWithTimeout(ctx context.Context, url string) (
// dialRollupClientWithTimeout attempts to dial the RPC provider using the provided // dialRollupClientWithTimeout attempts to dial the RPC provider using the provided
// URL. If the dial doesn't complete within defaultDialTimeout seconds, this // URL. If the dial doesn't complete within defaultDialTimeout seconds, this
// method will return an error. // method will return an error.
func dialRollupClientWithTimeout(ctx context.Context, url string) (*rollupclient.RollupClient, error) { func dialRollupClientWithTimeout(ctx context.Context, url string) (*sources.RollupClient, error) {
ctxt, cancel := context.WithTimeout(ctx, defaultDialTimeout) ctxt, cancel := context.WithTimeout(ctx, defaultDialTimeout)
defer cancel() defer cancel()
...@@ -500,7 +500,7 @@ func dialRollupClientWithTimeout(ctx context.Context, url string) (*rollupclient ...@@ -500,7 +500,7 @@ func dialRollupClientWithTimeout(ctx context.Context, url string) (*rollupclient
return nil, err return nil, err
} }
return rollupclient.NewRollupClient(client), nil return sources.NewRollupClient(client), nil
} }
// parseAddress parses an ETH address from a hex string. This method will fail if // parseAddress parses an ETH address from a hex string. This method will fail if
......
...@@ -4,13 +4,12 @@ import ( ...@@ -4,13 +4,12 @@ import (
"fmt" "fmt"
"os" "os"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli" "github.com/urfave/cli"
batcher "github.com/ethereum-optimism/optimism/op-batcher" batcher "github.com/ethereum-optimism/optimism/op-batcher"
"github.com/ethereum-optimism/optimism/op-batcher/flags" "github.com/ethereum-optimism/optimism/op-batcher/flags"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum/go-ethereum/log"
) )
var ( var (
......
...@@ -3,16 +3,13 @@ package op_batcher ...@@ -3,16 +3,13 @@ package op_batcher
import ( import (
"time" "time"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
"github.com/urfave/cli" "github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-batcher/flags" "github.com/ethereum-optimism/optimism/op-batcher/flags"
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"
) )
type Config struct { type Config struct {
......
package flags package flags
import ( import (
"github.com/urfave/cli"
opservice "github.com/ethereum-optimism/optimism/op-service" opservice "github.com/ethereum-optimism/optimism/op-service"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof" oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc" oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
"github.com/urfave/cli"
) )
const envVarPrefix = "OP_BATCHER" const envVarPrefix = "OP_BATCHER"
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"math/big" "math/big"
"time" "time"
"github.com/ethereum-optimism/optimism/op-proposer/rollupclient" "github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
...@@ -22,7 +22,7 @@ type Config struct { ...@@ -22,7 +22,7 @@ type Config struct {
// API to hit for batch data // API to hit for batch data
L2Client *ethclient.Client L2Client *ethclient.Client
RollupNode *rollupclient.RollupClient RollupNode *sources.RollupClient
// Limit the size of txs // Limit the size of txs
MinL1TxSize uint64 MinL1TxSize uint64
......
...@@ -18,9 +18,9 @@ import ( ...@@ -18,9 +18,9 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup" "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/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver" "github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/withdrawals" "github.com/ethereum-optimism/optimism/op-node/withdrawals"
"github.com/ethereum-optimism/optimism/op-proposer/rollupclient"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"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/accounts/abi/bind"
...@@ -168,7 +168,7 @@ func TestL2OutputSubmitter(t *testing.T) { ...@@ -168,7 +168,7 @@ func TestL2OutputSubmitter(t *testing.T) {
rollupRPCClient, err := rpc.DialContext(context.Background(), cfg.Nodes["sequencer"].RPC.HttpEndpoint()) rollupRPCClient, err := rpc.DialContext(context.Background(), cfg.Nodes["sequencer"].RPC.HttpEndpoint())
require.Nil(t, err) require.Nil(t, err)
rollupClient := rollupclient.NewRollupClient(rollupRPCClient) rollupClient := sources.NewRollupClient(rollupRPCClient)
// OutputOracle is already deployed // OutputOracle is already deployed
l2OutputOracle, err := bindings.NewL2OutputOracleCaller(sys.L2OOContractAddr, l1Client) l2OutputOracle, err := bindings.NewL2OutputOracleCaller(sys.L2OOContractAddr, l1Client)
...@@ -330,7 +330,7 @@ func TestSystemE2E(t *testing.T) { ...@@ -330,7 +330,7 @@ func TestSystemE2E(t *testing.T) {
rollupRPCClient, err := rpc.DialContext(context.Background(), cfg.Nodes["sequencer"].RPC.HttpEndpoint()) rollupRPCClient, err := rpc.DialContext(context.Background(), cfg.Nodes["sequencer"].RPC.HttpEndpoint())
require.Nil(t, err) require.Nil(t, err)
rollupClient := rollupclient.NewRollupClient(rollupRPCClient) rollupClient := sources.NewRollupClient(rollupRPCClient)
// basic check that sync status works // basic check that sync status works
seqStatus, err := rollupClient.SyncStatus(context.Background()) seqStatus, err := rollupClient.SyncStatus(context.Background())
require.Nil(t, err) require.Nil(t, err)
......
...@@ -3,9 +3,10 @@ package client ...@@ -3,9 +3,10 @@ package client
import ( import (
"context" "context"
"github.com/prometheus/client_golang/prometheus"
"github.com/ethereum-optimism/optimism/op-node/metrics" "github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/prometheus/client_golang/prometheus"
) )
type RPC interface { type RPC interface {
......
...@@ -8,19 +8,17 @@ import ( ...@@ -8,19 +8,17 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-bindings/hardhat" "github.com/ethereum-optimism/optimism/op-bindings/hardhat"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"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-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
) )
var Subcommands = cli.Commands{ var Subcommands = cli.Commands{
......
...@@ -9,22 +9,17 @@ import ( ...@@ -9,22 +9,17 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/heartbeat" "github.com/urfave/cli"
opnode "github.com/ethereum-optimism/optimism/op-node"
"github.com/ethereum-optimism/optimism/op-node/cmd/genesis" "github.com/ethereum-optimism/optimism/op-node/cmd/genesis"
"github.com/ethereum-optimism/optimism/op-node/cmd/p2p" "github.com/ethereum-optimism/optimism/op-node/cmd/p2p"
"github.com/ethereum-optimism/optimism/op-node/metrics"
opnode "github.com/ethereum-optimism/optimism/op-node"
"github.com/ethereum-optimism/optimism/op-node/version"
"github.com/ethereum-optimism/optimism/op-node/flags" "github.com/ethereum-optimism/optimism/op-node/flags"
"github.com/ethereum-optimism/optimism/op-node/heartbeat"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/node" "github.com/ethereum-optimism/optimism/op-node/node"
"github.com/ethereum-optimism/optimism/op-node/version"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli"
) )
var ( var (
......
...@@ -5,10 +5,10 @@ import ( ...@@ -5,10 +5,10 @@ import (
"encoding/binary" "encoding/binary"
"testing" "testing"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/google/go-cmp/cmp"
) )
// FuzzExecutionPayloadUnmarshal checks that our SSZ decoding never panics // FuzzExecutionPayloadUnmarshal checks that our SSZ decoding never panics
......
package eth
// SyncStatus is a snapshot of the driver.
// Values may be zeroed if not yet initialized.
type SyncStatus struct {
// CurrentL1 is the block that the derivation process is currently at,
// this may not be fully derived into L2 data yet.
// If the node is synced, this matches the HeadL1, minus the verifier confirmation distance.
CurrentL1 L1BlockRef `json:"current_l1"`
// HeadL1 is the perceived head of the L1 chain, no confirmation distance.
// The head is not guaranteed to build on the other L1 sync status fields,
// as the node may be in progress of resetting to adapt to a L1 reorg.
HeadL1 L1BlockRef `json:"head_l1"`
SafeL1 L1BlockRef `json:"safe_l1"`
FinalizedL1 L1BlockRef `json:"finalized_l1"`
// UnsafeL2 is the absolute tip of the L2 chain,
// pointing to block data that has not been submitted to L1 yet.
// The sequencer is building this, and verifiers may also be ahead of the
// SafeL2 block if they sync blocks via p2p or other offchain sources.
UnsafeL2 L2BlockRef `json:"unsafe_l2"`
// SafeL2 points to the L2 block that was derived from the L1 chain.
// This point may still reorg if the L1 chain reorgs.
SafeL2 L2BlockRef `json:"safe_l2"`
// FinalizedL2 points to the L2 block that was derived fully from
// finalized L1 information, thus irreversible.
FinalizedL2 L2BlockRef `json:"finalized_l2"`
}
...@@ -8,13 +8,13 @@ import ( ...@@ -8,13 +8,13 @@ import (
"math/big" "math/big"
"reflect" "reflect"
"github.com/ethereum/go-ethereum/trie" "github.com/holiman/uint256"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/beacon" "github.com/ethereum/go-ethereum/core/beacon"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/holiman/uint256" "github.com/ethereum/go-ethereum/trie"
) )
type ErrorCode int type ErrorCode int
......
...@@ -8,8 +8,9 @@ import ( ...@@ -8,8 +8,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/log"
) )
const expHeartbeat = `{ const expHeartbeat = `{
......
...@@ -10,16 +10,15 @@ import ( ...@@ -10,16 +10,15 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/ethereum/go-ethereum/common" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/collectors"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/prometheus/client_golang/prometheus/collectors" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
) )
const ( const (
......
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/metrics" "github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/version" "github.com/ethereum-optimism/optimism/op-node/version"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -23,7 +22,7 @@ type l2EthClient interface { ...@@ -23,7 +22,7 @@ type l2EthClient interface {
} }
type driverClient interface { type driverClient interface {
SyncStatus(ctx context.Context) (*driver.SyncStatus, error) SyncStatus(ctx context.Context) (*eth.SyncStatus, error)
ResetDerivationPipeline(context.Context) error ResetDerivationPipeline(context.Context) error
} }
...@@ -97,7 +96,7 @@ func (n *nodeAPI) OutputAtBlock(ctx context.Context, number rpc.BlockNumber) ([] ...@@ -97,7 +96,7 @@ func (n *nodeAPI) OutputAtBlock(ctx context.Context, number rpc.BlockNumber) ([]
return []eth.Bytes32{l2OutputRootVersion, l2OutputRoot}, nil return []eth.Bytes32{l2OutputRootVersion, l2OutputRoot}, nil
} }
func (n *nodeAPI) SyncStatus(ctx context.Context) (*driver.SyncStatus, error) { func (n *nodeAPI) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) {
recordDur := n.m.RecordRPCServerRequest("optimism_syncStatus") recordDur := n.m.RecordRPCServerRequest("optimism_syncStatus")
defer recordDur() defer recordDur()
return n.dr.SyncStatus(ctx) return n.dr.SyncStatus(ctx)
......
...@@ -3,8 +3,9 @@ package node ...@@ -3,8 +3,9 @@ package node
import ( import (
"context" "context"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
"github.com/ethereum-optimism/optimism/op-node/eth"
) )
// Tracer configures the OpNode to share events // Tracer configures the OpNode to share events
......
...@@ -5,8 +5,9 @@ import ( ...@@ -5,8 +5,9 @@ import (
"os" "os"
"strings" "strings"
"github.com/ethereum/go-ethereum/log"
"golang.org/x/term" "golang.org/x/term"
"github.com/ethereum/go-ethereum/log"
) )
type LogConfig struct { type LogConfig struct {
......
...@@ -5,9 +5,8 @@ import ( ...@@ -5,9 +5,8 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/ethereum-optimism/optimism/op-node/client" "github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
...@@ -15,7 +14,6 @@ import ( ...@@ -15,7 +14,6 @@ import (
"github.com/ethereum-optimism/optimism/op-node/p2p" "github.com/ethereum-optimism/optimism/op-node/p2p"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver" "github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/sources" "github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
......
...@@ -7,14 +7,10 @@ import ( ...@@ -7,14 +7,10 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-node/metrics" "github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/p2p" "github.com/ethereum-optimism/optimism/op-node/p2p"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
......
...@@ -4,29 +4,21 @@ import ( ...@@ -4,29 +4,21 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"math/rand" "math/rand"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/version"
"testing" "testing"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys" "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/rollup"
"github.com/stretchr/testify/mock" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/version"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/assert" "github.com/ethereum/go-ethereum/rpc"
) )
func TestOutputAtBlock(t *testing.T) { func TestOutputAtBlock(t *testing.T) {
...@@ -149,7 +141,7 @@ func TestSyncStatus(t *testing.T) { ...@@ -149,7 +141,7 @@ func TestSyncStatus(t *testing.T) {
l2Client := &testutils.MockL2Client{} l2Client := &testutils.MockL2Client{}
drClient := &mockDriverClient{} drClient := &mockDriverClient{}
rng := rand.New(rand.NewSource(1234)) rng := rand.New(rand.NewSource(1234))
status := driver.SyncStatus{ status := eth.SyncStatus{
CurrentL1: testutils.RandomBlockRef(rng), CurrentL1: testutils.RandomBlockRef(rng),
HeadL1: testutils.RandomBlockRef(rng), HeadL1: testutils.RandomBlockRef(rng),
UnsafeL2: testutils.RandomL2BlockRef(rng), UnsafeL2: testutils.RandomL2BlockRef(rng),
...@@ -173,7 +165,7 @@ func TestSyncStatus(t *testing.T) { ...@@ -173,7 +165,7 @@ func TestSyncStatus(t *testing.T) {
client, err := dialRPCClientWithBackoff(context.Background(), log, "http://"+server.Addr().String()) client, err := dialRPCClientWithBackoff(context.Background(), log, "http://"+server.Addr().String())
assert.NoError(t, err) assert.NoError(t, err)
var out *driver.SyncStatus var out *eth.SyncStatus
err = client.CallContext(context.Background(), &out, "optimism_syncStatus") err = client.CallContext(context.Background(), &out, "optimism_syncStatus")
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, &status, out) assert.Equal(t, &status, out)
...@@ -183,8 +175,8 @@ type mockDriverClient struct { ...@@ -183,8 +175,8 @@ type mockDriverClient struct {
mock.Mock mock.Mock
} }
func (c *mockDriverClient) SyncStatus(ctx context.Context) (*driver.SyncStatus, error) { func (c *mockDriverClient) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) {
return c.Mock.MethodCalled("SyncStatus").Get(0).(*driver.SyncStatus), nil return c.Mock.MethodCalled("SyncStatus").Get(0).(*eth.SyncStatus), nil
} }
func (c *mockDriverClient) ResetDerivationPipeline(ctx context.Context) error { func (c *mockDriverClient) ResetDerivationPipeline(ctx context.Context) error {
......
...@@ -11,11 +11,6 @@ import ( ...@@ -11,11 +11,6 @@ import (
"strings" "strings"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/flags"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode"
ds "github.com/ipfs/go-datastore" ds "github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync" "github.com/ipfs/go-datastore/sync"
leveldb "github.com/ipfs/go-ds-leveldb" leveldb "github.com/ipfs/go-ds-leveldb"
...@@ -34,6 +29,12 @@ import ( ...@@ -34,6 +29,12 @@ import (
tls "github.com/libp2p/go-libp2p/p2p/security/tls" tls "github.com/libp2p/go-libp2p/p2p/security/tls"
"github.com/multiformats/go-multiaddr" "github.com/multiformats/go-multiaddr"
"github.com/urfave/cli" "github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-node/flags"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode"
) )
// SetupP2P provides a host and discovery service for usage in the rollup node. // SetupP2P provides a host and discovery service for usage in the rollup node.
......
...@@ -13,6 +13,11 @@ import ( ...@@ -13,6 +13,11 @@ import (
"github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2"
decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4" decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/multiformats/go-multiaddr"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
gcrypto "github.com/ethereum/go-ethereum/crypto" gcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
...@@ -20,10 +25,6 @@ import ( ...@@ -20,10 +25,6 @@ import (
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr" "github.com/ethereum/go-ethereum/p2p/enr"
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/multiformats/go-multiaddr"
) )
const ( const (
......
...@@ -9,19 +9,18 @@ import ( ...@@ -9,19 +9,18 @@ import (
"sync" "sync"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common"
lru "github.com/hashicorp/golang-lru"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/golang/snappy" "github.com/golang/snappy"
lru "github.com/hashicorp/golang-lru"
"github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub "github.com/libp2p/go-libp2p-pubsub"
pb "github.com/libp2p/go-libp2p-pubsub/pb" pb "github.com/libp2p/go-libp2p-pubsub/pb"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
) )
func init() { func init() {
......
...@@ -6,9 +6,7 @@ import ( ...@@ -6,9 +6,7 @@ import (
"net" "net"
"time" "time"
"github.com/ethereum/go-ethereum/log"
"github.com/libp2p/go-libp2p-core/connmgr" "github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-peerstore/pstoreds" "github.com/libp2p/go-libp2p-peerstore/pstoreds"
...@@ -17,6 +15,8 @@ import ( ...@@ -17,6 +15,8 @@ import (
"github.com/libp2p/go-libp2p/p2p/transport/tcp" "github.com/libp2p/go-libp2p/p2p/transport/tcp"
ma "github.com/multiformats/go-multiaddr" ma "github.com/multiformats/go-multiaddr"
madns "github.com/multiformats/go-multiaddr-dns" madns "github.com/multiformats/go-multiaddr-dns"
"github.com/ethereum/go-ethereum/log"
) )
type ExtraHostFeatures interface { type ExtraHostFeatures interface {
......
...@@ -8,15 +8,6 @@ import ( ...@@ -8,15 +8,6 @@ import (
"testing" "testing"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rpc"
ds "github.com/ipfs/go-datastore" ds "github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync" "github.com/ipfs/go-datastore/sync"
"github.com/libp2p/go-libp2p-core/connmgr" "github.com/libp2p/go-libp2p-core/connmgr"
...@@ -28,6 +19,14 @@ import ( ...@@ -28,6 +19,14 @@ import (
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
tswarm "github.com/libp2p/go-libp2p/p2p/net/swarm/testing" tswarm "github.com/libp2p/go-libp2p/p2p/net/swarm/testing"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"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/testlog"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rpc"
) )
func TestingConfig(t *testing.T) *Config { func TestingConfig(t *testing.T) *Config {
......
...@@ -6,17 +6,17 @@ import ( ...@@ -6,17 +6,17 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/hashicorp/go-multierror"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/host"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
ma "github.com/multiformats/go-multiaddr" ma "github.com/multiformats/go-multiaddr"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/hashicorp/go-multierror"
"github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/host"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
) )
type NodeP2P struct { type NodeP2P struct {
......
package p2p package p2p
import ( import (
"github.com/ethereum/go-ethereum/log"
"github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/network"
ma "github.com/multiformats/go-multiaddr" ma "github.com/multiformats/go-multiaddr"
"github.com/ethereum/go-ethereum/log"
) )
// TODO: add metrics here as well // TODO: add metrics here as well
......
...@@ -4,14 +4,13 @@ import ( ...@@ -4,14 +4,13 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/ethereum/go-ethereum/p2p/enr" "github.com/libp2p/go-libp2p-core/host"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/libp2p/go-libp2p-core/host" "github.com/ethereum/go-ethereum/p2p/enr"
) )
// Prepared provides a p2p host and discv5 service that is already set up. // Prepared provides a p2p host and discv5 service that is already set up.
......
...@@ -5,9 +5,10 @@ import ( ...@@ -5,9 +5,10 @@ import (
"net" "net"
"time" "time"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peer"
"github.com/ethereum/go-ethereum/p2p/enode"
) )
type PeerInfo struct { type PeerInfo struct {
......
...@@ -4,9 +4,10 @@ import ( ...@@ -4,9 +4,10 @@ import (
"context" "context"
"net" "net"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/libp2p/go-libp2p-core/peer"
) )
var NamespaceRPC = "opp2p" var NamespaceRPC = "opp2p"
......
...@@ -7,13 +7,7 @@ import ( ...@@ -7,13 +7,7 @@ import (
"net" "net"
"time" "time"
"github.com/ethereum-optimism/optimism/op-node/metrics"
decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4" decredSecp "github.com/decred/dcrd/dcrec/secp256k1/v4"
gcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/libp2p/go-libp2p-core/connmgr" "github.com/libp2p/go-libp2p-core/connmgr"
"github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/host"
...@@ -22,6 +16,12 @@ import ( ...@@ -22,6 +16,12 @@ import (
"github.com/libp2p/go-libp2p-core/peerstore" "github.com/libp2p/go-libp2p-core/peerstore"
pubsub "github.com/libp2p/go-libp2p-pubsub" pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p-testing/netutil" "github.com/libp2p/go-libp2p-testing/netutil"
"github.com/ethereum-optimism/optimism/op-node/metrics"
gcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode"
) )
// TODO: dynamic peering // TODO: dynamic peering
......
...@@ -8,11 +8,12 @@ import ( ...@@ -8,11 +8,12 @@ import (
"io" "io"
"math/big" "math/big"
"github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-node/flags" "github.com/ethereum-optimism/optimism/op-node/flags"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/urfave/cli"
) )
var SigningDomainBlocksV1 = [32]byte{} var SigningDomainBlocksV1 = [32]byte{}
......
...@@ -7,13 +7,14 @@ import ( ...@@ -7,13 +7,14 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
) )
type MockAttributesQueueOutput struct { type MockAttributesQueueOutput struct {
......
...@@ -8,12 +8,13 @@ import ( ...@@ -8,12 +8,13 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/require"
) )
func TestPreparePayloadAttributes(t *testing.T) { func TestPreparePayloadAttributes(t *testing.T) {
......
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"sync" "sync"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
......
...@@ -7,15 +7,15 @@ import ( ...@@ -7,15 +7,15 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
) )
// fakeBatchQueueOutput fakes the next stage (receive only) for the batch queue // fakeBatchQueueOutput fakes the next stage (receive only) for the batch queue
......
...@@ -3,10 +3,10 @@ package derive ...@@ -3,10 +3,10 @@ package derive
import ( import (
"testing" "testing"
"github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/stretchr/testify/assert"
) )
func TestBatchRoundTrip(t *testing.T) { func TestBatchRoundTrip(t *testing.T) {
......
...@@ -4,16 +4,16 @@ import ( ...@@ -4,16 +4,16 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
) )
type ValidBatchTestCase struct { type ValidBatchTestCase struct {
......
...@@ -9,6 +9,8 @@ import ( ...@@ -9,6 +9,8 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
...@@ -18,7 +20,6 @@ import ( ...@@ -18,7 +20,6 @@ import (
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/stretchr/testify/require"
) )
type testTx struct { type testTx struct {
......
...@@ -8,12 +8,13 @@ import ( ...@@ -8,12 +8,13 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
) )
type MockChannelBankOutput struct { type MockChannelBankOutput struct {
......
...@@ -5,10 +5,11 @@ import ( ...@@ -5,10 +5,11 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/holiman/uint256"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/holiman/uint256"
) )
var ( var (
......
...@@ -5,11 +5,12 @@ import ( ...@@ -5,11 +5,12 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
) )
func TestUnmarshalLogEvent(t *testing.T) { func TestUnmarshalLogEvent(t *testing.T) {
......
...@@ -10,6 +10,7 @@ import ( ...@@ -10,6 +10,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
......
...@@ -4,13 +4,14 @@ import ( ...@@ -4,13 +4,14 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
) )
func TestEngineQueue_Finalize(t *testing.T) { func TestEngineQueue_Finalize(t *testing.T) {
......
...@@ -5,6 +5,9 @@ import ( ...@@ -5,6 +5,9 @@ import (
"math/big" "math/big"
"testing" "testing"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-bindings/bindings" "github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
...@@ -14,8 +17,6 @@ import ( ...@@ -14,8 +17,6 @@ import (
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm/runtime" "github.com/ethereum/go-ethereum/core/vm/runtime"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"
) )
var ( var (
......
...@@ -6,9 +6,8 @@ import ( ...@@ -6,9 +6,8 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys" "github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
......
...@@ -5,11 +5,12 @@ import ( ...@@ -5,11 +5,12 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
) )
var _ eth.BlockInfo = (*testutils.MockBlockInfo)(nil) var _ eth.BlockInfo = (*testutils.MockBlockInfo)(nil)
......
...@@ -5,12 +5,13 @@ import ( ...@@ -5,12 +5,13 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
) )
type MockDataSource struct { type MockDataSource struct {
......
...@@ -5,11 +5,12 @@ import ( ...@@ -5,11 +5,12 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
) )
func TestL1Traversal_Step(t *testing.T) { func TestL1Traversal_Step(t *testing.T) {
......
...@@ -4,8 +4,9 @@ import ( ...@@ -4,8 +4,9 @@ import (
"container/heap" "container/heap"
"testing" "testing"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth"
) )
func TestPayloadsByNumber(t *testing.T) { func TestPayloadsByNumber(t *testing.T) {
......
...@@ -5,9 +5,10 @@ import ( ...@@ -5,9 +5,10 @@ import (
"io" "io"
"testing" "testing"
"github.com/stretchr/testify/mock"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/stretchr/testify/mock"
) )
var _ Engine = (*testutils.MockEngine)(nil) var _ Engine = (*testutils.MockEngine)(nil)
......
...@@ -4,10 +4,11 @@ import ( ...@@ -4,10 +4,11 @@ import (
"context" "context"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/stretchr/testify/require"
) )
type confTest struct { type confTest struct {
......
...@@ -106,7 +106,7 @@ func (d *Driver) ResetDerivationPipeline(ctx context.Context) error { ...@@ -106,7 +106,7 @@ func (d *Driver) ResetDerivationPipeline(ctx context.Context) error {
return d.s.ResetDerivationPipeline(ctx) return d.s.ResetDerivationPipeline(ctx)
} }
func (d *Driver) SyncStatus(ctx context.Context) (*SyncStatus, error) { func (d *Driver) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) {
return d.s.SyncStatus(ctx) return d.s.SyncStatus(ctx)
} }
......
...@@ -16,31 +16,8 @@ import ( ...@@ -16,31 +16,8 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
// SyncStatus is a snapshot of the driver. // Deprecated: use eth.SyncStatus instead.
// Values may be zeroed if not yet initialized. type SyncStatus = eth.SyncStatus
type SyncStatus struct {
// CurrentL1 is the block that the derivation process is currently at,
// this may not be fully derived into L2 data yet.
// If the node is synced, this matches the HeadL1, minus the verifier confirmation distance.
CurrentL1 eth.L1BlockRef `json:"current_l1"`
// HeadL1 is the perceived head of the L1 chain, no confirmation distance.
// The head is not guaranteed to build on the other L1 sync status fields,
// as the node may be in progress of resetting to adapt to a L1 reorg.
HeadL1 eth.L1BlockRef `json:"head_l1"`
SafeL1 eth.L1BlockRef `json:"safe_l1"`
FinalizedL1 eth.L1BlockRef `json:"finalized_l1"`
// UnsafeL2 is the absolute tip of the L2 chain,
// pointing to block data that has not been submitted to L1 yet.
// The sequencer is building this, and verifiers may also be ahead of the
// SafeL2 block if they sync blocks via p2p or other offchain sources.
UnsafeL2 eth.L2BlockRef `json:"unsafe_l2"`
// SafeL2 points to the L2 block that was derived from the L1 chain.
// This point may still reorg if the L1 chain reorgs.
SafeL2 eth.L2BlockRef `json:"safe_l2"`
// FinalizedL2 points to the L2 block that was derived fully from
// finalized L1 information, thus irreversible.
FinalizedL2 eth.L2BlockRef `json:"finalized_l2"`
}
type state struct { type state struct {
// Latest recorded head, safe block and finalized block of the L1 Chain, independent of derivation work // Latest recorded head, safe block and finalized block of the L1 Chain, independent of derivation work
...@@ -56,7 +33,7 @@ type state struct { ...@@ -56,7 +33,7 @@ type state struct {
idleDerivation bool idleDerivation bool
// Requests for sync status. Synchronized with event loop to avoid reading an inconsistent sync status. // Requests for sync status. Synchronized with event loop to avoid reading an inconsistent sync status.
syncStatusReq chan chan SyncStatus syncStatusReq chan chan eth.SyncStatus
// Upon receiving a channel in this channel, the derivation pipeline is forced to be reset. // Upon receiving a channel in this channel, the derivation pipeline is forced to be reset.
// It tells the caller that the reset occurred by closing the passed in channel. // It tells the caller that the reset occurred by closing the passed in channel.
...@@ -101,7 +78,7 @@ func NewState(driverCfg *Config, log log.Logger, snapshotLog log.Logger, config ...@@ -101,7 +78,7 @@ func NewState(driverCfg *Config, log log.Logger, snapshotLog log.Logger, config
return &state{ return &state{
derivation: derivationPipeline, derivation: derivationPipeline,
idleDerivation: false, idleDerivation: false,
syncStatusReq: make(chan chan SyncStatus, 10), syncStatusReq: make(chan chan eth.SyncStatus, 10),
forceReset: make(chan chan struct{}, 10), forceReset: make(chan chan struct{}, 10),
Config: config, Config: config,
DriverConfig: driverCfg, DriverConfig: driverCfg,
...@@ -472,7 +449,7 @@ func (s *state) eventLoop() { ...@@ -472,7 +449,7 @@ func (s *state) eventLoop() {
reqStep() // continue with the next step if we can reqStep() // continue with the next step if we can
} }
case respCh := <-s.syncStatusReq: case respCh := <-s.syncStatusReq:
respCh <- SyncStatus{ respCh <- eth.SyncStatus{
CurrentL1: s.derivation.Progress().Origin, CurrentL1: s.derivation.Progress().Origin,
HeadL1: s.l1Head, HeadL1: s.l1Head,
SafeL1: s.l1Safe, SafeL1: s.l1Safe,
...@@ -510,8 +487,8 @@ func (s *state) ResetDerivationPipeline(ctx context.Context) error { ...@@ -510,8 +487,8 @@ func (s *state) ResetDerivationPipeline(ctx context.Context) error {
} }
} }
func (s *state) SyncStatus(ctx context.Context) (*SyncStatus, error) { func (s *state) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) {
respCh := make(chan SyncStatus) respCh := make(chan eth.SyncStatus)
select { select {
case <-ctx.Done(): case <-ctx.Done():
return nil, ctx.Err() return nil, ctx.Err()
......
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "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/derive"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
......
...@@ -4,13 +4,14 @@ import ( ...@@ -4,13 +4,14 @@ import (
"context" "context"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/testlog" "github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/testutils" "github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
) )
var _ L1Chain = (*testutils.FakeChainSource)(nil) var _ L1Chain = (*testutils.FakeChainSource)(nil)
......
...@@ -7,9 +7,10 @@ import ( ...@@ -7,9 +7,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/assert"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
) )
func randConfig() *Config { func randConfig() *Config {
......
...@@ -8,18 +8,16 @@ import ( ...@@ -8,18 +8,16 @@ import (
"os" "os"
"strings" "strings"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver" "github.com/urfave/cli"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/flags" "github.com/ethereum-optimism/optimism/op-node/flags"
"github.com/ethereum-optimism/optimism/op-node/node" "github.com/ethereum-optimism/optimism/op-node/node"
"github.com/ethereum-optimism/optimism/op-node/p2p" "github.com/ethereum-optimism/optimism/op-node/p2p"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/urfave/cli" "github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
) )
// NewConfig creates a Config from the provided flags or environment variables. // NewConfig creates a Config from the provided flags or environment variables.
......
...@@ -7,8 +7,9 @@ import ( ...@@ -7,8 +7,9 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
"github.com/ethereum/go-ethereum/rpc"
"github.com/hashicorp/go-multierror" "github.com/hashicorp/go-multierror"
"github.com/ethereum/go-ethereum/rpc"
) )
// IterativeBatchCall is an util to create a job to fetch many RPC requests in batches, // IterativeBatchCall is an util to create a job to fetch many RPC requests in batches,
......
...@@ -8,10 +8,10 @@ import ( ...@@ -8,10 +8,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/stretchr/testify/mock"
) )
type elemCall struct { type elemCall struct {
......
...@@ -6,6 +6,9 @@ import ( ...@@ -6,6 +6,9 @@ import (
"math/rand" "math/rand"
"testing" "testing"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-node/client" "github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
...@@ -13,8 +16,6 @@ import ( ...@@ -13,8 +16,6 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
) )
type mockRPC struct { type mockRPC struct {
......
...@@ -5,7 +5,6 @@ import ( ...@@ -5,7 +5,6 @@ import (
"sync" "sync"
"github.com/ethereum-optimism/optimism/op-node/client" "github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
) )
......
...@@ -4,12 +4,10 @@ import ( ...@@ -4,12 +4,10 @@ import (
"fmt" "fmt"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/trie" "github.com/ethereum/go-ethereum/trie"
"github.com/ethereum/go-ethereum/core/types"
) )
func makeReceiptsFn(block eth.BlockID, receiptHash common.Hash) func(txHashes []common.Hash, receipts []*types.Receipt) (types.Receipts, error) { func makeReceiptsFn(block eth.BlockID, receiptHash common.Hash) func(txHashes []common.Hash, receipts []*types.Receipt) (types.Receipts, error) {
......
package sources
import (
"context"
"math/big"
"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
}
func NewRollupClient(rpc *rpc.Client) *RollupClient {
return &RollupClient{rpc}
}
func (r *RollupClient) OutputAtBlock(ctx context.Context, blockNum *big.Int) ([]eth.Bytes32, error) {
var output []eth.Bytes32
err := r.rpc.CallContext(ctx, &output, "optimism_outputAtBlock", hexutil.EncodeBig(blockNum))
return output, err
}
func (r *RollupClient) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) {
var output *eth.SyncStatus
err := r.rpc.CallContext(ctx, &output, "optimism_syncStatus")
return output, err
}
func (r *RollupClient) RollupConfig(ctx context.Context) (*rollup.Config, error) {
var output *rollup.Config
err := r.rpc.CallContext(ctx, &output, "optimism_rollupConfig")
return output, err
}
func (r *RollupClient) Version(ctx context.Context) (string, error) {
var output string
err := r.rpc.CallContext(ctx, &output, "optimism_version")
return output, err
}
...@@ -5,14 +5,13 @@ import ( ...@@ -5,14 +5,13 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/holiman/uint256" "github.com/holiman/uint256"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/trie" "github.com/ethereum/go-ethereum/trie"
) )
......
...@@ -6,13 +6,11 @@ import ( ...@@ -6,13 +6,11 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
) )
func FakeGenesis(l1 rune, l2 rune, l1GenesisNumber int) rollup.Genesis { func FakeGenesis(l1 rune, l2 rune, l1GenesisNumber int) rollup.Genesis {
......
...@@ -3,11 +3,12 @@ package testutils ...@@ -3,11 +3,12 @@ package testutils
import ( import (
"context" "context"
"github.com/stretchr/testify/mock"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
"github.com/stretchr/testify/mock"
) )
type MockEthClient struct { type MockEthClient struct {
......
...@@ -6,9 +6,8 @@ import ( ...@@ -6,9 +6,8 @@ import (
"math/rand" "math/rand"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
) )
func RandomHash(rng *rand.Rand) (out common.Hash) { func RandomHash(rng *rand.Rand) (out common.Hash) {
......
...@@ -4,14 +4,12 @@ import ( ...@@ -4,14 +4,12 @@ import (
"fmt" "fmt"
"os" "os"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
proposer "github.com/ethereum-optimism/optimism/op-proposer"
"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli" "github.com/urfave/cli"
proposer "github.com/ethereum-optimism/optimism/op-proposer"
"github.com/ethereum-optimism/optimism/op-proposer/flags" "github.com/ethereum-optimism/optimism/op-proposer/flags"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum/go-ethereum/log"
) )
var ( var (
......
...@@ -3,14 +3,13 @@ package op_proposer ...@@ -3,14 +3,13 @@ package op_proposer
import ( import (
"time" "time"
"github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-proposer/flags"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof" oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc" oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
"github.com/urfave/cli"
"github.com/ethereum-optimism/optimism/op-proposer/flags"
) )
type Config struct { type Config struct {
......
...@@ -7,9 +7,10 @@ import ( ...@@ -7,9 +7,10 @@ import (
"math/big" "math/big"
"strings" "strings"
"github.com/ethereum-optimism/optimism/op-node/sources"
"github.com/ethereum-optimism/optimism/op-bindings/bindings" "github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-node/eth" "github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-proposer/rollupclient"
"github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -27,7 +28,7 @@ type Config struct { ...@@ -27,7 +28,7 @@ type Config struct {
Name string Name string
L1Client *ethclient.Client L1Client *ethclient.Client
L2Client *ethclient.Client L2Client *ethclient.Client
RollupClient *rollupclient.RollupClient RollupClient *sources.RollupClient
L2OOAddr common.Address L2OOAddr common.Address
ChainID *big.Int ChainID *big.Int
PrivKey *ecdsa.PrivateKey PrivKey *ecdsa.PrivateKey
......
package flags package flags
import ( import (
"github.com/urfave/cli"
opservice "github.com/ethereum-optimism/optimism/op-service" opservice "github.com/ethereum-optimism/optimism/op-service"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof" oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc" oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
"github.com/urfave/cli"
) )
const envVarPrefix = "OP_PROPOSER" const envVarPrefix = "OP_PROPOSER"
......
...@@ -12,23 +12,22 @@ import ( ...@@ -12,23 +12,22 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/ethereum/go-ethereum/crypto" hdwallet "github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli"
"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"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
oppprof "github.com/ethereum-optimism/optimism/op-service/pprof" oppprof "github.com/ethereum-optimism/optimism/op-service/pprof"
oprpc "github.com/ethereum-optimism/optimism/op-service/rpc" oprpc "github.com/ethereum-optimism/optimism/op-service/rpc"
"github.com/ethereum-optimism/optimism/op-proposer/drivers/l2output"
"github.com/ethereum-optimism/optimism/op-proposer/rollupclient"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr"
"github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"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"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
hdwallet "github.com/miguelmota/go-ethereum-hdwallet"
"github.com/urfave/cli"
) )
const ( const (
...@@ -247,7 +246,7 @@ func dialEthClientWithTimeout(ctx context.Context, url string) ( ...@@ -247,7 +246,7 @@ func dialEthClientWithTimeout(ctx context.Context, url string) (
// dialRollupClientWithTimeout attempts to dial the RPC provider using the provided // dialRollupClientWithTimeout attempts to dial the RPC provider using the provided
// URL. If the dial doesn't complete within defaultDialTimeout seconds, this // URL. If the dial doesn't complete within defaultDialTimeout seconds, this
// method will return an error. // method will return an error.
func dialRollupClientWithTimeout(ctx context.Context, url string) (*rollupclient.RollupClient, error) { func dialRollupClientWithTimeout(ctx context.Context, url string) (*sources.RollupClient, error) {
ctxt, cancel := context.WithTimeout(ctx, defaultDialTimeout) ctxt, cancel := context.WithTimeout(ctx, defaultDialTimeout)
defer cancel() defer cancel()
...@@ -256,7 +255,7 @@ func dialRollupClientWithTimeout(ctx context.Context, url string) (*rollupclient ...@@ -256,7 +255,7 @@ func dialRollupClientWithTimeout(ctx context.Context, url string) (*rollupclient
return nil, err return nil, err
} }
return rollupclient.NewRollupClient(client), nil return sources.NewRollupClient(client), nil
} }
// parseAddress parses an ETH address from a hex string. This method will fail if // parseAddress parses an ETH address from a hex string. This method will fail if
......
package rollupclient package rollupclient
import ( import (
"context" "github.com/ethereum-optimism/optimism/op-node/sources"
"math/big"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
) )
type RollupClient struct { // Deprecated: use sources.RollupClient instead
rpc *rpc.Client type RollupClient = sources.RollupClient
}
func NewRollupClient(rpc *rpc.Client) *RollupClient {
return &RollupClient{rpc}
}
func (r *RollupClient) OutputAtBlock(ctx context.Context, blockNum *big.Int) ([]eth.Bytes32, error) {
var output []eth.Bytes32
err := r.rpc.CallContext(ctx, &output, "optimism_outputAtBlock", hexutil.EncodeBig(blockNum))
return output, err
}
func (r *RollupClient) SyncStatus(ctx context.Context) (*driver.SyncStatus, error) {
var output *driver.SyncStatus
err := r.rpc.CallContext(ctx, &output, "optimism_syncStatus")
return output, err
}
func (r *RollupClient) RollupConfig(ctx context.Context) (*rollup.Config, error) {
var output *rollup.Config
err := r.rpc.CallContext(ctx, &output, "optimism_rollupConfig")
return output, err
}
func (r *RollupClient) Version(ctx context.Context) (string, error) { // Deprecated: use sources.NewRollupClient instead
var output string func NewRollupClient(rpc *rpc.Client) *sources.RollupClient {
err := r.rpc.CallContext(ctx, &output, "optimism_version") return sources.NewRollupClient(rpc)
return output, err
} }
...@@ -4,10 +4,11 @@ import ( ...@@ -4,10 +4,11 @@ import (
"errors" "errors"
"testing" "testing"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr" "github.com/ethereum-optimism/optimism/op-proposer/txmgr"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/stretchr/testify/require"
) )
const testSafeAbortNonceTooLowCount = 3 const testSafeAbortNonceTooLowCount = 3
......
...@@ -8,12 +8,13 @@ import ( ...@@ -8,12 +8,13 @@ import (
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/require"
"github.com/ethereum-optimism/optimism/op-proposer/txmgr" "github.com/ethereum-optimism/optimism/op-proposer/txmgr"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
) )
// testHarness houses the necessary resources to test the SimpleTxManager. // testHarness houses the necessary resources to test the SimpleTxManager.
......
...@@ -9,9 +9,11 @@ ...@@ -9,9 +9,11 @@
+------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------+ +------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract | | Name | Type | Slot | Offset | Bytes | Contract |
+============================================================================================================================================+ +============================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | spacer0 | address | 0 | 0 | 20 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | _initialized | uint8 | 0 | 20 | 1 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| _initializing | bool | 0 | 21 | 1 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| __gap | uint256[50] | 1 | 0 | 1600 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | __gap | uint256[50] | 1 | 0 | 1600 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
...@@ -27,36 +29,36 @@ ...@@ -27,36 +29,36 @@
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| __gap | uint256[49] | 152 | 0 | 1568 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | __gap | uint256[49] | 152 | 0 | 1568 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| successfulMessages | mapping(bytes32 => bool) | 201 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | spacer1 | uint256 | 201 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| spacer2 | uint256 | 202 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| xDomainMsgSender | address | 202 | 0 | 20 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | successfulMessages | mapping(bytes32 => bool) | 203 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| msgNonce | uint240 | 203 | 0 | 30 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | xDomainMsgSender | address | 204 | 0 | 20 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| otherMessenger | address | 204 | 0 | 20 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | msgNonce | uint240 | 205 | 0 | 30 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| receivedMessages | mapping(bytes32 => bool) | 205 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | otherMessenger | address | 206 | 0 | 20 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| blockedSystemAddresses | mapping(address => bool) | 206 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger | | receivedMessages | mapping(bytes32 => bool) | 207 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| blockedSystemAddresses | mapping(address => bool) | 208 | 0 | 32 | contracts/L1/L1CrossDomainMessenger.sol:L1CrossDomainMessenger |
+------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------+ +------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------+
======================= =======================
➡ L1StandardBridge ➡ L1StandardBridge
======================= =======================
+---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+ +----------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract | | Name | Type | Slot | Offset | Bytes | Contract |
+==============================================================================================================================================+ +=========================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | contracts/L1/L1StandardBridge.sol:L1StandardBridge | | spacer0 | uint256 | 0 | 0 | 32 | contracts/L1/L1StandardBridge.sol:L1StandardBridge |
|---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------| |----------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | contracts/L1/L1StandardBridge.sol:L1StandardBridge | | spacer1 | uint256 | 1 | 0 | 32 | contracts/L1/L1StandardBridge.sol:L1StandardBridge |
|---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------| |----------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| messenger | contract CrossDomainMessenger | 0 | 2 | 20 | contracts/L1/L1StandardBridge.sol:L1StandardBridge | | deposits | mapping(address => mapping(address => uint256)) | 2 | 0 | 32 | contracts/L1/L1StandardBridge.sol:L1StandardBridge |
|---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------| +----------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+
| otherBridge | contract StandardBridge | 1 | 0 | 20 | contracts/L1/L1StandardBridge.sol:L1StandardBridge |
|---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| deposits | mapping(address => mapping(address => uint256)) | 2 | 0 | 32 | contracts/L1/L1StandardBridge.sol:L1StandardBridge |
+---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+
======================= =======================
➡ L2OutputOracle ➡ L2OutputOracle
...@@ -170,9 +172,11 @@ ...@@ -170,9 +172,11 @@
+------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------+ +------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract | | Name | Type | Slot | Offset | Bytes | Contract |
+============================================================================================================================================+ +============================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | spacer0 | address | 0 | 0 | 20 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | _initialized | uint8 | 0 | 20 | 1 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| _initializing | bool | 0 | 21 | 1 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| __gap | uint256[50] | 1 | 0 | 1600 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | __gap | uint256[50] | 1 | 0 | 1600 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
...@@ -188,36 +192,36 @@ ...@@ -188,36 +192,36 @@
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| __gap | uint256[49] | 152 | 0 | 1568 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | __gap | uint256[49] | 152 | 0 | 1568 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| successfulMessages | mapping(bytes32 => bool) | 201 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | spacer1 | uint256 | 201 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| spacer2 | uint256 | 202 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| xDomainMsgSender | address | 202 | 0 | 20 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | successfulMessages | mapping(bytes32 => bool) | 203 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| msgNonce | uint240 | 203 | 0 | 30 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | xDomainMsgSender | address | 204 | 0 | 20 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| otherMessenger | address | 204 | 0 | 20 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | msgNonce | uint240 | 205 | 0 | 30 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| receivedMessages | mapping(bytes32 => bool) | 205 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | otherMessenger | address | 206 | 0 | 20 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------| |------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| blockedSystemAddresses | mapping(address => bool) | 206 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger | | receivedMessages | mapping(bytes32 => bool) | 207 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
|------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------|
| blockedSystemAddresses | mapping(address => bool) | 208 | 0 | 32 | contracts/L2/L2CrossDomainMessenger.sol:L2CrossDomainMessenger |
+------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------+ +------------------------+--------------------------+------+--------+-------+----------------------------------------------------------------+
======================= =======================
➡ L2StandardBridge ➡ L2StandardBridge
======================= =======================
+---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+ +----------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+
| Name | Type | Slot | Offset | Bytes | Contract | | Name | Type | Slot | Offset | Bytes | Contract |
+==============================================================================================================================================+ +=========================================================================================================================================+
| _initialized | uint8 | 0 | 0 | 1 | contracts/L2/L2StandardBridge.sol:L2StandardBridge | | spacer0 | uint256 | 0 | 0 | 32 | contracts/L2/L2StandardBridge.sol:L2StandardBridge |
|---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------| |----------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| _initializing | bool | 0 | 1 | 1 | contracts/L2/L2StandardBridge.sol:L2StandardBridge | | spacer1 | uint256 | 1 | 0 | 32 | contracts/L2/L2StandardBridge.sol:L2StandardBridge |
|---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------| |----------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| messenger | contract CrossDomainMessenger | 0 | 2 | 20 | contracts/L2/L2StandardBridge.sol:L2StandardBridge | | deposits | mapping(address => mapping(address => uint256)) | 2 | 0 | 32 | contracts/L2/L2StandardBridge.sol:L2StandardBridge |
|---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------| +----------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+
| otherBridge | contract StandardBridge | 1 | 0 | 20 | contracts/L2/L2StandardBridge.sol:L2StandardBridge |
|---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------|
| deposits | mapping(address => mapping(address => uint256)) | 2 | 0 | 32 | contracts/L2/L2StandardBridge.sol:L2StandardBridge |
+---------------+-------------------------------------------------+------+--------+-------+----------------------------------------------------+
======================= =======================
➡ L2ToL1MessagePasser ➡ L2ToL1MessagePasser
......
import fs from 'fs'
import { ethers } from 'ethers'
import { task, types } from 'hardhat/config'
import { Genesis, State } from '@eth-optimism/core-utils'
import '@eth-optimism/hardhat-deploy-config'
task('genesis-l1', 'create a genesis config')
.addOptionalParam(
'outfile',
'The file to write the output JSON to',
'genesis.json'
)
.addOptionalParam(
'l1GenesisBlockTimestamp',
'Timestamp to embed in L1 genesis block, current time will be used if the timestamp is zero',
0,
types.int
)
.setAction(async (args, hre) => {
const { deployConfig } = hre
const alloc: State = {}
const l1GenesisBlockTimestamp =
args.l1GenesisBlockTimestamp === 0
? Math.floor(Date.now() / 1000)
: args.l1GenesisBlockTimestamp
// Give each predeploy a single wei
for (let i = 0; i <= 0xff; i++) {
const buf = Buffer.alloc(2)
buf.writeUInt16BE(i, 0)
const addr = ethers.utils.hexConcat([
'0x000000000000000000000000000000000000',
ethers.utils.hexZeroPad(buf, 2),
])
alloc[addr] = {
balance: '0x1',
}
}
const accounts = [
'0x14dC79964da2C08b23698B3D3cc7Ca32193d9955',
'0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65',
'0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec',
'0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f',
'0x2546BcD3c84621e976D8185a91A922aE77ECEc30',
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',
'0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
'0x71bE63f3384f5fb98995898A86B02Fb2426c5788',
'0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199',
'0x90F79bf6EB2c4f870365E785982E1f101E93b906',
'0x976EA74026E726554dB657fA54763abd0C3a0aa9',
'0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc',
'0xBcd4042DE499D14e55001CcbB24a551F3b954096',
'0xFABB0ac9d68B0B445fB7357272Ff202C5651694a',
'0xa0Ee7A142d267C1f36714E4a8F75612F20a79720',
'0xbDA5747bFD65F08deb54cb465eB87D40e51B197E',
'0xcd3B766CCDd6AE721141F452C550Ca635964ce71',
'0xdD2FD4581271e230360230F9337D5c0430Bf44C0',
'0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097',
'0xde3829a23df1479438622a08a116e8eb3f620bb5',
'0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
]
for (const account of accounts) {
alloc[ethers.utils.getAddress(account)] = {
balance:
'0x200000000000000000000000000000000000000000000000000000000000000',
}
}
const genesis: Genesis = {
config: {
chainId: deployConfig.l1ChainID,
homesteadBlock: 0,
eip150Block: 0,
eip150Hash: ethers.constants.HashZero,
eip155Block: 0,
eip158Block: 0,
byzantiumBlock: 0,
constantinopleBlock: 0,
petersburgBlock: 0,
istanbulBlock: 0,
muirGlacierBlock: 0,
berlinBlock: 0,
londonBlock: 0,
clique: {
period: deployConfig.l1BlockTime,
epoch: 30000,
},
},
nonce: deployConfig.l1GenesisBlockNonce,
timestamp: ethers.BigNumber.from(l1GenesisBlockTimestamp).toHexString(),
extraData: ethers.utils.hexConcat([
ethers.constants.HashZero,
deployConfig.cliqueSignerAddress,
ethers.utils.hexZeroPad('0x', 65),
]),
gasLimit: deployConfig.l1GenesisBlockGasLimit,
difficulty: deployConfig.l1GenesisBlockDifficulty,
mixHash: deployConfig.l1GenesisBlockMixHash,
coinbase: deployConfig.l1GenesisBlockCoinbase,
alloc,
number: deployConfig.l1GenesisBlockNumber,
gasUsed: deployConfig.l1GenesisBlockGasUsed,
parentHash: deployConfig.l1GenesisBlockParentHash,
baseFeePerGas: deployConfig.l1GenesisBlockBaseFeePerGas,
}
fs.writeFileSync(args.outfile, JSON.stringify(genesis, null, 2))
})
import fs from 'fs'
import path from 'path'
import assert from 'assert'
import { OptimismGenesis, State } from '@eth-optimism/core-utils'
import 'hardhat-deploy'
import '@eth-optimism/hardhat-deploy-config'
import { ethers, utils, BigNumber } from 'ethers'
import { task } from 'hardhat/config'
import { HardhatRuntimeEnvironment } from 'hardhat/types'
import {
CompilerOutputSource,
CompilerOutputContract,
BuildInfo,
} from 'hardhat/types/artifacts'
import { predeploys } from '../src'
const { hexZeroPad, hexConcat, hexDataSlice, getAddress } = utils
const prefix = '0x420000000000000000000000000000000000'
const implementationSlot =
'0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc'
const adminSlot =
'0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103'
const toCodeAddr = (addr: string) => {
const address = hexConcat([
'0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3',
'0x' + addr.slice(prefix.length),
])
return getAddress(address)
}
const toBytes32 = (num: number): string => {
const big = BigNumber.from(num)
return hexZeroPad(big.toHexString(), 32)
}
const assertEvenLength = (str: string) => {
assert(str.length % 2 === 0, str)
}
// TODO: fix this to be compatible with smock's version
const getStorageLayout = async (
hre: HardhatRuntimeEnvironment,
name: string
) => {
const buildInfo = await hre.artifacts.getBuildInfo(name)
const keys = Object.keys(buildInfo.output.contracts)
for (const key of keys) {
if (name === path.basename(key, '.sol')) {
const contract = buildInfo.output.contracts[key]
const storageLayout = (contract[name] as any).storageLayout
return storageLayout || { storage: [], types: {} }
}
}
throw new Error(`Cannot locate storageLayout for ${name}`)
}
// Find the contract and source from the build info
const findContractAndSource = (name: string, buildInfo: BuildInfo) => {
const sources = buildInfo.output.sources
const contracts = buildInfo.output.contracts
const compilerOutputContracts: CompilerOutputContract[] = []
for (const [contractName, contract] of Object.entries(contracts)) {
if (path.basename(contractName, '.sol') === name) {
compilerOutputContracts.push(contract[name])
}
}
if (compilerOutputContracts.length === 0) {
throw new Error(`Cannot find compiler output contract for ${name}`)
}
if (compilerOutputContracts.length !== 1) {
console.log(`Unexpected number of contracts for ${name}`)
}
const outputContract = compilerOutputContracts[0]
const compilerOutputSources: CompilerOutputSource[] = []
for (const [contractName, source] of Object.entries(sources)) {
if (path.basename(contractName, '.sol') === name) {
compilerOutputSources.push(source as CompilerOutputSource)
}
}
if (compilerOutputSources.length === 0) {
throw new Error(`Cannot find compiler output source for ${name}`)
}
if (compilerOutputSources.length !== 1) {
console.log(`Unexpected number of sources for ${name}`)
}
const outputSource = compilerOutputSources[0]
return { outputContract, outputSource }
}
const replaceImmutables = async (
hre: HardhatRuntimeEnvironment,
name: string,
immutables: object
): Promise<string> => {
const artifact = await hre.artifacts.readArtifact(name)
const buildInfo = await hre.artifacts.getBuildInfo(name)
const { outputContract, outputSource } = findContractAndSource(
name,
buildInfo
)
// Get the immutable references. They look like this:
// { ast-id: [ {start, length} ] }
const immutableReferences =
outputContract.evm.deployedBytecode.immutableReferences
const names = {}
// Recursively find all of the immutables by traversing the solc output ast
const findNames = (ast: any) => {
// Add the name of the variable if it is an immutable
const isImmutable = ast.mutability === 'immutable'
const isASTNode = typeof ast.name === 'string' && typeof ast.id === 'number'
if (isASTNode && isImmutable) {
names[ast.name] = ast.id
}
// Iterate over each node
if (Array.isArray(ast.nodes)) {
for (const node of ast.nodes) {
findNames(node)
}
}
// Handle contracts that are inherited from
if (Array.isArray(ast.baseContracts)) {
for (const baseContract of ast.baseContracts) {
if (baseContract.baseName) {
const base = findContractAndSource(
baseContract.baseName.name,
buildInfo
)
findNames(base.outputSource.ast)
}
}
}
}
findNames(outputSource.ast)
let deployedBytecode = artifact.deployedBytecode
const presize = deployedBytecode.length
// For each of the immutables, put the value into the bytecode
for (const [key, value] of Object.entries(immutables)) {
const astId = names[key]
if (!astId) {
throw new Error(`Unknown immutable ${key} in contract ${name}`)
}
const offsets = immutableReferences[astId]
if (!offsets) {
throw new Error(`Unknown AST id ${astId} in contract ${name}`)
}
// Insert the value at each one
for (const offset of offsets) {
if (offset.length !== 32) {
throw new Error(
`Immutable slicing must be updated to handle arbitrary size immutables`
)
}
// Ensure that the value being sliced out is 0
const val = hexDataSlice(
deployedBytecode,
offset.start,
offset.start + offset.length
)
if (!BigNumber.from(val).eq(0)) {
throw new Error(`Unexpected value in immutable bytecode ${val}`)
}
deployedBytecode = ethers.utils.hexConcat([
hexDataSlice(deployedBytecode, 0, offset.start),
hexZeroPad(value, 32),
hexDataSlice(deployedBytecode, offset.start + offset.length),
])
}
}
// Ensure that the bytecode is the same size
if (presize !== deployedBytecode.length) {
throw new Error(
`Size mismatch! Before ${presize}, after ${deployedBytecode.length}`
)
}
return deployedBytecode
}
task('genesis-l2', 'create a genesis config')
.addOptionalParam(
'outfile',
'The file to write the output JSON to',
'genesis.json'
)
.addOptionalParam('l1RpcUrl', 'The L1 RPC URL', 'http://127.0.0.1:8545')
.setAction(async (args, hre) => {
const {
computeStorageSlots,
// eslint-disable-next-line @typescript-eslint/no-var-requires
} = require('@defi-wonderland/smock/dist/src/utils')
const { deployConfig } = hre
const l1 = new ethers.providers.StaticJsonRpcProvider(args.l1RpcUrl)
const l1StartingBlock = await l1.getBlock(deployConfig.l1StartingBlockTag)
if (l1StartingBlock === null) {
throw new Error(
`Cannot fetch block tag ${deployConfig.l1StartingBlockTag}`
)
}
if (l1StartingBlock === null) {
console.log(`Unable to fetch L1 block that rollup starts at`)
}
// Use the addresses of the proxies here instead of the implementations
// Be backwards compatible
let ProxyL1CrossDomainMessenger = await hre.deployments.getOrNull(
'Proxy__OVM_L1CrossDomainMessenger'
)
if (ProxyL1CrossDomainMessenger === undefined) {
ProxyL1CrossDomainMessenger = await hre.deployments.get(
'L1CrossDomainMessengerProxy'
)
}
// Be backwards compatible
let ProxyL1StandardBridge = await hre.deployments.getOrNull(
'Proxy__OVM_L1StandardBridge'
)
if (ProxyL1StandardBridge === undefined) {
ProxyL1StandardBridge = await hre.deployments.get('L1StandardBridgeProxy')
}
const variables = {
L2ToL1MessagePasser: {
nonce: 0,
},
L2CrossDomainMessenger: {
_initialized: 1,
_owner: deployConfig.l2CrossDomainMessengerOwner,
xDomainMsgSender: '0x000000000000000000000000000000000000dEaD',
msgNonce: 0,
otherMessenger: ProxyL1CrossDomainMessenger.address,
// TODO: handle blockedSystemAddresses mapping
// blockedSystemAddresses: [{key: '', value: ''}],
},
GasPriceOracle: {
_owner: deployConfig.gasPriceOracleOwner,
overhead: deployConfig.gasPriceOracleOverhead,
scalar: deployConfig.gasPriceOracleScalar,
decimals: deployConfig.gasPriceOracleDecimals,
},
SequencerFeeVault: {
l1FeeWallet: ethers.constants.AddressZero,
},
L1Block: {
number: l1StartingBlock.number,
timestamp: l1StartingBlock.timestamp,
basefee: l1StartingBlock.baseFeePerGas,
hash: l1StartingBlock.hash,
sequenceNumber: 0,
},
LegacyERC20ETH: {
bridge: predeploys.L2StandardBridge,
remoteToken: ethers.constants.AddressZero,
_name: 'Ether',
_symbol: 'ETH',
},
WETH9: {
name: 'Wrapped Ether',
symbol: 'WETH',
decimals: 18,
},
GovernanceToken: {
name: 'Optimism',
symbol: 'OP',
// TODO: this should be the mint manager
// in practice. Just use a hardhat account
// because this is only used for devnets
_owner: '0x829BD824B016326A401d083B33D092293333A830',
},
}
assertEvenLength(implementationSlot)
assertEvenLength(adminSlot)
const predeployAddrs = new Set()
for (const addr of Object.values(predeploys)) {
predeployAddrs.add(getAddress(addr))
}
const alloc: State = {}
// Use the address of the deployed ProxyAdmin as the admin for
// each Proxy
const Deployment__ProxyAdmin = await hre.deployments.get('ProxyAdmin')
// Set a proxy at each predeploy address
const proxy = await hre.artifacts.readArtifact('Proxy')
for (let i = 0; i <= 2048; i++) {
const num = hexZeroPad('0x' + i.toString(16), 2)
const addr = getAddress(ethers.utils.hexConcat([prefix, num]))
// There is no proxy at LegacyERC20ETH or the GovernanceToken
if (
addr === getAddress(predeploys.LegacyERC20ETH) ||
addr === getAddress(predeploys.GovernanceToken)
) {
continue
}
alloc[addr] = {
nonce: '0x0',
balance: '0x0',
code: proxy.deployedBytecode,
storage: {
[adminSlot]: Deployment__ProxyAdmin.address,
},
}
if (predeployAddrs.has(getAddress(addr))) {
const predeploy = Object.entries(predeploys).find(([, address]) => {
return getAddress(address) === addr
})
// Really shouldn't happen, since predeployAddrs is a set generated from predeploys.
if (predeploy === undefined) {
throw new Error('could not find address')
}
const name = predeploy[0]
if (variables[name]) {
const storageLayout = await getStorageLayout(hre, name)
if (storageLayout === undefined) {
throw new Error(`cannot find storage layout for ${name}`)
}
const slots = computeStorageSlots(storageLayout, variables[name])
for (const slot of slots) {
alloc[addr].storage[slot.key] = slot.val
}
}
alloc[addr].storage[implementationSlot] = toCodeAddr(addr)
}
}
// Set the GovernanceToken in the state
// Cannot easily set storage due to no easy access to compiler
// output
const governanceToken = await hre.deployments.getArtifact('GovernanceToken')
alloc[predeploys.GovernanceToken] = {
nonce: '0x0',
balance: '0x0',
code: governanceToken.deployedBytecode,
}
// Give each predeploy a single wei
for (let i = 0; i <= 0xff; i++) {
const buf = Buffer.alloc(2)
buf.writeUInt16BE(i, 0)
const addr = ethers.utils.hexConcat([
'0x000000000000000000000000000000000000',
hexZeroPad(buf, 2),
])
alloc[addr] = {
balance: '0x1',
}
}
const accounts = [
'0x14dC79964da2C08b23698B3D3cc7Ca32193d9955',
'0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65',
'0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec',
'0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f',
'0x2546BcD3c84621e976D8185a91A922aE77ECEc30',
'0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',
'0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
'0x71bE63f3384f5fb98995898A86B02Fb2426c5788',
'0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199',
'0x90F79bf6EB2c4f870365E785982E1f101E93b906',
'0x976EA74026E726554dB657fA54763abd0C3a0aa9',
'0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc',
'0xBcd4042DE499D14e55001CcbB24a551F3b954096',
'0xFABB0ac9d68B0B445fB7357272Ff202C5651694a',
'0xa0Ee7A142d267C1f36714E4a8F75612F20a79720',
'0xbDA5747bFD65F08deb54cb465eB87D40e51B197E',
'0xcd3B766CCDd6AE721141F452C550Ca635964ce71',
'0xdD2FD4581271e230360230F9337D5c0430Bf44C0',
'0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097',
'0xde3829a23df1479438622a08a116e8eb3f620bb5',
'0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
]
for (const account of accounts) {
alloc[account] = {
balance:
'0x200000000000000000000000000000000000000000000000000000000000000',
}
}
// Note: this currently only supports up to 32 byte values.
// Things less than 32 bytes will be left padded with 0 bytes
const immutables = {
OptimismMintableERC20Factory: {
bridge: predeploys.L2StandardBridge,
},
GasPriceOracle: {
MAJOR_VERSION: toBytes32(0),
MINOR_VERSION: toBytes32(0),
PATCH_VERSION: toBytes32(1),
},
L1Block: {
MAJOR_VERSION: toBytes32(0),
MINOR_VERSION: toBytes32(0),
PATCH_VERSION: toBytes32(1),
},
L2CrossDomainMessenger: {
MAJOR_VERSION: toBytes32(0),
MINOR_VERSION: toBytes32(0),
PATCH_VERSION: toBytes32(1),
},
L2StandardBridge: {
MAJOR_VERSION: toBytes32(0),
MINOR_VERSION: toBytes32(0),
PATCH_VERSION: toBytes32(2),
messenger: predeploys.L2CrossDomainMessenger,
otherBridge: ProxyL1StandardBridge.address,
},
L2ToL1MessagePasser: {
MAJOR_VERSION: toBytes32(0),
MINOR_VERSION: toBytes32(0),
PATCH_VERSION: toBytes32(1),
},
SequencerFeeVault: {
MAJOR_VERSION: toBytes32(0),
MINOR_VERSION: toBytes32(0),
PATCH_VERSION: toBytes32(1),
},
}
// Set the predeploys in the state
for (const [name, addr] of Object.entries(predeploys)) {
if (name === 'GovernanceToken') {
continue
}
const artifact = await hre.artifacts.readArtifact(name)
assertEvenLength(artifact.deployedBytecode)
const allocAddr = name === 'LegacyERC20ETH' ? addr : toCodeAddr(addr)
assertEvenLength(allocAddr)
const immutableConfig = immutables[name]
const deployedBytecode = immutableConfig
? await replaceImmutables(hre, name, immutableConfig)
: artifact.deployedBytecode
assertEvenLength(deployedBytecode)
// TODO(tynes): initialize contracts that should be initialized
// in the implementations here
alloc[allocAddr] = {
nonce: '0x00',
balance: '0x00',
code: deployedBytecode,
storage: {},
}
}
const startingTimestamp = l1StartingBlock?.timestamp || 0
const genesis: OptimismGenesis = {
config: {
chainId: deployConfig.l2ChainID,
homesteadBlock: 0,
eip150Block: 0,
eip150Hash: ethers.constants.HashZero,
eip155Block: 0,
eip158Block: 0,
byzantiumBlock: 0,
constantinopleBlock: 0,
petersburgBlock: 0,
istanbulBlock: 0,
muirGlacierBlock: 0,
berlinBlock: 0,
londonBlock: 0,
mergeNetsplitBlock: 0,
terminalTotalDifficulty: 0,
optimism: {
baseFeeRecipient: deployConfig.optimismBaseFeeRecipient,
l1FeeRecipient: deployConfig.optimismL1FeeRecipient,
},
},
nonce: deployConfig.l2GenesisBlockNonce,
timestamp: ethers.BigNumber.from(startingTimestamp).toHexString(),
extraData: deployConfig.l2GenesisBlockExtraData,
gasLimit: deployConfig.l2GenesisBlockGasLimit,
difficulty: deployConfig.l2GenesisBlockDifficulty,
mixHash: deployConfig.l2GenesisBlockMixHash,
coinbase: deployConfig.l2GenesisBlockCoinbase,
number: deployConfig.l2GenesisBlockNumber,
gasUsed: deployConfig.l2GenesisBlockGasUsed,
parentHash: deployConfig.l2GenesisBlockParentHash,
baseFeePerGas: deployConfig.l2GenesisBlockBaseFeePerGas,
alloc,
}
fs.writeFileSync(args.outfile, JSON.stringify(genesis, null, 2))
})
import './genesis-l1'
import './genesis-l2'
import './deposits' import './deposits'
import './rekey' import './rekey'
import './rollup-config' import './rollup-config'
......
...@@ -153,6 +153,11 @@ export const BRIDGE_ADAPTER_DATA: { ...@@ -153,6 +153,11 @@ export const BRIDGE_ADAPTER_DATA: {
[ChainID in L2ChainID]?: BridgeAdapterData [ChainID in L2ChainID]?: BridgeAdapterData
} = { } = {
[L2ChainID.OPTIMISM]: { [L2ChainID.OPTIMISM]: {
wstETH: {
Adapter: DAIBridgeAdapter,
l1Bridge: '0x76943C0D61395d8F2edF9060e1533529cAe05dE6' as const,
l2Bridge: '0x8E01013243a96601a86eb3153F0d9Fa4fbFb6957' as const,
},
BitBTC: { BitBTC: {
Adapter: StandardBridgeAdapter, Adapter: StandardBridgeAdapter,
l1Bridge: '0xaBA2c5F108F7E820C049D5Af70B16ac266c8f128' as const, l1Bridge: '0xaBA2c5F108F7E820C049D5Af70B16ac266c8f128' as const,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment