-
Notifications
You must be signed in to change notification settings - Fork 21
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: take care of the case where the requested height is above the head of latest da block height #90
Conversation
WalkthroughThe changes involve a significant update to error handling in the Changes
Poem
Tip Early access features: disabledWe are currently testing the following features in early access:
Note:
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- test/dummy.go (2 hunks)
- test/test_suite.go (3 hunks)
Additional context used
golangci-lint
test/dummy.go
97-97: File is not
goimports
-ed with -local github.com/rollkit(goimports)
Additional comments not posted (3)
test/test_suite.go (2)
31-32
: Review ofHeightFromFutureTest
:The new test function
HeightFromFutureTest
is well-named and aligns with the PR's objective to handle future height requests. The test asserts that an error is returned for a height that is presumably in the future, which is a valid scenario to test given the changes in the DA implementation.The changes to the test function are approved as they correctly implement the intended functionality.
Also applies to: 155-160
140-140
: Review ofConcurrentReadWriteTest
simplifications:The simplification of error handling in
ConcurrentReadWriteTest
by removing specific error checks could potentially reduce the test's ability to catch subtle issues in concurrent operations. It's crucial to ensure that the test still robustly checks for errors that could occur during these operations.Please verify that the removal of specific error checks does not impact the ability of the test to detect issues in concurrent operations. Consider adding more comprehensive error checks if necessary.
Also applies to: 147-147
test/dummy.go (1)
19-20
: Review of error handling changes inDummyDA
:The introduction of
ErrTooHigh
is a significant improvement in error messaging, making it clear that the requested height is in the future. The modification in theGetIDs
method to return this error when the height exceeds the current height is a logical change that enhances the robustness of the method.The changes to error handling are approved as they correctly implement the intended functionality and improve the clarity of the error messages.
Also applies to: 88-97
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- test/dummy.go (2 hunks)
- test/test_suite.go (3 hunks)
Additional comments not posted (6)
test/test_suite.go (2)
158-162
: LGTM!The code changes are approved. The new test function
HeightFromFutureTest
correctly tests the scenario where the specified height is in the future and asserts that the expected errorErrTooHigh
is returned.
140-141
: Verify theSubmit
method usage.The simplified error handling logic in the goroutine that calls
d.GetIDs
is approved. It correctly asserts that the expected errorErrTooHigh
is returned.However, ensure that the
Submit
method is expected to handle an empty byte slice[]byte{}
as its second parameter.Run the following script to verify the
Submit
method usage:Also applies to: 149-149
test/dummy.go (4)
19-20
: LGTM!The change in the error constant and message improves the clarity of the error handling related to height validation.
88-91
: LGTM!The new control flow prevents further processing when an invalid height is provided, enhancing the robustness of the method.
97-97
: LGTM!The empty line improves the readability of the code.
95-95
: LGTM! But verify the impact on the calling code.The change indicates that the absence of data at the requested height is no longer treated as an error condition. Ensure that the calling code handles the
nil
return value appropriately.Run the following script to verify the usage of the
GetIDs
method:
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.
LGTM
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.
OK.
We need to handle the case where full node goes above the max height of the da, so it's consistent with real world da implementations, and handled correctly by the full node retrieve loop.
Summary by CodeRabbit
New Features
Bug Fixes