Skip to content

fix: modify end blocker order to avoid panic when reducing MaxValidators#3786

Merged
gartnera merged 14 commits intodevelopfrom
reduce-validator-set
Apr 14, 2025
Merged

fix: modify end blocker order to avoid panic when reducing MaxValidators#3786
gartnera merged 14 commits intodevelopfrom
reduce-validator-set

Conversation

@kingpinXD
Copy link
Member

@kingpinXD kingpinXD commented Apr 8, 2025

Description

Closes : #3782

Order used for this refactoring has been derived from
https://github.com/cosmos/gaia/blob/main/app/modules.go

How Has This Been Tested?

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • Fixes
    • Reordered module processing so that governance updates are applied before staking operations.
  • New Features
    • Introduced a test proposal that adjusts staking settings by reducing the maximum validator count and updating related parameters.
  • Documentation
    • Added a changelog entry summarizing the processing order improvement.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 8, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

The changes update the initialization process by reordering the governance module within the application's end blockers list. In the code, the governance module is now appended in a different sequence, which affects its execution at the end of each block. The changelog has been amended to reflect this reordering. Additionally, a new JSON proposal file has been introduced to test changes to the Cosmos staking parameters, specifically reducing the maximum validator count to 1.

Changes

File(s) Change Summary
app/app.go, changelog.md Modified the initialization by repositioning the governance module in the end blockers list; updated the changelog to document the reordering of governance actions.
contrib/localnet/.../reduce_max_validators.json Added a new proposal for the Cosmos staking module to update parameters (e.g., unbonding time, max validators, commission rate) and reduce the maximum validators to 1.

Sequence Diagram(s)

sequenceDiagram
    participant App
    participant EndBlocker
    participant GovModule
    participant OtherModules

    App->>EndBlocker: Trigger end block operations
    EndBlocker->>OtherModules: Process preliminary module tasks
    EndBlocker->>GovModule: Process governance operations (reordered)
Loading
sequenceDiagram
    participant Proposer
    participant Governance
    participant StakingModule

    Proposer->>Governance: Submit proposal (MsgUpdateParams)
    Governance->>StakingModule: Forward update parameters
    StakingModule-->>Governance: Acknowledge update
    Governance-->>Proposer: Return proposal status
Loading

Suggested labels

no-changelog, UPGRADE_TESTS

Suggested reviewers

  • brewmaster012
  • ws4charlie
  • fbac
  • swift1337
  • gartnera
  • lumtis

🪧 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@codecov
Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.18%. Comparing base (928adc5) to head (e59e455).
Report is 6 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3786   +/-   ##
========================================
  Coverage    64.18%   64.18%           
========================================
  Files          463      463           
  Lines        33156    33156           
========================================
  Hits         21282    21282           
  Misses       10897    10897           
  Partials       977      977           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kingpinXD kingpinXD marked this pull request as ready for review April 8, 2025 15:45
@kingpinXD kingpinXD requested a review from a team as a code owner April 8, 2025 15:45
@kingpinXD kingpinXD added UPGRADE_TESTS Run make start-upgrade-tests ADMIN_TESTS Run make start-admin-tests labels Apr 8, 2025
@kingpinXD kingpinXD changed the title fix: modify end bocker order to avoid panic when reducing MaxValidators fix: modify end blocker order to avoid panic when reducing MaxValidators Apr 8, 2025
Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Can we add a link for the reference for the order

@kingpinXD
Copy link
Member Author

kingpinXD commented Apr 9, 2025

Can we add a link for the reference for the order

Added the link the code and the PR description

@kingpinXD kingpinXD requested a review from lumtis April 10, 2025 01:27
@kingpinXD kingpinXD enabled auto-merge April 10, 2025 15:15
@kingpinXD kingpinXD added this pull request to the merge queue Apr 11, 2025
@github-actions github-actions bot added the MERGE_FAILED Merge Queue CI failed label Apr 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 11, 2025
@kingpinXD kingpinXD added this pull request to the merge queue Apr 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 11, 2025
@gartnera gartnera added the CONSENSUS_BREAKING_ACK Acknowledge a consensus breaking change label Apr 14, 2025
@gartnera gartnera added this pull request to the merge queue Apr 14, 2025
Merged via the queue into develop with commit 2ced7a3 Apr 14, 2025
54 checks passed
@gartnera gartnera deleted the reduce-validator-set branch April 14, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ADMIN_TESTS Run make start-admin-tests breaking:cli CONSENSUS_BREAKING_ACK Acknowledge a consensus breaking change MERGE_FAILED Merge Queue CI failed UPGRADE_TESTS Run make start-upgrade-tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zetacore: reduce MaxValidator count

4 participants