diff --git a/go.sum b/go.sum index f14554792135..77df25a16155 100644 --- a/go.sum +++ b/go.sum @@ -70,21 +70,9 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/celestiaorg/go-cnc v0.3.0 h1:eAVPNHGpx+2sBO7NZyQ1+VW8rzf6W4FQDlSq6aqSTsM= -github.com/celestiaorg/go-cnc v0.3.0/go.mod h1:zYzvHudSd1iNPuHBMyvZ1YvWou5aT9JXgtch9Tkaf70= -github.com/celestiaorg/go-fraud v0.2.0 h1:aaq2JiW0gTnhEdac3l51UCqSyJ4+VjFGTTpN83V4q7I= -github.com/celestiaorg/go-fraud v0.2.0/go.mod h1:lNY1i4K6kUeeE60Z2VK8WXd+qXb8KRzfBhvwPkK6aUc= -github.com/celestiaorg/go-header v0.3.1 h1:rJuFPVMoI20Du4KHWLz0IMllEIp0XgIWi9lHQLPWmq8= -github.com/celestiaorg/go-header v0.3.1/go.mod h1:H8xhnDLDLbkpwmWPhCaZyTnIV3dlVxBHPnxNXS2Qu6c= -github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc= -github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4/go.mod h1:fzuHnhzj1pUygGz+1ZkB3uQbEUL4htqCGJ4Qs2LwMZA= -github.com/celestiaorg/nmt v0.19.0 h1:9VXFeI/gt+q8h5HeCE0RjXJhOxsFzxJUjHrkvF9CMYE= -github.com/celestiaorg/nmt v0.19.0/go.mod h1:Oz15Ub6YPez9uJV0heoU4WpFctxazuIhKyUtaYNio7E= -github.com/celestiaorg/rsmt2d v0.11.0 h1:lcto/637WyTEZR3dLRoNvyuExfnUbxvdvKi3qz/2V4k= -github.com/celestiaorg/rsmt2d v0.11.0/go.mod h1:6Y580I3gVr0+OVFfW6m2JTwnCCmvW3WfbwSLfuT+HCA= -github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= +github.com/celestiaorg/go-cnc v0.4.1 h1:7fz8Y8HKKxE2dCp2m9Qlm+NoROxJWGCiKtcvaYp8iM8= +github.com/celestiaorg/go-cnc v0.4.1/go.mod h1:zYzvHudSd1iNPuHBMyvZ1YvWou5aT9JXgtch9Tkaf70= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= diff --git a/op-batcher/batcher/driver.go b/op-batcher/batcher/driver.go index 0e07220a6cf2..9e2504e0424b 100644 --- a/op-batcher/batcher/driver.go +++ b/op-batcher/batcher/driver.go @@ -2,7 +2,6 @@ package batcher import ( "context" - "encoding/hex" "errors" "fmt" "io" diff --git a/op-celestia/go.mod b/op-celestia/go.mod new file mode 100644 index 000000000000..ea993b8cfb1f --- /dev/null +++ b/op-celestia/go.mod @@ -0,0 +1,11 @@ +module github.com/ethereum-optimism/optimism/op-celestia + +go 1.19 + +require github.com/celestiaorg/go-cnc v0.4.1 + +require ( + github.com/go-resty/resty/v2 v2.7.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect +) diff --git a/op-celestia/go.sum b/op-celestia/go.sum new file mode 100644 index 000000000000..37e622ee7363 --- /dev/null +++ b/op-celestia/go.sum @@ -0,0 +1,42 @@ +github.com/celestiaorg/go-cnc v0.4.1 h1:7fz8Y8HKKxE2dCp2m9Qlm+NoROxJWGCiKtcvaYp8iM8= +github.com/celestiaorg/go-cnc v0.4.1/go.mod h1:zYzvHudSd1iNPuHBMyvZ1YvWou5aT9JXgtch9Tkaf70= +github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= +github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc= +golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/op-e2e/actions/l2_verifier.go b/op-e2e/actions/l2_verifier.go index d391f59433a9..76d6c4603cc8 100644 --- a/op-e2e/actions/l2_verifier.go +++ b/op-e2e/actions/l2_verifier.go @@ -59,7 +59,7 @@ type L2API interface { func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, eng L2API, cfg *rollup.Config, syncCfg *sync.Config) *L2Verifier { metrics := &testutils.TestDerivationMetrics{} - daCfg, err := rollup.NewDAConfig("http://localhost:26659", "e8e5f679bf7116cb") + daCfg, err := rollup.NewDAConfig("http://localhost:26659", "0000e8e5f679bf7116cb") require.NoError(t, err) pipeline := derive.NewDerivationPipeline(log, cfg, daCfg, l1, eng, metrics, syncCfg) pipeline.Reset() diff --git a/op-e2e/setup.go b/op-e2e/setup.go index 3b407023de28..0c8af1c2be4f 100644 --- a/op-e2e/setup.go +++ b/op-e2e/setup.go @@ -77,7 +77,7 @@ func newTxMgrConfig(l1Addr string, privKey *ecdsa.PrivateKey) txmgr.CLIConfig { ReceiptQueryInterval: 50 * time.Millisecond, NetworkTimeout: 2 * time.Second, TxNotInMempoolTimeout: 2 * time.Minute, - NamespaceId: "e8e5f679bf7116cb", + NamespaceId: "000008e5f679bf7116cb", } } @@ -620,7 +620,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste } node, err := rollupNode.New(context.Background(), &c, l, snapLog, "", metrics.NewMetrics("")) - daCfg, err := rollup.NewDAConfig("http://127.0.0.1:26659", "e8e5f679bf7116cb") + daCfg, err := rollup.NewDAConfig("http://127.0.0.1:26659", "0000e8e5f679bf7116cb") if err != nil { return nil, err } diff --git a/op-node/flags/flags.go b/op-node/flags/flags.go index 8b3c43c31c34..d7862d4feb02 100644 --- a/op-node/flags/flags.go +++ b/op-node/flags/flags.go @@ -48,7 +48,7 @@ var ( NamespaceId = cli.StringFlag{ Name: "namespace-id", Usage: "Namespace ID for DA node", - Value: "e8e5f679bf7116cb", + Value: "000008e5f679bf7116cb", EnvVar: prefixEnvVar("NAMESPACE_ID"), } Network = cli.StringFlag{ diff --git a/op-node/rollup/da_config.go b/op-node/rollup/da_config.go index 1d67fc046f38..e036e50eae8b 100644 --- a/op-node/rollup/da_config.go +++ b/op-node/rollup/da_config.go @@ -8,26 +8,27 @@ import ( ) type DAConfig struct { - Rpc string - NamespaceId [8]byte - Client *cnc.Client + Rpc string + Namespace cnc.Namespace + Client *cnc.Client } -func NewDAConfig(rpc string, namespaceId string) (*DAConfig, error) { - var nid [8]byte - n, err := hex.DecodeString(namespaceId) +func NewDAConfig(rpc string, ns string) (*DAConfig, error) { + nsBytes, err := hex.DecodeString(ns) if err != nil { return &DAConfig{}, err } - copy(nid[:], n) + + namespace := cnc.MustNewV0(nsBytes) + daClient, err := cnc.NewClient(rpc, cnc.WithTimeout(30*time.Second)) if err != nil { return &DAConfig{}, err } return &DAConfig{ - NamespaceId: nid, - Rpc: rpc, - Client: daClient, + Namespace: namespace, + Rpc: rpc, + Client: daClient, }, nil } diff --git a/op-node/rollup/derive/calldata_source.go b/op-node/rollup/derive/calldata_source.go index 3d34c4a16390..a1e19317c1c6 100644 --- a/op-node/rollup/derive/calldata_source.go +++ b/op-node/rollup/derive/calldata_source.go @@ -145,8 +145,8 @@ func DataFromEVMTransactions(config *rollup.Config, daCfg *rollup.DAConfig, batc log.Warn("unable to decode data pointer", "index", j, "err", err) continue } - log.Warn("requesting celestia namespaced data", "namespace", hex.EncodeToString(daCfg.NamespaceId[:]), "height", height) - data, err := daCfg.Client.NamespacedData(context.Background(), daCfg.NamespaceId, uint64(height)) + log.Warn("requesting celestia namespaced data", "namespace", hex.EncodeToString(daCfg.Namespace.Bytes()), "height", height) + data, err := daCfg.Client.NamespacedData(context.Background(), daCfg.Namespace, uint64(height)) if err != nil { log.Warn("unable to retrieve data from da", "err", err) return nil, err diff --git a/ops-bedrock/docker-compose-devnet.yml b/ops-bedrock/docker-compose-devnet.yml index 44246f5968d1..1a487075cbae 100644 --- a/ops-bedrock/docker-compose-devnet.yml +++ b/ops-bedrock/docker-compose-devnet.yml @@ -102,7 +102,7 @@ services: --pprof.enabled --rpc.enable-admin --da-rpc=http://da:26659 - --namespace-id=e8e5f679bf7116cb + --namespace-id=000008e5f679bf7116cb ports: - "7545:8545" - "9003:9003" diff --git a/ops-bedrock/docker-compose-testnet.yml b/ops-bedrock/docker-compose-testnet.yml index e62002290306..5622f34f82bd 100644 --- a/ops-bedrock/docker-compose-testnet.yml +++ b/ops-bedrock/docker-compose-testnet.yml @@ -15,13 +15,13 @@ services: container_name: celestia-light-node user: root platform: "${PLATFORM}" - image: "ghcr.io/celestiaorg/celestia-node:e5efcb0" - command: celestia light start --core.ip https://rpc-blockspacerace.pops.one/ --gateway --gateway.addr da --gateway.port 26659 --p2p.network blockspacerace + image: "ghcr.io/celestiaorg/celestia-node:v0.11.0-rc1" + command: celestia light start --core.ip http://consensus-full-arabica-8.celestia-arabica.com/ --gateway --gateway.addr da --gateway.port 26659 --p2p.network arabica environment: - NODE_TYPE=light - - P2P_NETWORK=blockspacerace + - P2P_NETWORK=arabica volumes: - - $HOME/.celestia-light-blockspacerace-0/:/home/celestia/.celestia-light-blockspacerace-0/ + - $HOME/.celestia-light-arabica-8/:/home/celestia/.celestia-light-arabica-8/ ports: - "26657:26657" - "26659:26659" @@ -86,7 +86,7 @@ services: --pprof.enabled --rpc.enable-admin --da-rpc=http://da:26659 - --namespace-id=e8e5f679bf7116cb + --namespace-id=000008e5f679bf7116cb ports: - "7545:8545" - "9003:9003" @@ -123,7 +123,7 @@ services: OP_PROPOSER_PPROF_ENABLED: "true" OP_PROPOSER_METRICS_ENABLED: "true" OP_PROPOSER_ALLOW_NON_FINALIZED: "false" - OP_PROPOSER_NAMESPACE_ID: "e8e5f679bf7116cb" + OP_PROPOSER_NAMESPACE_ID: "000008e5f679bf7116cb" OP_PROPOSER_DA_RPC: http://da:26659 OP_PROPOSER_NETWORK_TIMEOUT: 180s @@ -166,7 +166,7 @@ services: OP_BATCHER_PPROF_ENABLED: "true" OP_BATCHER_METRICS_ENABLED: "true" OP_BATCHER_RPC_ENABLE_ADMIN: "true" - OP_BATCHER_NAMESPACE_ID: "e8e5f679bf7116cb" + OP_BATCHER_NAMESPACE_ID: "000008e5f679bf7116cb" OP_BATCHER_DA_RPC: http://da:26659 stateviz: