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: add share version 1 to specs #3955

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Oct 9, 2024

Closes #3867

@rootulp rootulp self-assigned this Oct 9, 2024
@rootulp rootulp requested review from liamsi and a team as code owners October 9, 2024 19:37
@rootulp rootulp requested review from rach-id and ninabarbakadze and removed request for a team October 9, 2024 19:37
@celestia-bot celestia-bot requested a review from a team October 9, 2024 19:37
@rootulp rootulp requested review from cmwaters and removed request for liamsi October 9, 2024 19:37
Copy link
Contributor

coderabbitai bot commented Oct 9, 2024

📝 Walkthrough

Walkthrough

The changes include the addition of a new constant SignerSize in specs/src/consensus.md, which specifies the size of the signer in shares. In specs/src/shares.md, a new section on "Share Version" has been introduced, detailing the differences between share versions 0 and 1. The structure of shares has been modified to include a signer field in version 1, along with updates to sections on transaction shares and padding for clarity. These modifications enhance the overall specification of share formats and their versioning.

Changes

File Path Change Summary
specs/src/consensus.md Added constant SignerSize (20 bytes) to specify the size of the signer in a share.
specs/src/shares.md Introduced "Share Version" section and detailed versioning. Added signer field in version 1.
specs/src/shares.md Expanded "Transaction Shares" section to include SHARE_RESERVED_BYTES.
specs/src/shares.md Updated "Padding" section with clarifications on padding shares.

Assessment against linked issues

Objective Addressed Explanation
Update the specs with share version 1 (#3867)

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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

@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: 1

🧹 Outside diff range and nitpick comments (2)
specs/src/shares.md (2)

53-63: LGTM with suggestion: Clarify the purpose of the signer field

The new "Share Version 1" section clearly explains the structural difference between share versions 0 and 1, including a helpful visual representation. However, it would be beneficial to provide more context about the signer field:

  1. What does the signer field represent?
  2. How is it used in the system?
  3. Why was it necessary to introduce this field in version 1?

Adding this information would help readers understand the significance of this change and its impact on the system.


Line range hint 65-95: LGTM with suggestion: Update visual representations

The updates to the "Transaction Shares" section provide clear and detailed information about the SHARE_RESERVED_BYTES field and its placement in different types of shares. This additional clarity is valuable for understanding the structure of transaction shares.

However, I noticed that the visual representations (Figure 3 and Figure 4) have not been updated to reflect these changes. To maintain consistency and avoid confusion, consider updating these figures to include the SHARE_RESERVED_BYTES field in the appropriate positions for both the first share and continuation shares in a sequence.

🧰 Tools
🪛 LanguageTool

[style] ~51-~51: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...itional metadata in their raw blob data prior to inclusion in a Celestia block. For exam...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 206b96c and e5ee04c.

⛔ Files ignored due to path filters (2)
  • specs/src/figures/first_share_with_signer.dot is excluded by !**/*.dot
  • specs/src/figures/first_share_with_signer.svg is excluded by !**/*.svg
📒 Files selected for processing (2)
  • specs/src/consensus.md (1 hunks)
  • specs/src/shares.md (2 hunks)
🧰 Additional context used
🔇 Additional comments (4)
specs/src/shares.md (3)

26-29: LGTM: Clear introduction of share versioning

The new "Share Version" section provides a concise and clear explanation of share versioning. It correctly outlines the purpose of versioning and when a new version should be introduced.


Line range hint 97-131: LGTM: Helpful clarification on padding shares

The updates to the "Padding" section provide useful clarification that clients may ignore the contents of padding shares. This information is valuable for implementers and helps to distinguish the significance of different types of shares in the system.


Line range hint 1-185: Overall assessment: Comprehensive update with minor suggestions for improvement

The changes to this specification document significantly enhance its completeness and clarity. The introduction of share versioning and the detailed explanation of Share Version 1 are particularly valuable additions. The updates to the Transaction Shares and Padding sections also provide important clarifications.

To further improve the document:

  1. Consider adding more context about the purpose and usage of the signer field in Share Version 1.
  2. Update the visual representations in the Transaction Shares section to reflect the recent changes.

These changes align well with the PR objectives of updating the documentation to include specifications for share version 1 and addressing the gap in existing documentation.

To ensure consistency across the codebase, let's check for any references to share versions:

✅ Verification successful

Verification Successful: All references to "share version" are confined to specs/src/shares.md.

The review comment has been fully verified. There are no additional references to "share version" outside of the updated specification document, ensuring that the changes are well-contained and do not impact other areas of the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to share versions in the codebase
rg --type-add 'spec:*.md' --type spec 'share version' specs/

Length of output: 1587

🧰 Tools
🪛 LanguageTool

[style] ~51-~51: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...itional metadata in their raw blob data prior to inclusion in a Celestia block. For exam...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

specs/src/consensus.md (1)

35-35: Verify usage of SignerSize in other files

While the addition of SignerSize is correct and necessary for share version 1, it's important to ensure that this constant is properly utilized in other relevant parts of the codebase, such as share encoding/decoding logic or data structure definitions.

Let's check for potential uses or updates needed in other files:

@@ -32,6 +32,7 @@
| `SHARE_INFO_BYTES` | `uint64` | `1` | `byte` | The number of bytes used for [share](data_structures.md#share) information |
| `SHARE_RESERVED_BYTES` | `uint64` | `4` | `byte` | The number of bytes used to store the index of the first transaction in a transaction share. Must be able to represent any integer up to and including `SHARE_SIZE - 1`. |
| `SHARE_SIZE` | `uint64` | `512` | `byte` | Size of transaction and blob [shares](data_structures.md#share), in bytes. |
| `SignerSize` | `int` | `20` | `byte` | The number of bytes used to store the signer in a [share](data_structures.md#share). |
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

SignerSize is defined but not used in the codebase

The SignerSize constant in specs/src/consensus.md is currently not referenced or utilized in any other .md or .rust files. Please verify if this constant is intended for future use or if it should be removed to prevent unnecessary clutter.

🔗 Analysis chain

New constant SignerSize added

The addition of the SignerSize constant is consistent with the PR objectives to include specifications for share version 1. This constant defines the number of bytes used to store the signer in a share, which is a key feature of share version 1.

To ensure this constant is used correctly throughout the codebase, let's run a search:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for uses of SignerSize in the codebase
rg --type md --type rust "SignerSize"

Length of output: 311

Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

Amazing! Thanks for doing that

@@ -32,6 +32,7 @@
| `SHARE_INFO_BYTES` | `uint64` | `1` | `byte` | The number of bytes used for [share](data_structures.md#share) information |
| `SHARE_RESERVED_BYTES` | `uint64` | `4` | `byte` | The number of bytes used to store the index of the first transaction in a transaction share. Must be able to represent any integer up to and including `SHARE_SIZE - 1`. |
| `SHARE_SIZE` | `uint64` | `512` | `byte` | Size of transaction and blob [shares](data_structures.md#share), in bytes. |
| `SignerSize` | `int` | `20` | `byte` | The number of bytes used to store the signer in a [share](data_structures.md#share). |
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it problematic that there's a different formatting i.e. SignerSize and not SIGNER_SIZE?

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.

Add share version 1 to specs
3 participants