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(sim): port simulator to run on top of testutil/network #17938

Closed
wants to merge 4 commits into from

Conversation

elias-orijtech
Copy link
Contributor

@elias-orijtech elias-orijtech commented Oct 2, 2023

This change implements a replacement for the current simulator based
on testutil/network. Most of the changes are porting the module specific
message generators to no longer rely on SimulationState, and to generate
"real" messages, not simulator messages. The simulator driver is in
simapp, as part of the IntegationTestSuite.

The new approach aims to improve simulation in two important ways:

There are also downsides, however. Where the current simulator is too
high level, testutil/network is too low level: it runs a real network
of validators which is difficult to control. For example:

  • AppHashes differ between runs, because modules may depend on non-
    deterministic state such as block header timestamps.
  • The validators runs in separate goroutines, which makes it hard to
    query app state without introducing race conditions.
  • Blocks are produced according tot time, and not under control by the
    test driver. This makes it hard to trigger processing of messages in
    particular blocks, which ruins determinism.

Some of the issues may be worked around, for example by forcing the
block headers to be deterministic; however, the real fix is to make
testutil/network itself deterministic, providing the goldilock level
of simulation: close enough to a real network, yet deterministic enough
to generate the same chain state for a given random seed.

A deterministic testutil/network is part of #18145.

Future work includes:

  • Porting of the remaining module message generators.
  • Generating (and verifying) deterministic AppHashes, allowing reliable
    replay when a problematic message is detected. Depends on [Feature]: modular testutil.Network #18145.
  • Save/reload of state for faster debugging cycles.
  • Removal of the old simulator, most importantly the reference to it from
    module code.

Updates #14753 (Simulator rewrite epic)
Updates #7622 (reducing imports from modules to simulator)
Updates #13843 (using real message delivery for simulation)

CC @odeke-em @tac0turtle @alexanderbez

Summary by CodeRabbit

  • Refactor

    • Streamlined simulation setup by removing dependencies on the auth module across various test suites.
    • Simplified the initialization of simulation managers to default settings in multiple test files.
    • Updated the auth module's initialization process by excluding specific arguments related to random account generation.
  • New Features

    • Introduced new global variables and functions in testutil_network_test.go to enhance network and application configuration for testing.
    • Added new configuration options for network fuzz testing in testutil/network/network.go.
  • Bug Fixes

    • Adjusted the RandomGenesisAccounts and RandomizedGenState functions in the x/auth/simulation package to accept new parameters and return updated types, ensuring correct initialization of genesis states.
  • Documentation

    • Updated function names and signatures in the x/auth/simulation and x/bank/simulation packages to better reflect their purpose.
  • Chores

    • Removed unused constants and functions across various simulation and operation files to clean up the codebase.

Copy link
Collaborator

@odeke-em odeke-em left a comment

Choose a reason for hiding this comment

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

Nice work and thank you @elias-orijtech! Just an initial round of review.

network *network.Network
}

func (s *IntegrationTestSuite) SetupSuite() {
s.T().Log("setting up integration test suite")

s.rand = rand.New(rand.NewSource(42))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add a comment here

// Using a hardcoded seed for predictability.
// TODO(@elias-orijtech): allow the seed to be passed in.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For AppHash tests, the seed has to be hardcoded. I prefer to leave this for when MockComet support is added.

}
return fixture
})
s.cfg.NumValidators = s.rand.Intn(10)
Copy link
Collaborator

Choose a reason for hiding this comment

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

// TODO(@elias-orijtech): allow number of validators to
// be programmatically passed in perhaps via cli arguments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There has to be some limit? I assume this particular parameter will be revisited once testutil runs on top of MockComet.

@elias-orijtech elias-orijtech force-pushed the simulator-rewrite branch 2 times, most recently from c1f6201 to 79dc580 Compare October 18, 2023 23:06
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

loving the cleanup

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2023

Walkthrough

Walkthrough

The changes across various files in the Cosmos SDK-based application suggest a significant refactoring of the simulation framework. The auth module's simulation imports and dependencies have been removed, and the simulation setup has been simplified with default settings. Functions related to generating random genesis accounts and simulation operations have been updated or removed, indicating a shift in how simulations are configured and executed. Additionally, there are updates to network configuration and governance module simulations, reflecting a broader overhaul of the testing and simulation environment.

Changes

File(s) Summary
simapp/app.go, simapp/app_v2.go, tests/integration/.../deterministic_test.go, tests/integration/.../msg_server_test.go, tests/integration/.../infraction_test.go, tests/integration/.../example_test.go, tests/integration/.../keeper_test.go, tests/integration/.../common_test.go Removed cosmossdk.io/x/auth/simulation import and updated auth.NewAppModule initialization to exclude authsims.RandomGenesisAccounts.
simapp/testutil_network_test.go Added imports, initialized new global variables, modified SetupSuite, and added TestSimulation function.
testutil/network/network.go, x/auth/module.go Introduced new imports and fields, updated function signatures, and removed certain parameters and fields.
x/auth/simulation/genesis.go, x/auth/simulation/proposals.go, x/bank/module.go, x/bank/simulation/genesis.go, x/bank/simulation/operations.go, x/gov/module.go, x/gov/simulation/genesis.go, x/gov/simulation/operations.go Significant changes to function signatures and internal logic, removal of global constants, and refactoring of simulation functions.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

@elias-orijtech elias-orijtech force-pushed the simulator-rewrite branch 2 times, most recently from 90a9e2e to 7fed617 Compare November 2, 2023 22:59
@elias-orijtech
Copy link
Contributor Author

I've rebased and pushed the current progress of the simulator, and described the approach and future direction in the last commit and the PR description. The first commit removes the simulator tests that lock in message content, which I don't think are worth their weight.

The PR is ready for review, but I've left it a draft because someone should decide whether to revert deletion of the replaced generators.

@elias-orijtech elias-orijtech force-pushed the simulator-rewrite branch 3 times, most recently from 2b49651 to 42d2ff1 Compare November 2, 2023 23:16
@elias-orijtech
Copy link
Contributor Author

Not sure what to do about the linter errors:

Error: ./testutil_network_test.go:132:128: cannot use v0app.GovKeeper (variable of type "cosmossdk.io/x/gov/keeper".Keeper) as *"cosmossdk.io/x/gov/keeper".Keeper value in argument to govsim.GenerateMsgSubmitProposal
Error: ./testutil_network_test.go:133:120: cannot use v0app.GovKeeper (variable of type "cosmossdk.io/x/gov/keeper".Keeper) as *"cosmossdk.io/x/gov/keeper".Keeper value in argument to voteGen.GenerateVotes
Error: ./testutil_network_test.go:138:122: cannot use v0app.GovKeeper (variable of type "cosmossdk.io/x/gov/keeper".Keeper) as *"cosmossdk.io/x/gov/keeper".Keeper value in argument to govsim.GenerateMsgDeposit
Error: ./testutil_network_test.go:144:127: cannot use v0app.GovKeeper (variable of type "cosmossdk.io/x/gov/keeper".Keeper) as *"cosmossdk.io/x/gov/keeper".Keeper value in argument to govsim.GenerateMsgVoteWeighted
Error: ./testutil_network_test.go:147:129: cannot use v0app.GovKeeper (variable of type "cosmossdk.io/x/gov/keeper".Keeper) as *"cosmossdk.io/x/gov/keeper".Keeper value in argument to govsim.GenerateMsgCancelProposal (typecheck)

They seem to be caused by a mismatch between the v1 and v2 simapp.SimApp.GovKeeper field. The v2 field is a pointer, whereas the v1 field is not.

@elias-orijtech elias-orijtech force-pushed the simulator-rewrite branch 3 times, most recently from 65ef1d6 to 8e83401 Compare November 9, 2023 21:25
@elias-orijtech elias-orijtech marked this pull request as ready for review November 9, 2023 21:42
@elias-orijtech elias-orijtech requested a review from a team as a code owner November 9, 2023 21:42
@github-prbot github-prbot requested review from a team, facundomedica and samricotta and removed request for a team November 9, 2023 21:42
@elias-orijtech
Copy link
Contributor Author

@tac0turtle I've rebased the PR on top of the recent testutil changes and re-enabled genesis state generation for the old simulator for compatibility. The missing piece is the v1 vs v2 simapp difference in the GovKeeper field.

…ction

The tests don't carry their maintenance weight, because they merely
enforce particular messages for a particular random generator state.

This is part of the simulator rewrite which is going to replace the
generators.
This change implements a replacement for the current simulator based
on testutil/network. Most of the changes are porting the module specific
message generators to no longer rely on SimulationState, and to generate
"real" messages, not simulator messages. The simulator driver is in
simapp, as part of the IntegationTestSuite.

The new approach aims to improve simulation in two important ways:

- Simulation should more closely mimic a real network. The current
simulator message delivery is implemented parallel to non-simulator
message delivery, leading to loss of fidelity and higher maintenance.
One symptom is cosmos#13843.
- Simulation should be layered on top of modules, not part of modules.
This means that modules should not import simulation packages, nor refer
to its generator package (x/module/simulation). This should eventually
fix cosmos#7622.

There are also downsides, however. Where the current simulator is too
high level, testutil/network is too low level: it runs a real network
of validators which is difficult to control. For example:

- AppHashes differ between runs, because modules may depend on non-
deterministic state such as block header timestamps.
- The validators runs in separate goroutines, which makes it hard to
query app state without introducing race conditions.
- Blocks are produced according tot time, and not under control by the
test driver. This makes it hard to trigger processing of messages in
particular blocks, which ruins determinism.

Some of the issues may be worked around, for example by forcing the
block headers to be deterministic; however, the real fix is to make
testutil/network itself deterministic, providing the goldilock level
of simulation: close enough to a real network, yet deterministic enough
to generate the same chain state for a given random seed.

A deterministic testutil/network is part of cosmos#18145.

Future work includes:

- Porting of the remaining module message generators.
- Generating (and verifying) deterministic AppHashes, allowing reliable
replay when a problematic message is detected. Depends on cosmos#18145.
- Save/reload of state for faster debugging cycles.
- Removal of the old simulator, most importantly the reference to it from
 module code.

 Updates cosmos#14753 (Simulator rewrite epic)
 Updates cosmos#7622 (reducing imports from modules to simulator)
 Updates cosmos#13843 (using real message delivery for simulation)
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: 6

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 89296cc and dc967dd.
Files selected for processing (20)
  • simapp/app.go (3 hunks)
  • simapp/app_v2.go (2 hunks)
  • simapp/testutil_network_test.go (2 hunks)
  • tests/integration/bank/keeper/deterministic_test.go (2 hunks)
  • tests/integration/distribution/keeper/msg_server_test.go (2 hunks)
  • tests/integration/evidence/keeper/infraction_test.go (2 hunks)
  • tests/integration/example/example_test.go (3 hunks)
  • tests/integration/gov/keeper/keeper_test.go (2 hunks)
  • tests/integration/staking/keeper/common_test.go (2 hunks)
  • tests/integration/staking/keeper/deterministic_test.go (2 hunks)
  • testutil/network/network.go (3 hunks)
  • x/auth/module.go (6 hunks)
  • x/auth/simulation/genesis.go (2 hunks)
  • x/auth/simulation/proposals.go (1 hunks)
  • x/bank/module.go (2 hunks)
  • x/bank/simulation/genesis.go (2 hunks)
  • x/bank/simulation/operations.go (3 hunks)
  • x/gov/module.go (2 hunks)
  • x/gov/simulation/genesis.go (2 hunks)
  • x/gov/simulation/operations.go (3 hunks)
Files skipped from review due to trivial changes (4)
  • simapp/app.go
  • tests/integration/bank/keeper/deterministic_test.go
  • tests/integration/example/example_test.go
  • tests/integration/staking/keeper/common_test.go
Additional comments: 43
tests/integration/gov/keeper/keeper_test.go (1)
  • 120-126: Ensure that all calls to auth.NewAppModule, bank.NewAppModule, staking.NewAppModule, and gov.NewAppModule throughout the codebase have been updated to match the new function signatures.
tests/integration/evidence/keeper/infraction_test.go (1)
  • 129-135: The auth.NewAppModule function call no longer includes authsims.RandomGenesisAccounts as an argument. Ensure that this change does not affect the functionality of the authModule and that all necessary adjustments have been made in the codebase.
x/bank/simulation/genesis.go (2)
  • 56-85: The changes in this hunk are well done. The function signatures have been updated to accept the necessary parameters directly, instead of relying on a simState object. This improves the modularity and testability of the functions. The removal of the print statement also cleans up the code.

  • 60-70: The suggestion to use make with a capacity hint from len(accs) was declined in a previous review. The reasoning was that genesis generation is called once per genesis, so the performance improvement would be negligible. This reasoning is sound, and the current implementation is acceptable.

x/bank/module.go (2)
  • 164-168: The GenerateGenesisState function now calls simulation.RandomizedGenState with specific parameters. Ensure that the parameters passed are correct and that the function behaves as expected.

  • 181-183: The WeightedOperations function now returns nil instead of calling simulation.WeightedOperations. This change might affect the behavior of the function. Ensure that this change is intentional and does not cause any issues.

simapp/app_v2.go (1)
  • 231-237: The creation of a simulation manager with specific module overrides has been replaced with a new simulation manager created from app modules. This change seems to be in line with the goal of reducing module dependencies on the simulation package. However, ensure that all necessary modules are included in app.ModuleManager.Modules.
- app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, nil)
+ app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, <necessary modules>)
x/auth/simulation/proposals.go (1)
  • 8-17: The function GenerateMsgUpdateParams has been updated to remove unused parameters and renamed from SimulateMsgUpdateParams. Ensure that all calls to this function throughout the codebase have been updated to match the new signature and name.
x/auth/simulation/genesis.go (2)
  • 17-51: The RandomGenesisAccounts function has been significantly modified. Ensure that all calls to this function throughout the codebase have been updated to match the new signature. Also, verify that the new logic for creating BaseAccount, ContinuousVestingAccount, and DelayedVestingAccount is correct and aligns with the intended behavior.

  • 86-101: The RandomizedGenState function has been significantly modified. Ensure that all calls to this function throughout the codebase have been updated to match the new signature. Also, verify that the new logic for generating a random GenesisState for auth is correct and aligns with the intended behavior.

x/gov/module.go (4)
  • 322-327: The RandomizedGenState function now takes four parameters instead of one. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.

  • 330-332: The ProposalContents function now returns nil instead of calling simulation.ProposalContents(). This change might affect the simulation of governance proposals. Ensure that this change is intentional and does not affect the expected behavior.

  • 334-337: The ProposalMsgs function now returns nil instead of calling simulation.ProposalMsgs(). This change might affect the simulation of governance proposals. Ensure that this change is intentional and does not affect the expected behavior.

  • 344-347: The WeightedOperations function now returns nil instead of calling simulation.WeightedOperations(). This change might affect the simulation of governance proposals. Ensure that this change is intentional and does not affect the expected behavior.

tests/integration/distribution/keeper/msg_server_test.go (2)
  • 15-20: The import of the package "cosmossdk.io/x/auth/simulation" has been removed. Ensure that this does not affect any other parts of the code that might be using it.

  • 117-120: The initialization of the authModule in the initFixture function has been updated to use the auth.NewAppModule function without the authsims.RandomGenesisAccounts argument. Make sure that this change is reflected wherever initFixture is used.

simapp/testutil_network_test.go (4)
  • 40-40: The hardcoded seed for the random number generator is still being used. This is fine for testing purposes as it ensures predictability and repeatability of tests. However, consider allowing the seed to be passed in for more varied testing in the future.

  • 55-55: The number of validators is randomly generated with a maximum of 10. This is fine for testing purposes, but consider allowing this number to be programmatically passed in for more varied testing in the future.

  • 64-66: Error handling is done correctly here. If an error occurs while generating a new mnemonic, the test fails immediately.

  • 152-176: The simulation loop generates and broadcasts transactions, and handles future votes. Error handling is done correctly. If an error occurs while encoding a transaction or broadcasting it, the test fails immediately.

x/gov/simulation/genesis.go (5)
  • 2-7: Imports are well organized and follow the standard Go conventions.

  • 17-21: The constants are well defined and documented.

  • 81-108: The RandomizedGenState function has been significantly refactored. It now uses the rand.Rand instance for random number generation and takes additional parameters for genState, cdc, and bondDenom. The function no longer relies on the module.SimulationState for random number generation and parameter retrieval. The function also no longer prints the randomly generated governance parameters to the console. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.

  • 102-105: The v1.NewGenesisState function is called with the correct parameters. The parameters are well defined and the function call is correct.

  • 107-107: The govGenesis is correctly marshaled into JSON and stored in the genState map.

testutil/network/network.go (3)
  • 19-19: The new import github.com/cometbft/cometbft/config is used for the FuzzConnConfig type. Ensure that this package is maintained and reliable.

  • 136-136: The new field FuzzConnConfig is added to the Config struct. This field is used to conditionally set TestFuzz and TestFuzzConfig in cmtCfg.P2P.

  • 346-349: The New function is modified to conditionally set TestFuzz and TestFuzzConfig in cmtCfg.P2P based on the presence of FuzzConnConfig in the input cfg. This change is consistent with the PR's goal of improving simulation fidelity.

x/bank/simulation/operations.go (1)
  • 16-19: The constant DistributionModuleName is defined but not used anywhere in the code. If it's not needed, consider removing it to avoid confusion.
x/auth/module.go (6)
  • 93-97: The randGenAccountsFn field has been removed from the AppModule struct. Ensure that this does not break any dependencies that might be using this field.

  • 106-111: The NewAppModule function no longer accepts the randGenAccountsFn parameter. Make sure all calls to this function have been updated accordingly.

  • 157-159: The GenerateGenesisState function now uses a different method signature for simulation.RandomizedGenState. Verify that the new parameters are correctly passed and handled.

  • 190-195: The RandomGenesisAccountsFn field has been removed from the ModuleInputs struct. Ensure that this does not break any dependencies that might be using this field.

  • 213-218: The ProvideModule function has been updated to remove the logic for handling the RandomGenesisAccountsFn field. Make sure this change is consistent with the overall design and does not introduce any issues.

  • 223-229: The ProvideModule function has been updated to remove the logic for handling the RandomGenesisAccountsFn field. Make sure this change is consistent with the overall design and does not introduce any issues.

x/gov/simulation/operations.go (7)
  • 10-15: > Note: This review was outside of the patch, but no patch was found that overlapped with it. Original lines [19-15]

The import paths have been updated to reflect the new location of the packages. Ensure that the new paths are correct and the packages exist at those locations.

  • 22-59: The GenerateMsgSubmitProposal function has been updated to include a new expedited variable which is used to determine the type of deposit. Ensure that this change is consistent with the rest of the codebase and that all calls to this function have been updated accordingly.

  • 73-268: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [61-126]

A new VoteGenerator type has been introduced along with associated methods for generating votes. This is a significant change and should be thoroughly tested to ensure it works as expected.

  • 128-161: The GenerateMsgDeposit function has been updated to include a new expedited variable which is used to determine the type of deposit. Ensure that this change is consistent with the rest of the codebase and that all calls to this function have been updated accordingly.

  • 163-202: The GenerateMsgVote function has been updated to include a new proposalIDInt variable which is used to determine the proposal ID. Ensure that this change is consistent with the rest of the codebase and that all calls to this function have been updated accordingly.

  • 204-234: The GenerateMsgVoteWeighted function has been introduced. This is a significant change and should be thoroughly tested to ensure it works as expected.

  • 236-266: The GenerateMsgCancelProposal function has been introduced. This is a significant change and should be thoroughly tested to ensure it works as expected.

