-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix(store): avoid nil error on not exhausted payload stream #20644
Conversation
WalkthroughThis update addresses a bug in the Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 2
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (3)
- store/CHANGELOG.md (1 hunks)
- store/snapshots/manager.go (1 hunks)
- store/v2/snapshots/manager.go (1 hunks)
Files skipped from review due to trivial changes (1)
- store/snapshots/manager.go
Additional context used
Path-based instructions (2)
store/CHANGELOG.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"store/v2/snapshots/manager.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
LanguageTool
store/CHANGELOG.md
[uncategorized] ~64-~64: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ... is extracted to have a separate go.mod file which allows it be a standalone module....
[grammar] ~64-~64: The preposition ‘to’ may be missing (allow someone to do something). (ALLOW_TO_DO)
Context: ... a separate go.mod file which allows it be a standalone module. * [#14410](https:/...
Markdownlint
store/CHANGELOG.md
57-57: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
58-58: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
59-59: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
43-43: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
@@ -28,6 +28,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ | |||
### Bug Fixes | |||
|
|||
* (store) [#20425](https://github.com/cosmos/cosmos-sdk/pull/20425) Fix nil pointer panic when query historical state where a new store don't exist. | |||
* (store) [#20644](https://github.com/cosmos/cosmos-sdk/pull/20644) Avoid nil error on not exhausted payload stream. |
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.
The changelog entry succinctly captures the essence of the bug fix. However, consider rephrasing for clarity and grammatical correctness.
- * (store) [#20644](https://github.com/cosmos/cosmos-sdk/pull/20644) Avoid nil error on not exhausted payload stream.
+ * (store) [#20644](https://github.com/cosmos/cosmos-sdk/pull/20644) Fix nil error when the payload stream is not exhausted.
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.
* (store) [#20644](https://github.com/cosmos/cosmos-sdk/pull/20644) Avoid nil error on not exhausted payload stream. | |
* (store) [#20644](https://github.com/cosmos/cosmos-sdk/pull/20644) Fix nil error when the payload stream is not exhausted. |
@@ -438,7 +438,7 @@ func (m *Manager) doRestoreSnapshot(snapshot types.Snapshot, chChunks <-chan io. | |||
} | |||
|
|||
if nextItem.GetExtensionPayload() != nil { | |||
return errorsmod.Wrapf(err, "extension %s don't exhausted payload stream", metadata.Name) | |||
return fmt.Errorf("extension %s don't exhausted payload stream", metadata.Name) |
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.
The error message grammar needs correction. Additionally, consider using errors.New
for consistency with other error messages that do not format strings.
- return fmt.Errorf("extension %s don't exhausted payload stream", metadata.Name)
+ return errors.New("extension " + metadata.Name + " has not exhausted the payload stream")
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.
return fmt.Errorf("extension %s don't exhausted payload stream", metadata.Name) | |
return errors.New("extension " + metadata.Name + " has not exhausted the payload stream") |
* main: fix(x/staking): stop validators from rotating to the same key on the same block (#20649) perf: add cache to address codec (#20122) build(deps): Bump google.golang.org/protobuf from 1.34.1 to 1.34.2 (#20632) fix: remove recipient amount from map (#20625) fix(proto): remove conditional preventing proper generated file placement (#20650) (serverv2/cometbft) Read config from commands & handle `FlagNode` (#20621) fix(x/consensus): fix .proto file placement (#20646) fix(store): avoid nil error on not exhausted payload stream (#20644) fix (x/accounts): Fix genesis condition check (#20645) feat(accounts): add genesis account initialization (#20642) fix(x/gov): limit execution in gov (#20348)
Description
Closes: #XXXX
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...
!
in the type prefix if API or client breaking changeCHANGELOG.md
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...
Summary by CodeRabbit