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!: Live, laugh, Shwap #3675

Merged
merged 104 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
68b8b06
create store v2 file interface (#2989)
walldiss Dec 6, 2023
efde840
feat(store/mem_file): add in-memory eds file implementation (#2992)
walldiss Dec 6, 2023
806ee29
feat(share/store): Allow Store implementation to choose proof axis fo…
walldiss Mar 6, 2024
1ec1c68
chore(lint): fix gofumpt errors
walldiss May 8, 2024
b43ce4d
feat(shwap): add shwap types (#3383)
walldiss May 22, 2024
f0685c9
feat(share): Shwap types tests (#3423)
walldiss May 24, 2024
4e122f0
refactor(share/shwap): shwap types improvements
Wondertan May 27, 2024
00566a2
feat(share/store_v2) Update file interface to use shwap types (#3441)
walldiss May 29, 2024
3dd1100
refactor(shwap): Extract eds interface (#3452)
walldiss Jun 5, 2024
1c42d99
feat(share/eds) Add Accessor test infra (#3425)
walldiss Jun 10, 2024
ae28743
feat(shwap): Add close once file (#3484)
walldiss Jun 17, 2024
90beee3
add validation file
walldiss Jun 10, 2024
88178fe
update errors in sample
walldiss Jun 12, 2024
432f35d
move to eds folder
walldiss Jun 17, 2024
18ae197
cache size
walldiss Jun 17, 2024
31dfe98
use atomic cached size
walldiss Jun 17, 2024
63f6af8
fix lint
walldiss Jun 17, 2024
5585321
feat(shwap): Add ODS file (#3482)
walldiss Jun 19, 2024
b699067
test(store): add header de/serialization fuzzing (#3514)
cristaloleg Jun 21, 2024
5ef65c3
feat(share): Shwap Bitwap composition (#3421)
Wondertan Jun 26, 2024
8d850c4
feat(shwap): Add cache file (#3498)
walldiss Jun 27, 2024
807e335
feat(shwap): add Q1Q4 file (#3522)
walldiss Jun 27, 2024
660246d
feat(shwap):Add eds streaming (#3531)
walldiss Jul 2, 2024
92b2afb
feat(shwap): Separate verify and validate for shwap ids (#3551)
walldiss Jul 4, 2024
198f24e
feat(shwap): Add store cache (#3543)
walldiss Jul 4, 2024
2e80fc6
feat(shwap): Add eds store (#3545)
walldiss Jul 18, 2024
6539b26
refactor(shwap): rename share.root to axisRoots (#3583)
walldiss Jul 22, 2024
d807843
refactor(shwap): revert DataRoot -> DataHash (#3585)
Wondertan Jul 22, 2024
5aaa106
fix(shwap/bitswap): close acccessor in Blockstore (#3535)
Wondertan Jul 23, 2024
6fc490b
feat(shwap): Add namespace data shwap id (#3587)
walldiss Jul 23, 2024
c716c97
feat(shwap): Add axis roots to Accessor (#3586)
walldiss Jul 24, 2024
1bdf5f1
fix(shwap/store): ensure EDS is accessible during writes (#3596)
Wondertan Jul 25, 2024
eb8298f
feat(shwap): Add bufferisation for writing ods/Q1Q4 files (#3592)
walldiss Jul 25, 2024
c81e6d1
feat(shwap/p2p): Bitswap Getter (#3584)
Wondertan Jul 25, 2024
062f499
feat(shwap): Shwap add readFrom Writeto methods to shwap ids (#3605)
walldiss Jul 30, 2024
c4e602a
feat(shwap): Integrate shrex into shwap (#3554)
walldiss Jul 30, 2024
8912fc0
feat(shwap): Shwap core integration (#3598)
walldiss Jul 31, 2024
42913ea
feat(shwap): Shwap cascade and mock getters (#3599)
walldiss Jul 31, 2024
8d5ae0a
refactor(shwap): Rename remaining dataroot references (#3607)
walldiss Jul 31, 2024
9118b8e
fix(shwap): don't cache empty eds and close recent accessor (#3608)
walldiss Jul 31, 2024
dfaffb7
chore(shwap): various improvements (#3609)
Wondertan Aug 1, 2024
df13c2a
feat(shwap): Update availability to work with shwap (#3600)
walldiss Aug 1, 2024
d6d292a
feat(shwap): add shwap to blob module (#3613)
walldiss Aug 1, 2024
6751df2
feat(shwap): update daser for shwap (#3614)
walldiss Aug 1, 2024
5bb844a
feat(shwap): add shwap store getter (#3617)
walldiss Aug 7, 2024
5f6fdab
feat(shwap): Add caching to blockstore (#3615)
walldiss Aug 7, 2024
7e6f0a5
feat(shwap/bitswap): Shwap optimized Bitswap constructors (#3536)
Wondertan Aug 8, 2024
36bb8e6
feat(shwap): Improve eds store cache refcounter forgot Close() protec…
walldiss Aug 8, 2024
fca7ff7
fix(shwap/cahce): use local copy of axis in proofs cache (#3657)
walldiss Aug 13, 2024
3026164
refactor(shwap/store): simplify and cleanup read logic
Wondertan Aug 9, 2024
ef56ae8
chore(shwap|share): add empty EDS helpers
Wondertan Aug 14, 2024
4b6f7c2
refactor!(shwap/store): decouple ODS and Q1Q4 files
Wondertan Aug 11, 2024
ed1e80a
perf(shwap/store): ODSQ4 lazy loading
Wondertan Aug 13, 2024
5395c13
refactor(shwap/store): make empty block a file
Wondertan Aug 13, 2024
0f2af92
chore(shwap/store): fix logger name
Wondertan Aug 13, 2024
12d5c2d
chore(shwap/store): update file benchmarks
Wondertan Aug 14, 2024
9449437
perf(shwap/store): create ODS and Q4 files in parallel
Wondertan Aug 14, 2024
965f1cc
feat(shwap): shwap nodebuilder and cleanup (#3637)
walldiss Aug 15, 2024
5d6ab85
refactor(shwap): extract ReadAccessor
Wondertan Aug 3, 2024
34da644
test(shwap/eds): tail padded EDS in accessor suite
Wondertan Aug 15, 2024
01b1655
feat(shwap): ODS tail padding trim
Wondertan Aug 15, 2024
0c88b31
Merge branch 'refs/heads/main-celestia' into shwap-rebase
walldiss Aug 20, 2024
a3531ce
resolve conflicts
walldiss Aug 20, 2024
0bfff96
chore(shwap)!: Merge main into shwap (#3662)
walldiss Aug 22, 2024
dd7b5cc
fix(store/files): ODSQ4 Closing audit (#3691)
Wondertan Aug 26, 2024
568744f
perf(store/sync): avoid syncing files (#3693)
Wondertan Aug 26, 2024
e1d888c
refactor(store/file): auto-detect q4 and remove fileType from the fil…
walldiss Aug 26, 2024
623d8cc
refactor(store/file): increase header size to 64
walldiss Aug 26, 2024
393f131
refactor(store/file): remove header from Q4
walldiss Aug 26, 2024
8d3e50c
refactor(store): remove link to Q4 file and find it by datahash
walldiss Aug 26, 2024
c63353c
fix(store/file): use proper constructor for odsQ4 tests
walldiss Aug 27, 2024
e93e63f
refactor(store/file): remove Offset method from header
walldiss Aug 27, 2024
ed82a2e
fix(shwap): io.ReadFull for read helpers (#3696)
Wondertan Aug 28, 2024
1502153
fix(shwap): io.ReadFull for NamespaceDataID (#3697)
walldiss Aug 28, 2024
a58b3bf
feat(shwap): Add discovery version (#3616)
walldiss Sep 11, 2024
d1d37ee
fix(shwap/bitswap): correct protocol id (#3722)
Wondertan Sep 11, 2024
5928c6a
feat(cmd/cel-shed): shwap (#3720)
Wondertan Sep 11, 2024
efa7365
feat(shwap/store): Add q4 trimming support in store (#3680)
walldiss Sep 11, 2024
51c3f94
Merge branch 'main' into shwap
Wondertan Sep 12, 2024
75de820
chore: bump libp2p-pubsub
Wondertan Sep 12, 2024
983e9c0
feat(shwap): Equals methods for IDs
Wondertan Sep 13, 2024
1a70470
chore(shwap/bitswap): check ID equality
Wondertan Sep 13, 2024
f70bccc
chore(shwap/bitswap): address naming nit
Wondertan Sep 13, 2024
15ebe17
Revert "chore: bump libp2p-pubsub"
Wondertan Sep 16, 2024
e6d3a58
fix(store/odsq4): fix order of opened flag stored (#3735)
walldiss Sep 17, 2024
e1c7403
fix(store/ods): fix full ods caching (#3736)
walldiss Sep 17, 2024
078f9ab
feat(nodebuilder): Blockstore cache params (#3739)
walldiss Sep 17, 2024
8f6c920
remove new_eds folder
walldiss Sep 17, 2024
1cf355d
refactor(share/eds): various accessor testing suite improvements (#3737)
walldiss Sep 17, 2024
1279c2e
fix(core): fix flaky generateNonEmptyBlocks (#3740)
walldiss Sep 17, 2024
89e8781
fix(blob): fix blobsub subscription cancellation test (#3746)
walldiss Sep 18, 2024
2c67306
fix(store): use symlinks for empty blocks heighs (#3747)
walldiss Sep 18, 2024
7ffd7c0
chore(shwap/bitswap): prevent not found error logging (#3754)
Wondertan Sep 20, 2024
8ba3dad
chore(shwap/bitswap): add getter tracing (#3755)
Wondertan Sep 20, 2024
4289846
feat(share/availability): Dont store q4 on archival (#3751)
walldiss Sep 20, 2024
53ef4d9
Reapply "chore: bump libp2p-pubsub"
Wondertan Sep 20, 2024
0584f6a
perf(core): increase concurrency limit
Wondertan Sep 18, 2024
71af216
feat(store/cache): add Has methods (#3757)
Wondertan Sep 20, 2024
3031e86
chore(shwap/bitswap): remove spammy log
Wondertan Sep 21, 2024
572c621
chore(shwap): Validate -> Verify
Wondertan Sep 21, 2024
f48353c
Merge branch 'main' into shwap
Wondertan Sep 23, 2024
c5c959f
fix(nodebuidlder/p2p) Use semver for discovery prefix (#3768)
walldiss Sep 24, 2024
9400551
chore(mocks): update generated mocks (#3767)
walldiss Sep 24, 2024
27cbc12
Merge branch 'main' into shwap
Wondertan Sep 24, 2024
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# global owners are only requested if there isn't a more specific
# codeowner specified below. For this reason, the global codeowners
# are often repeated in package-level definitions.
* @renaynay @Wondertan @vgonkivs @distractedm1nd @walldiss @ramin @cristaloleg
* @renaynay @Wondertan @vgonkivs @distractedm1nd @walldiss @cristaloleg

docs/adr @adlerjohn @liamsi
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ body:
be automatically formatted into code, so no need for backticks. Or paste
gists, pastebins links here
render: Shell
- type: textarea
id: stuck_node
attributes:
label: Is the node "stuck"? Has it stopped syncing?
description: Please share the state of the node e.g. what height is stuck at, what is the state of DAS?
placeholder: >
Please consult our RPC docs https://node-rpc-docs.celestia.org/ and share output from any or all of
Das.SamplingStats, Header.SyncState and Header.NetworkHead
- type: textarea
id: misc
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
go-version: ${{ inputs.go-version }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v6.0.1
uses: golangci/golangci-lint-action@v6.1.0
with:
args: --timeout 10m
version: v1.59
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,33 @@ jobs:
mode: minimum
count: 1
labels: "kind:fix, kind:misc, kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci, kind:chore, kind:testing" # yamllint disable-line rule:line-length

# will attempt to apply a breaking label
# on opening the PR but not enforce it on repeated changes
# so we don't get trapped by false positives (for now)
# we can expand to all cases after
apply-breaking:
runs-on: ubuntu-latest
if: ${{ github.event.action == 'opened' && github.actor != 'dependabot[bot]' }}
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run check for breaking
id: breaking_change
run: |
git fetch origin main
make detect-breaking

- name: Add label if breaking changes detected
if: failure()
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
LABELS: kind:break!
4 changes: 3 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,7 @@ changelog:
exclude:
- "^docs:"
- "^test:"
release:
prerelease: auto
git:
prerelease_suffix: "-"
prerelease_suffix: "-rc*"
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22.4-alpine3.20 as builder
FROM --platform=$BUILDPLATFORM docker.io/golang:1.22.5-alpine3.20 as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
Expand All @@ -25,7 +25,7 @@ RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
make build && make cel-key

FROM docker.io/alpine:3.20.1
FROM docker.io/alpine:3.20.2

# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
ARG UID=10001
Expand Down
67 changes: 48 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ build:
@go build -o build/ ${LDFLAGS} ./cmd/celestia
.PHONY: build

## build-jemalloc: Build celestia-node binary with jemalloc allocator for BadgerDB instead of Go's native one
## build-jemalloc: Build celestia-node binary with jemalloc allocator for BadgerDB.
build-jemalloc: jemalloc
@echo "--> Building Celestia with jemalloc"
@go build -o build/ ${LDFLAGS} -tags jemalloc ./cmd/celestia
Expand All @@ -51,14 +51,14 @@ clean:
@rm -rf build/*
.PHONY: clean

## cover: generate to code coverage report.
## cover: Generate code coverage report.
cover:
@echo "--> Generating Code Coverage"
@go install github.com/ory/go-acc@latest
@go-acc -o coverage.txt `go list ./... | grep -v nodebuilder/tests` -- -v
.PHONY: cover

## deps: install dependencies.
## deps: Install dependencies.
deps:
@echo "--> Installing Dependencies"
@go mod download
Expand All @@ -73,7 +73,7 @@ else
endif
.PHONY: install

## install-global: Install the celestia-node binary (only for systems that support GNU coreutils, i.e. Linux).
## install-global: Install the celestia-node binary (only for systems that support GNU coreutils like Linux).
install-global:
@echo "--> Installing Celestia"
@install -v ./build/* -t ${PREFIX}/bin
Expand Down Expand Up @@ -109,7 +109,8 @@ install-key:
@go install ./cmd/cel-key
.PHONY: install-key

## fmt: Formats only *.go (excluding *.pb.go *pb_test.go). Runs `gofmt & goimports` internally.
## fmt: Formats only *.go (excluding *.pb.go *pb_test.go).
# Runs `gofmt & goimports` internally.
fmt: sort-imports
@find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs gofmt -w -s
@go mod tidy -compat=1.20
Expand All @@ -118,39 +119,40 @@ fmt: sort-imports
@markdownlint --fix --quiet --config .markdownlint.yaml .
.PHONY: fmt

## lint: Linting *.go files using golangci-lint. Look for .golangci.yml for the list of linters. Also lint *.md files using markdownlint.
## lint: Lint *.go files with golangci-lint and *.md files with markdownlint.
# Look at .golangci.yml for the list of linters.
lint: lint-imports
@echo "--> Running linter"
@golangci-lint run
@markdownlint --config .markdownlint.yaml '**/*.md'
@cfmt -m=100 ./...
@cfmt --m=120 ./...
.PHONY: lint

## test-unit: Running unit tests
## test-unit: Run unit tests.
test-unit:
@echo "--> Running unit tests"
@go test $(VERBOSE) -covermode=atomic -coverprofile=coverage.txt `go list ./... | grep -v nodebuilder/tests` $(LOG_AND_FILTER)
.PHONY: test-unit

## test-unit-race: Running unit tests with data race detector
## test-unit-race: Run unit tests with data race detector.
test-unit-race:
@echo "--> Running unit tests with data race detector"
@go test $(VERBOSE) -race -covermode=atomic -coverprofile=coverage.txt `go list ./... | grep -v nodebuilder/tests` $(LOG_AND_FILTER)
.PHONY: test-unit-race

## test-integration: Running /integration tests located in nodebuilder/tests
## test-integration: Run integration tests located in nodebuilder/tests.
test-integration:
@echo "--> Running integrations tests $(VERBOSE) -tags=$(TAGS) $(INTEGRATION_RUN_LENGTH)"
@go test $(VERBOSE) -tags=$(TAGS) $(INTEGRATION_RUN_LENGTH) ./nodebuilder/tests
.PHONY: test-integration

## test-integration-race: Running integration tests with data race detector located in node/tests
## test-integration-race: Run integration tests with data race detector located in nodebuilder/tests.
test-integration-race:
@echo "--> Running integration tests with data race detector -tags=$(TAGS)"
@go test -race -tags=$(TAGS) ./nodebuilder/tests
.PHONY: test-integration-race

## benchmark: Running all benchmarks
## benchmark: Run all benchmarks.
benchmark:
@echo "--> Running benchmarks"
@go test -run="none" -bench=. -benchtime=100x -benchmem ./...
Expand All @@ -174,14 +176,14 @@ pb-gen:
done;
.PHONY: pb-gen

## openrpc-gen: Generate OpenRPC spec for Celestia-Node's RPC api
## openrpc-gen: Generate OpenRPC spec for celestia-node's RPC API.
openrpc-gen:
@go run ${LDFLAGS} ./cmd/celestia docgen
.PHONY: openrpc-gen

## lint-imports: Lint only Go imports.
## flag -set-exit-status doesn't exit with code 1 as it should, so we use find until it is fixed by goimports-reviser
lint-imports:
# flag -set-exit-status doesn't exit with code 1 as it should, so we use find until it is fixed by goimports-reviser
@echo "--> Running imports linter"
@for file in `find . -type f -name '*.go'`; \
do goimports-reviser -list-diff -set-exit-status -company-prefixes "github.com/celestiaorg" -project-name "github.com/celestiaorg/celestia-node" -output stdout $$file \
Expand All @@ -200,13 +202,13 @@ adr-gen:
@curl -sSL https://raw.githubusercontent.com/celestiaorg/.github/main/adr-template.md > docs/architecture/adr-$(NUM)-$(TITLE).md
.PHONY: adr-gen

## telemetry-infra-up: launches local telemetry infrastructure. This includes grafana, jaeger, loki, pyroscope, and an otel-collector.
## you can access the grafana instance at localhost:3000 and login with admin:admin.
## telemetry-infra-up: Launch local telemetry infra (grafana, jaeger, loki, pyroscope, and otel-collector).
# You can access the grafana instance at localhost:3000 and login with admin:admin.
telemetry-infra-up:
PWD="${DIR_FULLPATH}/docker/telemetry" docker-compose -f ./docker/telemetry/docker-compose.yml up
.PHONY: telemetry-infra-up

## telemetry-infra-down: tears the telemetry infrastructure down. The stores for grafana, prometheus, and loki will persist.
## telemetry-infra-down: Tears the telemetry infra down. Persists the stores for grafana, prometheus, and loki.
telemetry-infra-down:
PWD="${DIR_FULLPATH}/docker/telemetry" docker-compose -f ./docker/telemetry/docker-compose.yml down
.PHONY: telemetry-infra-down
Expand All @@ -223,17 +225,44 @@ goreleaser-build:
goreleaser build --snapshot --clean --single-target
.PHONY: goreleaser-build

## goreleaser-release: Builds the release celestia binaries as defined in .goreleaser.yaml. This requires there be a git tag for the release in the local git history.
## goreleaser-release: Builds the release celestia binaries as defined in .goreleaser.yaml.
# This requires there be a git tag for the release in the local git history.
goreleaser-release:
goreleaser release --clean --fail-fast --skip-publish
.PHONY: goreleaser-release

# detect changed files and parse output
# to inspect changes to nodebuilder/**/config.go fields
CHANGED_FILES = $(shell git diff --name-only origin/main...HEAD)
detect-breaking:
@BREAK=false
@for file in ${CHANGED_FILES}; do \
if echo $$file | grep -qE '\.proto$$'; then \
BREAK=true; \
fi; \
if echo $$file | grep -qE 'nodebuilder/.*/config\.go'; then \
DIFF_OUTPUT=$$(git diff origin/main...HEAD $$file); \
if echo "$$DIFF_OUTPUT" | grep -qE 'type Config struct|^\s+\w+\s+Config'; then \
BREAK=true; \
fi; \
fi; \
done; \
if [ "$$BREAK" = true ]; then \
echo "break detected"; \
exit 1; \
else \
echo "no break detected"; \
exit 0; \
fi
.PHONY: detect-breaking


# Copied from https://github.com/dgraph-io/badger/blob/main/Makefile
USER_ID = $(shell id -u)
HAS_JEMALLOC = $(shell test -f /usr/local/lib/libjemalloc.a && echo "jemalloc")
JEMALLOC_URL = "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2"

## jemalloc installs jemalloc allocator
## jemalloc: Install jemalloc allocator.
jemalloc:
@if [ -z "$(HAS_JEMALLOC)" ] ; then \
mkdir -p /tmp/jemalloc-temp && cd /tmp/jemalloc-temp ; \
Expand Down
2 changes: 1 addition & 1 deletion api/gateway/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/gorilla/mux"

"github.com/celestiaorg/celestia-app/pkg/shares"
"github.com/celestiaorg/go-square/shares"

"github.com/celestiaorg/celestia-node/share"
)
Expand Down
16 changes: 8 additions & 8 deletions api/gateway/share_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"testing"

"github.com/stretchr/testify/require"
coretypes "github.com/tendermint/tendermint/types"

"github.com/celestiaorg/celestia-app/pkg/appconsts"
"github.com/celestiaorg/celestia-app/pkg/shares"
"github.com/celestiaorg/celestia-app/v2/pkg/appconsts"
"github.com/celestiaorg/go-square/blob"
"github.com/celestiaorg/go-square/shares"

"github.com/celestiaorg/celestia-node/share/sharetest"
)
Expand All @@ -23,13 +23,13 @@ func Test_dataFromShares(t *testing.T) {
ns := sharetest.RandV0Namespace()
sss := shares.NewSparseShareSplitter()
for _, data := range testData {
b := coretypes.Blob{
b := blob.Blob{
Data: data,
NamespaceID: ns.ID(),
NamespaceVersion: ns.Version(),
ShareVersion: appconsts.ShareVersionZero,
NamespaceId: ns.ID(),
NamespaceVersion: uint32(ns.Version()),
ShareVersion: uint32(appconsts.ShareVersionZero),
}
err := sss.Write(b)
err := sss.Write(&b)
require.NoError(t, err)
}

Expand Down
39 changes: 21 additions & 18 deletions api/rpc/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/celestiaorg/celestia-node/api/rpc/perms"
"github.com/celestiaorg/celestia-node/nodebuilder/blob"
"github.com/celestiaorg/celestia-node/nodebuilder/blobstream"
"github.com/celestiaorg/celestia-node/nodebuilder/da"
"github.com/celestiaorg/celestia-node/nodebuilder/das"
"github.com/celestiaorg/celestia-node/nodebuilder/fraud"
Expand All @@ -26,15 +27,16 @@ var (
)

type Client struct {
Fraud fraud.API
Header header.API
State state.API
Share share.API
DAS das.API
P2P p2p.API
Node node.API
Blob blob.API
DA da.API
Fraud fraud.API
Header header.API
State state.API
Share share.API
DAS das.API
P2P p2p.API
Node node.API
Blob blob.API
DA da.API
Blobstream blobstream.API

closer multiClientCloser
}
Expand Down Expand Up @@ -85,14 +87,15 @@ func newClient(ctx context.Context, addr string, authHeader http.Header) (*Clien
func moduleMap(client *Client) map[string]interface{} {
// TODO: this duplication of strings many times across the codebase can be avoided with issue #1176
return map[string]interface{}{
"share": &client.Share.Internal,
"state": &client.State.Internal,
"header": &client.Header.Internal,
"fraud": &client.Fraud.Internal,
"das": &client.DAS.Internal,
"p2p": &client.P2P.Internal,
"node": &client.Node.Internal,
"blob": &client.Blob.Internal,
"da": &client.DA.Internal,
"share": &client.Share.Internal,
"state": &client.State.Internal,
"header": &client.Header.Internal,
"fraud": &client.Fraud.Internal,
"das": &client.DAS.Internal,
"p2p": &client.P2P.Internal,
"node": &client.Node.Internal,
"blob": &client.Blob.Internal,
"da": &client.DA.Internal,
"blobstream": &client.Blobstream.Internal,
}
}
Loading