Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shwap): Integrate shrex into shwap #3554

Merged
merged 10 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
)
walldiss marked this conversation as resolved.
Show resolved Hide resolved

// 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
walldiss marked this conversation as resolved.
Show resolved Hide resolved

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"
walldiss marked this conversation as resolved.
Show resolved Hide resolved
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
Loading