Skip to content

Commit

Permalink
feat!: Live, laugh, Shwap (celestiaorg#3675)
Browse files Browse the repository at this point in the history
Reworks ~60% of the codebase
  • Loading branch information
Wondertan authored Sep 24, 2024
2 parents a4739e8 + 27cbc12 commit 04d6cd8
Show file tree
Hide file tree
Showing 265 changed files with 14,046 additions and 9,661 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,14 @@ PB_CORE=$(shell go list -f {{.Dir}} -m github.com/tendermint/tendermint)
PB_GOGO=$(shell go list -f {{.Dir}} -m github.com/gogo/protobuf)
PB_CELESTIA_APP=$(shell go list -f {{.Dir}} -m github.com/celestiaorg/celestia-app)
PB_NMT=$(shell go list -f {{.Dir}} -m github.com/celestiaorg/nmt)
PB_NODE=$(shell pwd)

## pb-gen: Generate protobuf code for all /pb/*.proto files in the project.
pb-gen:
@echo '--> Generating protobuf'
@for dir in $(PB_PKGS); \
do for file in `find $$dir -type f -name "*.proto"`; \
do protoc -I=. -I=${PB_CORE}/proto/ -I=${PB_GOGO} -I=${PB_CELESTIA_APP}/proto -I=${PB_NMT} --gogofaster_out=paths=source_relative:. $$file; \
do protoc -I=. -I=${PB_CORE}/proto/ -I=${PB_NODE} -I=${PB_GOGO} -I=${PB_CELESTIA_APP}/proto -I=${PB_NMT} --gogofaster_out=paths=source_relative:. $$file; \
echo '-->' $$file; \
done; \
done;
Expand Down
2 changes: 1 addition & 1 deletion api/docgen/examples.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ var ExampleValues = map[reflect.Type]interface{}{
}

func init() {
addToExampleValues(share.EmptyExtendedDataSquare())
addToExampleValues(share.EmptyEDS())
addr, err := sdk.AccAddressFromBech32("celestia1377k5an3f94v6wyaceu0cf4nq6gk2jtpc46g7h")
if err != nil {
panic(err)
Expand Down
7 changes: 4 additions & 3 deletions blob/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/celestiaorg/celestia-node/header"
"github.com/celestiaorg/celestia-node/libs/utils"
"github.com/celestiaorg/celestia-node/share"
"github.com/celestiaorg/celestia-node/share/shwap"
"github.com/celestiaorg/celestia-node/state"
)

Expand Down Expand Up @@ -56,7 +57,7 @@ type Service struct {
// accessor dials the given celestia-core endpoint to submit blobs.
blobSubmitter Submitter
// shareGetter retrieves the EDS to fetch all shares from the requested header.
shareGetter share.Getter
shareGetter shwap.Getter
// headerGetter fetches header by the provided height
headerGetter func(context.Context, uint64) (*header.ExtendedHeader, error)
// headerSub subscribes to new headers to supply to blob subscriptions.
Expand All @@ -65,7 +66,7 @@ type Service struct {

func NewService(
submitter Submitter,
getter share.Getter,
getter shwap.Getter,
headerGetter func(context.Context, uint64) (*header.ExtendedHeader, error),
headerSub func(ctx context.Context) (<-chan *header.ExtendedHeader, error),
) *Service {
Expand Down Expand Up @@ -365,7 +366,7 @@ func (s *Service) retrieve(
// collect shares for the requested namespace
namespacedShares, err := s.shareGetter.GetSharesByNamespace(getCtx, header, namespace)
if err != nil {
if errors.Is(err, share.ErrNotFound) {
if errors.Is(err, shwap.ErrNotFound) {
err = ErrBlobNotFound
}
getSharesSpan.SetStatus(codes.Error, err.Error())
Expand Down
Loading

0 comments on commit 04d6cd8

Please sign in to comment.