tests/integration/staking/keeper/deterministic_test.go (1)
  • 110-110: The auth.NewAppModule function call has been updated to exclude the authsims.RandomGenesisAccounts argument. Ensure that this change does not affect the functionality of the authModule and that all dependencies are correctly handled.

@@ -405,7 +404,7 @@ func NewSimApp(
txConfig,
),
accounts.NewAppModule(app.AccountsKeeper),
auth.NewAppModule(appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts),
Copy link
Member

Choose a reason for hiding this comment

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

does this break existing simulator from running?

@tac0turtle
Copy link
Member

i think we may need to revert the removal of things in modules as we want the current simulator to still run, I believe there is still some work we need to do to make it sufficient to replace things. I can take ownership of this and push it over the finish line

@elias-orijtech
Copy link
Contributor Author

elias-orijtech commented Nov 15, 2023

i think we may need to revert the removal of things in modules as we want the current simulator to still run, I believe there is still some work we need to do to make it sufficient to replace things. I can take ownership of this and push it over the finish line

Thank you very much. Another option is to leave this PR in draft and start working on a deterministic testutil/network based on your conversion to interfaces and integration of MockComet.

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 dc967dd and 7187ea9.
Files selected for processing (3)
  • simapp/app.go (3 hunks)
  • tests/integration/distribution/keeper/msg_server_test.go (2 hunks)
  • testutil/network/network.go (3 hunks)
Additional comments: 6
simapp/app.go (3)
  • 29-34: The removal of the import cosmossdk.io/x/auth/simulation is not visible within the provided hunk. It's important to ensure that this import is no longer used within the file and that any associated functionality has been refactored or removed accordingly.

  • 412-418: The call to auth.NewAppModule does not show the removal of the authsims.RandomGenesisAccounts argument within the provided hunk. It's important to ensure that the call has been updated as per the PR objectives and that any necessary adjustments have been made to accommodate this change.

  • 509-515: The addition of the simulation manager and the registration of store decoders are consistent with the PR objectives of implementing a new simulator that runs on top of testutil/network. This change should help in achieving the goal of making simulations more realistic and deterministic.

testutil/network/network.go (3)
  • 19-19: The import of cmtcfg is correctly added to support the new FuzzConnConfig field in the Config struct.

  • 345-348: The conditional logic to set cmtCfg.P2P.TestFuzz and cmtCfg.P2P.TestFuzzConfig based on the presence of FuzzConnConfig is correctly implemented.

  • 132-137: The addition of FuzzConnConfig to the Config struct is consistent with the PR's objectives to improve the realism and determinism of simulations by allowing network fuzzing configurations.

@@ -131,6 +132,8 @@ type Config struct {
AddressCodec address.Codec // address codec
ValidatorAddressCodec runtime.ValidatorAddressCodec // validator address codec
ConsensusAddressCodec runtime.ConsensusAddressCodec // consensus address codec

FuzzConnConfig *cmtcfg.FuzzConnConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

The new field FuzzConnConfig has been added to the Config struct. Ensure that this field is properly documented to explain its purpose and usage within the network configuration.

@tac0turtle
Copy link
Member

hmm i cant get this test to fail locally, @elias-orijtech are you able to do it locally?

@elias-orijtech
Copy link
Contributor Author

Sorry for dropping this ball. Do you mean the failing simapp v1 test? If so, did you test with the app_v1 tag?

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Feb 16, 2024
@tac0turtle tac0turtle removed the Stale label Feb 16, 2024
@tac0turtle tac0turtle marked this pull request as draft February 26, 2024 15:26
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Apr 28, 2024
@github-actions github-actions bot closed this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor simulation packages & subpackages to reduce frequency of import cycles
7 participants