Skip to content

Commit 75f5fa1

Browse files
committed
add container names
1 parent e06d56b commit 75f5fa1

7 files changed

Lines changed: 20 additions & 3 deletions

File tree

share/shwap/eds_id.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import (
88
)
99

1010
// EdsIDSize defines the byte size of the EdsID.
11-
const EdsIDSize = 8
11+
const (
12+
EdsIDSize = 8
13+
EDSName = "eds_v0"
14+
)
1215

1316
// ErrOutOfBounds is returned whenever an index is out of bounds.
1417
var (

share/shwap/namespace_data.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111
"github.com/celestiaorg/celestia-node/share/shwap/pb"
1212
)
1313

14+
// NamespaceDataName is the name identifier for the namespace data container.
15+
const NamespaceDataName = "nd_v0"
16+
1417
// NamespacedData stores collections of RowNamespaceData, each representing shares and their proofs
1518
// within a namespace.
1619
type NamespacedData []RowNamespaceData

share/shwap/p2p/shrex/shrexeds/params.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package shrexeds
22

33
import (
44
"fmt"
5+
"github.com/celestiaorg/celestia-node/share/shwap"
56

67
logging "github.com/ipfs/go-log/v2"
78

89
"github.com/celestiaorg/celestia-node/share/shwap/p2p/shrex"
910
)
1011

11-
const protocolString = "/shrex/eds/v0.1.0"
12+
const protocolString = "/shrex/v0.1.0/" + shwap.EDSName
1213

1314
var log = logging.Logger("shrex/eds")
1415

share/shwap/p2p/shrex/shrexnd/params.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package shrexnd
22

33
import (
44
"fmt"
5+
"github.com/celestiaorg/celestia-node/share/shwap"
56

67
logging "github.com/ipfs/go-log/v2"
78

89
"github.com/celestiaorg/celestia-node/share/shwap/p2p/shrex"
910
)
1011

11-
const protocolString = "/shrex/nd/v0.1.0"
12+
const protocolString = "/shrex/v0.1.0" + shwap.NamespaceDataName
1213

1314
var log = logging.Logger("shrex/nd")
1415

share/shwap/row.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import (
1010
"github.com/celestiaorg/celestia-node/share/shwap/pb"
1111
)
1212

13+
// RowName is the name identifier for the row container.
14+
const RowName = "row_v0"
15+
1316
// RowSide enumerates the possible sides of a row within an Extended Data Square (EDS).
1417
type RowSide int
1518

share/shwap/row_namespace_data.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import (
1313
"github.com/celestiaorg/celestia-node/share/shwap/pb"
1414
)
1515

16+
// RowNamespaceDataName is the name identifier for the row namespace data container.
17+
const RowNamespaceDataName = "rnd_v0"
18+
1619
// ErrNamespaceOutsideRange is returned by RowNamespaceDataFromShares when the target namespace is
1720
// outside of the namespace range for the given row. In this case, the implementation cannot return
1821
// the non-inclusion proof and will return ErrNamespaceOutsideRange.

share/shwap/sample.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import (
1313
"github.com/celestiaorg/celestia-node/share/shwap/pb"
1414
)
1515

16+
// SampleName is the name identifier for the sample container.
17+
const SampleName = "sample_v0"
18+
1619
// ErrFailedVerification is returned when inclusion proof verification fails. It is returned
1720
// when the data and the proof do not match trusted data root.
1821
var ErrFailedVerification = errors.New("failed to verify inclusion")

0 commit comments

Comments
 (0)