-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
chore(sims): Complete sims integration for app v2 #23478
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis pull request involves the removal of commented-out simulation test targets and associated documentation in the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used📓 Path-based instructions (2)store/v2/CHANGELOG.md (1)Pattern simapp/v2/sim_runner.go (1)Pattern ⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (6)
✨ Finishing Touches
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
Documentation and Community
|
c813deb
to
be40c91
Compare
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
🧹 Nitpick comments (2)
server/v2/appmanager/CHANGELOG.md (1)
Line range hint
29-31
: Fix typo in beta.2 entry.There's a typo in the interface description: "generated" should be "generating".
-* [#23013](https://github.com/cosmos/cosmos-sdk/pull/23013) Introduce `TransactionFuzzer`, an interface for processing and generated state transitions. +* [#23013](https://github.com/cosmos/cosmos-sdk/pull/23013) Introduce `TransactionFuzzer`, an interface for processing and generating state transitions.store/CHANGELOG.md (1)
34-38
: Enhance the changelog entry with more details.While the entry is correctly formatted, it would be more helpful to provide additional context about memDB's role in simulations, similar to the level of detail in other entries.
Consider expanding the entry like this:
-* [#23013](https://github.com/cosmos/cosmos-sdk/pull/23013) Support memDB for sims +* [#23013](https://github.com/cosmos/cosmos-sdk/pull/23013) Add support for in-memory database (memDB) in simulation environments to improve testing performance and reliability
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
scripts/build/simulations.mk
(0 hunks)server/v2/appmanager/CHANGELOG.md
(1 hunks)server/v2/cometbft/abci.go
(1 hunks)server/v2/cometbft/streaming.go
(4 hunks)server/v2/stf/CHANGELOG.md
(1 hunks)simapp/v2/sim_runner.go
(8 hunks)store/CHANGELOG.md
(1 hunks)
💤 Files with no reviewable changes (1)
- scripts/build/simulations.mk
🧰 Additional context used
📓 Path-based instructions (6)
store/CHANGELOG.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
server/v2/appmanager/CHANGELOG.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
server/v2/stf/CHANGELOG.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
server/v2/cometbft/abci.go (1)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
simapp/v2/sim_runner.go (1)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
server/v2/cometbft/streaming.go (1)
Pattern **/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze
- GitHub Check: Summary
🔇 Additional comments (9)
server/v2/cometbft/streaming.go (2)
23-27
: Delegation toStreamOut
Improves ModularityThe
streamDeliverBlockChanges
method now delegates to the newStreamOut
function, enhancing code modularity and simplifying maintenance.
29-67
: Introduction of GenericStreamOut
FunctionThe addition of the
StreamOut
function consolidates streaming logic into a single, generic method, improving code reuse and readability. It correctly aggregates events and handles streaming to listeners.simapp/v2/sim_runner.go (3)
124-125
: Addition of Streaming Fields toTestInstance
The
TestInstance
struct now includesStreamManager
andStreamHook
fields to support streaming capabilities in simulations. This extension enhances the test instance's functionality.
292-297
: Reading Custom Parameters from FileThe code now reads custom simulation parameters from a file when
tCfg.ParamsFile
is specified. This allows for more flexible and configurable simulation runs.
547-559
: Appropriate Handling of Legacy Proposal MessagesIn the
prepareSimsMsgFactories
function, modules implementingHasLegacyProposalMsgs
are appropriately handled:case HasLegacyProposalMsgs: tb.Logf("Ignoring legacy proposal messages for module: %s", n)By logging and skipping these modules, the code ensures compatibility and focuses on modules supporting the current proposal message interface.
server/v2/cometbft/abci.go (2)
513-516
: Stream Changes After Committing StateThe
FinalizeBlock
function streams block changes after committing the state:// listen to state streaming changes in accordance with the block err = c.streamDeliverBlockChanges(ctx, req.Height, req.Txs, decodedTxs, *resp, stateChanges) if err != nil { return nil, err }This ensures that the streaming of events and state changes reflects the committed state, maintaining consistency between the application state and streamed data.
Line range hint
513-539
: Simplification of Event Handling inFinalizeBlock
By removing redundant event aggregation and passing the
blockResp
andstateChanges
directly tostreamDeliverBlockChanges
, the code simplifies event handling and improves maintainability.server/v2/stf/CHANGELOG.md (1)
25-27
: LGTM! Changelog entry is well-formatted and accurate.The entry correctly documents the addition of DeliverSims entrypoint for simulations, with proper PR reference and formatting.
server/v2/appmanager/CHANGELOG.md (1)
25-27
: LGTM! Changelog entry is well-formatted and accurate.The entry correctly documents the addition of TransactionFuzzer as an entrypoint for simulations, with proper PR reference and formatting.
Description
Closes: #23265
genesis
sims targets . Background: they are not going to work without the private account keys for signingstreaming
sims targets. Background: there are 2 models of streaming support in the SDK which integrate on the v2/cometbft level. Sims are one layer above on the appmanager. While I added support to the v2 sims runner, I don't see much value in providing a setup for the listener side already. There are unit tests in place for the streaming logic.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
Summary by CodeRabbit
Simulation Improvements
memDB
in simulationsTransactionFuzzer
andDeliverSims
Code Cleanup
Streaming Enhancements
Dependency Updates
cosmossdk.io/schema
as a direct dependency