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/api blob proofs #312

Merged
merged 13 commits into from
Dec 5, 2024
Merged

Feat/api blob proofs #312

merged 13 commits into from
Dec 5, 2024

Conversation

k-karuna
Copy link
Collaborator

No description provided.


const (
// ShareVersionZero is the first share version format.
ShareVersionZero = uint8(0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/celestiaorg/go-square/blob/206b9278e7ca983b6cb58fe2c6e2953ee23053e8/share/consts.go#L21

можешь импортировать эти константы из кора

nsStartIdx := int(startRow*edsWidth + startCol)

for shareIdx, s := range shares {
if !bytes.Contains(SupportedShareVersions, []byte{s.Version()}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для простоты понимания можно написать просто s.Version() <= 1, потому что только 2 версии доступно пока

cmd/api/handler/responses/ods.go Show resolved Hide resolved
cmd/api/handler/responses/ods.go Outdated Show resolved Hide resolved
pkg/node/rpc/blob.go Outdated Show resolved Hide resolved

func (api *API) BlobProofs(ctx context.Context, level pkgTypes.Level, startShare, endShare int) (pkgTypes.BlobProof, error) {
args := make(map[string]string)
if level != 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По идее все параметры запроса у тебя обязательные, поэтому можешь кидать ошибку, если хоть кто-то из них меньше 0, а level должен быть больше 0

return internalServerError(c, err)
}

proofs, err := handler.node.BlobProofs(c.Request().Context(), req.Height, startBlobIdx, endBlobIdx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь может быть startBlobIdx == endBlobIdx == 0. По крайней мере у меня так получилось с первым попавшимся блобом. Из-=за этого нода пятистоит

@k-karuna k-karuna force-pushed the feat/api-blob-proofs branch from aea26bb to 492c4e4 Compare December 4, 2024 16:38
@k-karuna k-karuna force-pushed the feat/api-blob-proofs branch from 09fe2ea to 3bc3c79 Compare December 4, 2024 18:19
pkg/node/api.go Outdated
@@ -20,6 +20,7 @@ type Api interface {
Genesis(ctx context.Context) (types.Genesis, error)
BlockData(ctx context.Context, level pkgTypes.Level) (pkgTypes.BlockData, error)
BlockDataGet(ctx context.Context, level pkgTypes.Level) (pkgTypes.BlockData, error)
BlobProofs(ctx context.Context, level pkgTypes.Level, startShare, endShare int) (pkgTypes.BlobProof, error)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По идее, это можно выпилить

@k-karuna k-karuna merged commit e593865 into master Dec 5, 2024
5 of 6 checks passed
@k-karuna k-karuna deleted the feat/api-blob-proofs branch December 5, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants