Skip to content

Commit

Permalink
add container names
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Jul 30, 2024
1 parent e06d56b commit 75f5fa1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
5 changes: 4 additions & 1 deletion share/shwap/eds_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import (
)

// EdsIDSize defines the byte size of the EdsID.
const EdsIDSize = 8
const (
EdsIDSize = 8
EDSName = "eds_v0"
)

// ErrOutOfBounds is returned whenever an index is out of bounds.
var (
Expand Down
3 changes: 3 additions & 0 deletions share/shwap/namespace_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
"github.com/celestiaorg/celestia-node/share/shwap/pb"
)

// NamespaceDataName is the name identifier for the namespace data container.
const NamespaceDataName = "nd_v0"

// NamespacedData stores collections of RowNamespaceData, each representing shares and their proofs
// within a namespace.
type NamespacedData []RowNamespaceData
Expand Down
3 changes: 2 additions & 1 deletion share/shwap/p2p/shrex/shrexeds/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package shrexeds

import (
"fmt"
"github.com/celestiaorg/celestia-node/share/shwap"

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

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

const protocolString = "/shrex/eds/v0.1.0"
const protocolString = "/shrex/v0.1.0/" + shwap.EDSName

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

Expand Down
3 changes: 2 additions & 1 deletion share/shwap/p2p/shrex/shrexnd/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package shrexnd

import (
"fmt"
"github.com/celestiaorg/celestia-node/share/shwap"

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

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

const protocolString = "/shrex/nd/v0.1.0"
const protocolString = "/shrex/v0.1.0" + shwap.NamespaceDataName

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

Expand Down
3 changes: 3 additions & 0 deletions share/shwap/row.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (
"github.com/celestiaorg/celestia-node/share/shwap/pb"
)

// RowName is the name identifier for the row container.
const RowName = "row_v0"

// RowSide enumerates the possible sides of a row within an Extended Data Square (EDS).
type RowSide int

Expand Down
3 changes: 3 additions & 0 deletions share/shwap/row_namespace_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"github.com/celestiaorg/celestia-node/share/shwap/pb"
)

// RowNamespaceDataName is the name identifier for the row namespace data container.
const RowNamespaceDataName = "rnd_v0"

// ErrNamespaceOutsideRange is returned by RowNamespaceDataFromShares when the target namespace is
// outside of the namespace range for the given row. In this case, the implementation cannot return
// the non-inclusion proof and will return ErrNamespaceOutsideRange.
Expand Down
3 changes: 3 additions & 0 deletions share/shwap/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
"github.com/celestiaorg/celestia-node/share/shwap/pb"
)

// SampleName is the name identifier for the sample container.
const SampleName = "sample_v0"

// ErrFailedVerification is returned when inclusion proof verification fails. It is returned
// when the data and the proof do not match trusted data root.
var ErrFailedVerification = errors.New("failed to verify inclusion")
Expand Down

0 comments on commit 75f5fa1

Please sign in to comment.