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

refactor(simapp): un-wire crisis #18380

Merged
merged 2 commits into from
Nov 7, 2023
Merged

refactor(simapp): un-wire crisis #18380

merged 2 commits into from
Nov 7, 2023

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Nov 6, 2023

Description

The crisis module does not work as intended (GHSA-qfc5-6r3j-jj22) and does not panic (needs something alike to work c91f5a9) and with its current design, can cause high load on chains.

The advisory mentions that crisis won't be fixed in order to make a chain alt.
And the simulator is going to replace the use case of crisis for invariant checking: #15706

With all this in mind, we should remove x/crisis from simapp so that developers that use simapp as an example do not simply add it to their chain. IMHO, we should simply remove it from the SDK from v0.51 thanks to the new simulator and x/circuit being already there.


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
  • added ! to 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
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • 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.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Summary by CodeRabbit

  • New Features
    • Enhanced flexibility in adding start flags to commands.
  • Bug Fixes
    • Removed the crisis module and related components for improved stability and performance.
  • Refactor
    • Simplified command addition process by removing unnecessary function calls.
  • Chores
    • Discontinued the crisis module in version v0.51.0 of the SDK.

@julienrbrt julienrbrt requested a review from a team as a code owner November 6, 2023 21:17
Copy link
Contributor

coderabbitai bot commented Nov 6, 2023

Walkthrough

The overall changes revolve around the removal of the "crisis" module from the codebase. This includes the removal of import statements, variable declarations, function calls, and test functions related to the "crisis" module. The changes provide a more streamlined codebase by eliminating unnecessary components and dependencies.

Changes

File(s) Change Summary
server/util.go Added a conditional check before calling the addStartFlags function.
simapp/app.go, simapp/app_v2.go, simapp/export.go Removed the "crisis" module, including the CrisisKeeper field, instantiation, and registration of invariants.
simapp/app_config.go Removed the crisistypes.ModuleName from various lists.
simapp/app_test.go Removed references to the "crisis" module in test functions.
simapp/sim_bench_test.go Removed the BenchmarkInvariants function.
simapp/simd/cmd/commands.go Removed the import of the "crisis" package and the addModuleInitFlags function.

Poem

🍂 As autumn leaves fall, so does the "crisis" module, all,

Swept away by the winds of change, the codebase now feels strange.

No more "crisis" to be seen, the code is now more lean.

🐇 Hop, hop, hop, the rabbit goes, where it stops, nobody knows.

Celebrating this day in history, with a code change that's no mystery.

So here's to a codebase that's inclusive and bright, coding away into the night. 🌙


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

@github-prbot github-prbot requested review from a team, alexanderbez and testinginprod and removed request for a team November 6, 2023 21:17
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fb9dadc and afa4c01.
Files selected for processing (8)
  • server/util.go (1 hunks)
  • simapp/app.go (9 hunks)
  • simapp/app_config.go (5 hunks)
  • simapp/app_test.go (3 hunks)
  • simapp/app_v2.go (4 hunks)
  • simapp/export.go (1 hunks)
  • simapp/sim_bench_test.go (2 hunks)
  • simapp/simd/cmd/commands.go (3 hunks)
Files skipped from review due to trivial changes (6)
  • simapp/app.go
  • simapp/app_config.go
  • simapp/app_test.go
  • simapp/app_v2.go
  • simapp/sim_bench_test.go
  • simapp/simd/cmd/commands.go
Additional comments: 2
server/util.go (1)
  • 339-345: The conditional check before calling addStartFlags is a good practice as it prevents potential null pointer exceptions if addStartFlags is not provided. This change improves the robustness of the code.
simapp/export.go (1)
  • 72-77: The removal of the crisis module and its related logic seems to be correctly implemented in this function. Ensure that the removal of the crisis module does not affect the functionality of the remaining code.

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.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between afa4c01 and 549977a.
Files selected for processing (1)
  • simapp/upgrades.go (2 hunks)
Additional comments: 1
simapp/upgrades.go (1)
  • 43-43: The crisistypes.ModuleName has been correctly added to the Deleted field of StoreUpgrades to indicate that the crisis module has been discontinued.

simapp/upgrades.go Show resolved Hide resolved
@julienrbrt julienrbrt added this pull request to the merge queue Nov 7, 2023
Merged via the queue into main with commit bf82c75 Nov 7, 2023
66 of 67 checks passed
@julienrbrt julienrbrt deleted the julien/crisis-dewrire branch November 7, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants