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

Add an RPC endpoint for DataCommitment #625

Merged
merged 18 commits into from
Feb 4, 2022

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented Feb 2, 2022

Description

Adds DataCommitment RPC endpoint to be used to calculate the merkle root of a set of data roots.

Closes: #620

@rach-id rach-id requested a review from tac0turtle as a code owner February 2, 2022 18:32
@rach-id rach-id marked this pull request as draft February 2, 2022 18:32
@rach-id rach-id changed the title init adding DataCommitment rpc Add an RPC endpoint for DataCommitment Feb 2, 2022
@adlerjohn adlerjohn linked an issue Feb 3, 2022 that may be closed by this pull request
@rach-id rach-id marked this pull request as ready for review February 3, 2022 18:35
evan-forbes
evan-forbes previously approved these changes Feb 4, 2022
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

LGTM! great work 👍 left two minor optional comments.

@rach-id
Copy link
Member Author

rach-id commented Feb 4, 2022

@evan-forbes @adlerjohn What should be the response for an empty block set ?
Currently, it is hashing an empty slice of blocks.

@evan-forbes
Copy link
Member

evan-forbes commented Feb 4, 2022

What should be the response for an empty block set ?
Currently, it is hashing an empty slice of blocks.

yeah, we should definitely try to return an error in that case, either using a client side check or via the server.

but this is optional imho, as we can add this check when implementing the relayer

@rach-id
Copy link
Member Author

rach-id commented Feb 4, 2022

@evan-forbes added the sanity check. If it looks good, we can merge :D

@evan-forbes evan-forbes dismissed their stale review February 4, 2022 19:00

need to move constant to the consts package

@evan-forbes
Copy link
Member

ahh I see, nice!

@evan-forbes evan-forbes merged commit 742fb3a into celestiaorg:v0.34.x-celestia Feb 4, 2022
evan-forbes pushed a commit that referenced this pull request Apr 29, 2022
* init adding DataCommitment rpc

* updates data commitment json response name

* fix import

* Update rpc/client/interface.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* lint

* adds test for data commitment (still not working)

* fixes data commitment creation

* fixes data commitment test

* adds data commitment RPC test

* update comment

* updates openapi specs

* add blocks sanity check for data commitment

* rename blockByQuery to heightsByQuery to reflect more what the function is doing

* moves DataCommitmentBlocksLimit to consts

* adds tests for data commitment limits

Co-authored-by: John Adler <[email protected]>
evan-forbes pushed a commit that referenced this pull request May 3, 2022
* init adding DataCommitment rpc

* updates data commitment json response name

* fix import

* Update rpc/client/interface.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* lint

* adds test for data commitment (still not working)

* fixes data commitment creation

* fixes data commitment test

* adds data commitment RPC test

* update comment

* updates openapi specs

* add blocks sanity check for data commitment

* rename blockByQuery to heightsByQuery to reflect more what the function is doing

* moves DataCommitmentBlocksLimit to consts

* adds tests for data commitment limits

Co-authored-by: John Adler <[email protected]>

run make mockery

patch compute shares for pkg files

finish remaining rpc refactor
evan-forbes pushed a commit that referenced this pull request May 3, 2022
* init adding DataCommitment rpc

* updates data commitment json response name

* fix import

* Update rpc/client/interface.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* lint

* adds test for data commitment (still not working)

* fixes data commitment creation

* fixes data commitment test

* adds data commitment RPC test

* update comment

* updates openapi specs

* add blocks sanity check for data commitment

* rename blockByQuery to heightsByQuery to reflect more what the function is doing

* moves DataCommitmentBlocksLimit to consts

* adds tests for data commitment limits

Co-authored-by: John Adler <[email protected]>

run make mockery

patch compute shares for pkg files

finish remaining rpc refactor
evan-forbes pushed a commit that referenced this pull request May 3, 2022
* init adding DataCommitment rpc

* updates data commitment json response name

* fix import

* Update rpc/client/interface.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* lint

* adds test for data commitment (still not working)

* fixes data commitment creation

* fixes data commitment test

* adds data commitment RPC test

* update comment

* updates openapi specs

* add blocks sanity check for data commitment

* rename blockByQuery to heightsByQuery to reflect more what the function is doing

* moves DataCommitmentBlocksLimit to consts

* adds tests for data commitment limits

Co-authored-by: John Adler <[email protected]>

run make mockery

patch compute shares for pkg files

finish remaining rpc refactor
williambanfield pushed a commit to interchainio/celestia-core that referenced this pull request Jul 14, 2022
* init adding DataCommitment rpc

* updates data commitment json response name

* fix import

* Update rpc/client/interface.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* Update rpc/core/blocks.go

Co-authored-by: John Adler <[email protected]>

* lint

* adds test for data commitment (still not working)

* fixes data commitment creation

* fixes data commitment test

* adds data commitment RPC test

* update comment

* updates openapi specs

* add blocks sanity check for data commitment

* rename blockByQuery to heightsByQuery to reflect more what the function is doing

* moves DataCommitmentBlocksLimit to consts

* adds tests for data commitment limits

Co-authored-by: John Adler <[email protected]>

run make mockery

patch compute shares for pkg files

finish remaining rpc refactor
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.

Create an RPC endpoint for DataCommitment
4 participants