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

docs: explain why using tx-hash to build a blobstream rollup is not good #1644

Merged
merged 3 commits into from
Jul 24, 2024

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented Jul 21, 2024

Overview

Explain a frequent question of why we shouldn't build rollups using Blobstream and reference the data using a transaction hash

Summary by CodeRabbit

  • New Features
    • Introduced a new FAQ section addressing the use of Celestia transaction hashes for referencing rollup data.
    • Provided clear guidelines on verifying transactions using hashes, including details on inclusion proofs and transaction component parsing.
  • Documentation
    • Enhanced the document with insights on the complexities of using transaction hashes compared to alternative methods for better user understanding.

@rach-id rach-id requested a review from evan-forbes July 21, 2024 22:55
@rach-id rach-id self-assigned this Jul 21, 2024
Copy link
Contributor

coderabbitai bot commented Jul 21, 2024

Walkthrough

The recent changes enhance the document with a new FAQ section addressing the use of Celestia transaction hashes for referencing rollup data. It outlines the complexities and inefficiencies of this approach, recommending alternative methods like the sequence of spans. By detailing the transaction verification process, the changes provide valuable insights that improve understanding of rollup data management.

Changes

Files Change Summary
developers/blobstream-rollups.md Added an FAQ section explaining the use of Celestia transaction hashes in rollups, detailing verification steps and recommending alternative methods.

Poem

In fields of code where bunnies hop,
We ponder hashes, but should we stop?
With spans so sleek, we dance and play,
Optimizing paths in a joyful way.
So let’s embrace the simpler routes,
For in efficiency, our joy sprouts! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Jul 21, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://celestiaorg.github.io/docs-preview/./pr-1644/
on branch main at 2024-07-24 19:56 UTC

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (10)
developers/blobstream-rollups.md (10)

471-471: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- A transaction proof in Celestia goes back to providing an inclusion proof of the shares containing the transaction.
+ A transaction proof in Celestia goes back to providing an inclusion proof 
+ of the shares containing the transaction.
Tools
Markdownlint

471-471: Expected: 80; Actual: 115
Line length

(MD013, line-length)


472-472: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- This means if the transaction hash is used to reference data in a Celestia block, the rollup verification mechanism should
+ This means if the transaction hash is used to reference data in a Celestia block, 
+ the rollup verification mechanism should
Tools
Markdownlint

472-472: Expected: 80; Actual: 122
Line length

(MD013, line-length)


475-475: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- Verify an inclusion proof of the shares comprising the transaction up to the data root tuple root
+ Verify an inclusion proof of the shares comprising the transaction 
+ up to the data root tuple root
Tools
Markdownlint

475-475: Expected: 80; Actual: 99
Line length

(MD013, line-length)


476-476: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- Decode those shares and parse the transaction, then hash its components to generate the transaction hash
+ Decode those shares and parse the transaction, then hash its components 
+ to generate the transaction hash
Tools
Markdownlint

476-476: Expected: 80; Actual: 106
Line length

(MD013, line-length)


479-479: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- At this level, the transaction hash is authenticated and the verification contract has the shares of the transaction.
+ At this level, the transaction hash is authenticated 
+ and the verification contract has the shares of the transaction.
Tools
LanguageTool

[uncategorized] ~479-~479: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...l, the transaction hash is authenticated and the verification contract has the share...

(COMMA_COMPOUND_SENTENCE_2)

Markdownlint

479-479: Expected: 80; Actual: 90
Line length

(MD013, line-length)


481-481: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- Then, the verification contract needs to take the share commitment from the parsed transaction
+ Then, the verification contract needs to take the share commitment 
+ from the parsed transaction
Tools
Markdownlint

481-481: Expected: 80; Actual: 94
Line length

(MD013, line-length)


