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

feat!: modify constraint for signal versions #3558

Merged
merged 5 commits into from
Jun 14, 2024

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Jun 12, 2024

Closes #3550

@rootulp rootulp added the WS: V2 ✌️ lemongrass hardfork related label Jun 12, 2024
@rootulp rootulp self-assigned this Jun 12, 2024
@rootulp rootulp marked this pull request as ready for review June 12, 2024 19:05
@rootulp rootulp requested a review from a team as a code owner June 12, 2024 19:05
Copy link
Contributor

coderabbitai bot commented Jun 12, 2024

Walkthrough

The changes involve updating the SignalVersion function within the keeper.go file to allow for signaling of any version that is greater than or equal to the current version, removing the previous constraint that limited signaling to only the current or next version. Additionally, the error messaging and related test cases have been updated to reflect and validate this new logic.

Changes

File Change Summary
x/signal/keeper.go Updated SignalVersion function to allow signaling for any version greater than the current one. Improved error handling.
x/signal/keeper_test.go Adjusted test functions to align with new validation logic. Added a new test (TestCanSkipVersion) to verify signaling for higher versions.
x/signal/types/errors.go Updated ErrInvalidVersion error message to reflect the new validation logic.

Sequence Diagram(s)

sequenceDiagram
    participant Validator
    participant SignalKeeper

    Validator->>SignalKeeper: Request SignalVersion(current, signaled)
    alt signaled >= current
        SignalKeeper-->Validator: Success
    else signaled < current
        SignalKeeper-->Validator: Error: "signalled version cannot be less than the current version"
    end
Loading

Assessment against linked issues

Objective (#3550) Addressed Explanation
Remove constraint enforcing signals for current or next app version
Update error handling to provide specific error messages for invalid versions
Add comprehensive tests to validate scenarios including signaling for versions greater than next version

Possibly related issues

  • Signal for a specific version #3543: This PR addresses the issue by removing the constraint on signaling versions, allowing for signaling of any greater version, which aligns with one of the proposed solutions in the issue.

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 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 Configration 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.

x/signal/keeper.go Outdated Show resolved Hide resolved
@rootulp rootulp marked this pull request as draft June 13, 2024 13:55
@rootulp rootulp changed the title feat!: remove constraint for signal versions feat!: modify constraint for signal versions Jun 13, 2024
@rootulp rootulp marked this pull request as ready for review June 13, 2024 14:05
@rootulp rootulp requested a review from cmwaters June 13, 2024 14:05
@rootulp rootulp marked this pull request as draft June 13, 2024 15:22
@rootulp rootulp marked this pull request as draft June 13, 2024 15:22
@rootulp rootulp marked this pull request as ready for review June 13, 2024 16:25
Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -122,11 +121,13 @@ func TestTallyingLogic(t *testing.T) {
Version: 0,
})
require.Error(t, err)
require.ErrorIs(t, err, types.ErrInvalidVersion)
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] Would be helpful to add a one liner for each testcase explaining why an error is required or not required.

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.

👍

@rootulp rootulp merged commit 28c9155 into celestiaorg:main Jun 14, 2024
32 checks passed
@rootulp rootulp deleted the rp/remove-constraint branch June 14, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WS: V2 ✌️ lemongrass hardfork related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove constraint that enforces signals for current or next app version
3 participants