-
Notifications
You must be signed in to change notification settings - Fork 13
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
Feat/api blob proofs #312
Conversation
cmd/api/handler/responses/ods.go
Outdated
|
||
const ( | ||
// ShareVersionZero is the first share version format. | ||
ShareVersionZero = uint8(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
можешь импортировать эти константы из кора
cmd/api/handler/responses/ods.go
Outdated
nsStartIdx := int(startRow*edsWidth + startCol) | ||
|
||
for shareIdx, s := range shares { | ||
if !bytes.Contains(SupportedShareVersions, []byte{s.Version()}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для простоты понимания можно написать просто s.Version() <= 1
, потому что только 2 версии доступно пока
pkg/node/rpc/blob.go
Outdated
|
||
func (api *API) BlobProofs(ctx context.Context, level pkgTypes.Level, startShare, endShare int) (pkgTypes.BlobProof, error) { | ||
args := make(map[string]string) | ||
if level != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По идее все параметры запроса у тебя обязательные, поэтому можешь кидать ошибку, если хоть кто-то из них меньше 0, а level должен быть больше 0
cmd/api/handler/namespace.go
Outdated
return internalServerError(c, err) | ||
} | ||
|
||
proofs, err := handler.node.BlobProofs(c.Request().Context(), req.Height, startBlobIdx, endBlobIdx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь может быть startBlobIdx == endBlobIdx == 0. По крайней мере у меня так получилось с первым попавшимся блобом. Из-=за этого нода пятистоит
aea26bb
to
492c4e4
Compare
…EDS from celestia-app
09fe2ea
to
3bc3c79
Compare
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По идее, это можно выпилить
No description provided.