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

chore(docs): update store v2 adr #22794

Merged
merged 3 commits into from
Dec 9, 2024
Merged

chore(docs): update store v2 adr #22794

merged 3 commits into from
Dec 9, 2024

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Dec 7, 2024

Description

Update store v2 adr. The design of storage is a large simplification and focus on communicating to disk. Previously storage handled cachekv and gas kv which now have been moved to the stf layer

closes #22741


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • Documentation
    • Revised architecture document to enhance clarity on the separation of state commitment and storage.
    • Introduced a new RootStore interface for improved management of state commitments and storage backends.
    • Updated descriptions and diagrams in the store and pruning documentation to reflect the streamlined focus on state commitment.

@tac0turtle tac0turtle requested a review from a team as a code owner December 7, 2024 12:52
Copy link
Contributor

coderabbitai bot commented Dec 7, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The document adr-065-store-v2.md has been significantly revised to improve the Cosmos SDK's storage architecture. Key changes include a clear distinction between state commitment (SC) and state storage (SS), the removal of unnecessary store types, and the introduction of a new RootStore interface. The updates facilitate the integration of multiple SS backends, such as RocksDB and SQLite, while maintaining backward compatibility. The document also discusses performance implications and the developer experience, ensuring existing implementations remain unaffected despite the architectural changes.

Changes

File Change Summary
docs/architecture/adr-065-store-v2.md - Significant revisions to clarify SC and SS roles.
- Removal of CacheKVStore.
- Introduction of RootStore interface.
- Updated method signature for state management.
- Proposal for multiple SS backends.
store/v2/README.md - Refined documentation for root.Store to emphasize SC.
- Updated sequence diagram to remove SS references.
- Clarified PruneStoreKeys function behavior.
- Adjusted pruning responsibility to the commitment layer.
store/v2/pruning/README.md - Updated PruningManager description to focus on SC.
- Adjusted pruning flow diagram to remove StorageStore references.
- Removed calls to PausePruning for StorageStore.

Assessment against linked issues