482-482: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- and follow the steps outlined in the [blob share commitment](#blob-share-commitment) section.
+ and follow the steps outlined in the 
+ [blob share commitment](#blob-share-commitment) section.
Tools
Markdownlint

482-482: Expected: 80; Actual: 93
Line length

(MD013, line-length)


485-485: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- As observed, using the transaction hash is expensive and doesn't yield any advantages over using the blob share commitment, which in turn is more expensive than using the sequence of spans.
+ As observed, using the transaction hash is expensive and doesn't yield any advantages 
+ over using the blob share commitment, which in turn is more expensive 
+ than using the sequence of spans.
Tools
Markdownlint

485-485: Expected: 80; Actual: 103
Line length

(MD013, line-length)


487-487: Break down long lines for better readability.

The line exceeds the recommended length of 80 characters.

- So, unless there are more reasons to use the transaction hash to reference the rollup data, the sequence of spans approach remains better.
+ So, unless there are more reasons to use the transaction hash to reference the rollup data, 
+ the sequence of spans approach remains better.
Tools
Markdownlint

487-487: Expected: 80; Actual: 107
Line length

(MD013, line-length)


479-479: Add a comma before "and" to connect two independent clauses.

Use a comma before “and” if it connects two independent clauses.

- At this level, the transaction hash is authenticated and the verification contract has the shares of the transaction.
+ At this level, the transaction hash is authenticated, and the verification contract has the shares of the transaction.
Tools
LanguageTool

[uncategorized] ~479-~479: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...l, the transaction hash is authenticated and the verification contract has the share...

(COMMA_COMPOUND_SENTENCE_2)

Markdownlint

479-479: Expected: 80; Actual: 90
Line length

(MD013, line-length)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ba92df2 and 251fe5c.

Files selected for processing (1)
  • developers/blobstream-rollups.md (1 hunks)
Additional context used
LanguageTool
developers/blobstream-rollups.md

[uncategorized] ~479-~479: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...l, the transaction hash is authenticated and the verification contract has the share...

(COMMA_COMPOUND_SENTENCE_2)

Markdownlint
developers/blobstream-rollups.md

471-471: Expected: 80; Actual: 115
Line length

(MD013, line-length)


472-472: Expected: 80; Actual: 122
Line length

(MD013, line-length)


475-475: Expected: 80; Actual: 99
Line length

(MD013, line-length)


476-476: Expected: 80; Actual: 106
Line length

(MD013, line-length)


477-477: Expected: 80; Actual: 87
Line length

(MD013, line-length)


479-479: Expected: 80; Actual: 90
Line length

(MD013, line-length)


481-481: Expected: 80; Actual: 94
Line length

(MD013, line-length)


482-482: Expected: 80; Actual: 93
Line length

(MD013, line-length)


485-485: Expected: 80; Actual: 103
Line length

(MD013, line-length)


487-487: Expected: 80; Actual: 107
Line length

(MD013, line-length)

@jcstein jcstein merged commit 1470a35 into main Jul 24, 2024
4 checks passed
@jcstein jcstein deleted the tx-hash-blobstream branch July 24, 2024 19:57
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (3)
developers/blobstream-rollups.md (3)

479-479: Add a comma before "and".

Use a comma before “and” if it connects two independent clauses.

- At this level, the transaction hash is authenticated and the verification contract has the
+ At this level, the transaction hash is authenticated, and the verification contract has the
Tools
LanguageTool

[uncategorized] ~479-~479: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...l, the transaction hash is authenticated and the verification contract has the share...

(COMMA_COMPOUND_SENTENCE_2)

Markdownlint

479-479: Expected: 80; Actual: 90
Line length

(MD013, line-length)


471-472: Break long lines for better readability.

Several lines exceed the recommended length of 80 characters. Consider breaking them into shorter lines.

- A transaction proof in Celestia goes back to providing an inclusion proof of the shares containing the transaction.
+ A transaction proof in Celestia goes back to providing an inclusion proof of the shares
+ containing the transaction.

- This means if the transaction hash is used to reference data in a Celestia block, the rollup verification mechanism should
+ This means if the transaction hash is used to reference data in a Celestia block, the rollup
+ verification mechanism should

- Verify an inclusion proof of the shares comprising the transaction up to the data root tuple root
+ Verify an inclusion proof of the shares comprising the transaction up to the data root
+ tuple root

- Decode those shares and parse the transaction, then hash its components to generate the transaction hash
+ Decode those shares and parse the transaction, then hash its components to generate the
+ transaction hash

- Verify that the generated transaction hash matches the one used to reference the data
+ Verify that the generated transaction hash matches the one used to reference the data

- shares of the transaction. Then, the verification contract needs to take the share commitment from the parsed transaction
+ shares of the transaction. Then, the verification contract needs to take the share
+ commitment from the parsed transaction

- and follow the steps outlined in the [blob share commitment](#blob-share-commitment) section.
+ and follow the steps outlined in the
+ [blob share commitment](#blob-share-commitment) section.

- As observed, using the transaction hash is expensive and doesn't yield any advantages over using the blob share commitment, which in turn is more expensive than using the sequence of spans.
+ As observed, using the transaction hash is expensive and doesn't yield any advantages over
+ using the blob share commitment, which in turn is more expensive than using the sequence
+ of spans.

- So, unless there are more reasons to use the transaction hash to reference the rollup data, the sequence of spans approach remains better.
+ So, unless there are more reasons to use the transaction hash to reference the rollup data,
+ the sequence of spans approach remains better.

Also applies to: 475-477, 479-479, 481-482, 485-485, 487-487

Tools
Markdownlint

471-471: Expected: 80; Actual: 115
Line length

(MD013, line-length)


472-472: Expected: 80; Actual: 122
Line length

(MD013, line-length)


468-469: Clarify the statement.

The sentence can be made clearer by explicitly stating what is not recommended.

- However, in Celestia, referencing the data using the transaction hash is not recommended.
+ However, in Celestia, referencing the rollup data using the transaction hash is not recommended.
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 251fe5c and 468917d.

Files selected for processing (1)
  • developers/blobstream-rollups.md (1 hunks)
Additional context used
LanguageTool
developers/blobstream-rollups.md

[uncategorized] ~479-~479: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...l, the transaction hash is authenticated and the verification contract has the share...

(COMMA_COMPOUND_SENTENCE_2)

Markdownlint
developers/blobstream-rollups.md

471-471: Expected: 80; Actual: 115
Line length

(MD013, line-length)


472-472: Expected: 80; Actual: 122
Line length

(MD013, line-length)


475-475: Expected: 80; Actual: 99
Line length

(MD013, line-length)


476-476: Expected: 80; Actual: 106
Line length

(MD013, line-length)


477-477: Expected: 80; Actual: 87
Line length

(MD013, line-length)


479-479: Expected: 80; Actual: 90
Line length

(MD013, line-length)


481-481: Expected: 80; Actual: 94
Line length

(MD013, line-length)


482-482: Expected: 80; Actual: 93
Line length

(MD013, line-length)


485-485: Expected: 80; Actual: 103
Line length

(MD013, line-length)


487-487: Expected: 80; Actual: 107
Line length

(MD013, line-length)

Additional comments not posted (2)
developers/blobstream-rollups.md (2)

464-465: LGTM!

The addition of the FAQ header is appropriate.


466-466: LGTM!

The addition of the section header is appropriate.

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