Objective Addressed Explanation
Update ADR-65 to reflect changes from previous PR (#22741)

Possibly related PRs

Suggested reviewers

  • kocubinski
  • sontrinh16
  • julienrbrt
  • testinginprod

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>, please review it.
    • 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 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.

@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Dec 7, 2024
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 (3)
docs/architecture/adr-065-store-v2.md (3)

84-86: Consider adding migration impact details

While the removal of store types and branching logic aligns with the simplification goal, it would be helpful to add:

  1. The rationale behind removing CacheKVStore
  2. How existing applications should handle caching after this change
  3. Migration steps for applications currently using these features

96-101: Consider adding performance metrics

To help developers make informed decisions about IAVL versions:

  1. Add quantitative performance comparisons between IAVL v1, v2, and MemIAVL
  2. Include estimated state migration times based on state size
  3. Document any breaking changes between versions

135-135: Clarify architectural implications

The simplified method description "Manage commitment of state" removes explicit mention of SS and SC. Consider:

  1. Documenting whether this is purely a documentation change or reflects architectural changes
  2. Explaining how SS and SC responsibilities are now handled
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between dda47b5 and 70b5e7c.

📒 Files selected for processing (1)
  • docs/architecture/adr-065-store-v2.md (5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/architecture/adr-065-store-v2.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

🪛 LanguageTool
docs/architecture/adr-065-store-v2.md

[grammar] ~153-~153: Two determiners in a row. Choose either “the” or “a”.
Context: ... Retrieving proofs will be done through the a RootStore, which will internally rout...

(DT_DT)

So providing inclusion and exclusion proofs, via a `CommitmentOp` type, will be
the responsibility of the SC backend. Retrieving proofs will be done through the
a `RootStore`, which will internally route the request to the SC backend.
Providing a `CommitmentOp` type, will be the responsibility of the SC backend. Retrieving proofs will be done through the a `RootStore`, which will internally route the request to the SC backend.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix grammatical error

The sentence contains a grammatical error and could be clearer.

-Providing a `CommitmentOp` type, will be the responsibility of the SC backend. Retrieving proofs will be done through the a `RootStore`, which will internally route the request to the SC backend.
+Providing a `CommitmentOp` type will be the responsibility of the SC backend. Retrieving proofs will be done through a `RootStore`, which will internally route the request to the SC backend.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Providing a `CommitmentOp` type, will be the responsibility of the SC backend. Retrieving proofs will be done through the a `RootStore`, which will internally route the request to the SC backend.
Providing a `CommitmentOp` type will be the responsibility of the SC backend. Retrieving proofs will be done through a `RootStore`, which will internally route the request to the SC backend.
🧰 Tools
🪛 LanguageTool

[grammar] ~153-~153: Two determiners in a row. Choose either “the” or “a”.
Context: ... Retrieving proofs will be done through the a RootStore, which will internally rout...

(DT_DT)

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

Can you update the ADR changelog and change the status to IMPLEMENTED?

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 and nitpick comments (2)
store/v2/README.md (2)

10-10: Fix grammatical issues

Please address the following grammatical issues:

  1. Line 10: Replace "it's" with "its" (possessive form)
  2. Line 51: Add a hyphen in "implementation-specific"
-abstraction layer around it's primary constituent components - state commitment (SC). It acts as the main entry point into storage for an
+abstraction layer around its primary constituent components - state commitment (SC). It acts as the main entry point into storage for an

-of the underlying commitment layer. This means pruning can be implementation specific,
+of the underlying commitment layer. This means pruning can be implementation-specific,

Also applies to: 51-51

🧰 Tools
🪛 LanguageTool

[grammar] ~10-~10: Did you mean the possessive pronoun “its”?
Context: ...d to act as an abstraction layer around it's primary constituent components - state ...

(IT_S_ITS)


62-62: Enhance test coverage documentation

The test coverage section appears incomplete. Consider adding:

  1. List of specific logical components that require coverage
  2. Instructions for measuring coverage
  3. Guidelines for maintaining or improving coverage

Would you like me to help draft a more detailed test coverage section?

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 70b5e7c and 8a1502a.

📒 Files selected for processing (1)
  • store/v2/README.md (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
store/v2/README.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

🪛 LanguageTool
store/v2/README.md

[grammar] ~10-~10: Did you mean the possessive pronoun “its”?
Context: ...d to act as an abstraction layer around it's primary constituent components - state ...

(IT_S_ITS)


[uncategorized] ~51-~51: This expression is ususally spelled with a hyphen
Context: ...itment layer. This means pruning can be implementation specific, such as being synchronous or asynchron...

(SPECIFIC_HYPHEN)

🔇 Additional comments (1)
store/v2/README.md (1)

10-18: Technical content accurately reflects architectural changes

The documentation updates correctly reflect the simplified storage design where:

  1. State Commitment (SC) is now the primary focus
  2. State Storage (SS) references have been appropriately removed
  3. Pruning responsibility is clearly defined as part of the underlying commitment layer

Also applies to: 39-41

🧰 Tools
🪛 LanguageTool

[grammar] ~10-~10: Did you mean the possessive pronoun “its”?
Context: ...d to act as an abstraction layer around it's primary constituent components - state ...

(IT_S_ITS)

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 and nitpick comments (2)
store/v2/pruning/README.md (2)

4-4: LGTM with suggestions for documentation improvements

The updated description correctly reflects the focus on state commitment (SC). However, consider adding:

  • A brief explanation of why SS was removed from pruning responsibilities
  • A link to ADR-65 for more context about this architectural decision

Line range hint 1-50: Consider clarifying architectural implications

The document would benefit from explaining:

  • The impact of this change on existing implementations
  • How this relates to the broader store v2 architecture
  • Whether users need to make any adjustments to their pruning configurations
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8a1502a and 8add9d0.

📒 Files selected for processing (1)
  • store/v2/pruning/README.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
store/v2/pruning/README.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

@tac0turtle tac0turtle added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit f995d0a Dec 9, 2024
73 of 74 checks passed
@tac0turtle tac0turtle deleted the marko/22741 branch December 9, 2024 11:27
mergify bot pushed a commit that referenced this pull request Dec 9, 2024
(cherry picked from commit f995d0a)

# Conflicts:
#	store/v2/README.md
#	store/v2/pruning/README.md
julienrbrt added a commit that referenced this pull request Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release C:Store Type: ADR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Documentation]: Update ADR-65 since SS removal
6 participants