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

test: add simulation tests #2947

Merged
merged 23 commits into from
Oct 22, 2024
Merged

test: add simulation tests #2947

merged 23 commits into from
Oct 22, 2024

Conversation

kingpinXD
Copy link
Contributor

@kingpinXD kingpinXD commented Oct 1, 2024

Description

Add simulation tests to the node repository
Use the following commands to run

make test-sim-nondeterminism
make test-sim-fullappsimulation

Closes : #2960

The simulation tests would be added into the the CI as part of this issue : #2960

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

Release Notes

  • New Features

    • Introduced a new module management system for enhanced modularity within the application.
    • Added support for simulation tests, including various test targets for different simulation scenarios.
  • Bug Fixes

    • Resolved issues with voting mechanisms and transaction processing on EVM chains.
  • Documentation

    • Updated changelog to reflect new features, refactors, and improvements across multiple versions.
  • Chores

    • Added a new Makefile to facilitate simulation test execution.
  • Tests

    • Implemented a comprehensive testing suite for application simulations, focusing on determinism and state export functionality.

Copy link
Contributor

coderabbitai bot commented Oct 1, 2024

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
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces significant changes to the application structure, focusing on modularity and simulation capabilities. Key modifications include the addition of a ModuleBasics field in the App struct and the introduction of a new file, modules.go, which centralizes module management. The changelog reflects updates across multiple versions, including new features, refactors, and fixes. Additionally, several new files are created to enhance simulation testing, while some files are removed to streamline the codebase.

Changes

File Path Change Summary
app/app.go Added fields: ModuleBasics and sm to App struct; updated RegisterGRPCGatewayRoutes.
app/modules.go Introduced functions: newBasicManagerFromManager and simulationModules for module management.
changelog.md Updated to reflect new features, refactors, and fixes; detailed changes across multiple versions.
e2e/runner/admin_evm.go Streamlined logging by replacing fmt.Sprintf with direct string interpolation.
e2e/runner/report.go Updated PrintTestReports method for formatted printing of test reports.
sims.mk New Makefile created for simulation tests with various targets defined.
tests/simulation/sim/sim_config.go Introduced flags for simulation parameters and functions for configuration management.
tests/simulation/sim/sim_state.go Added functions for generating application states based on genesis or simulation parameters.
tests/simulation/sim/sim_utils.go Added utility functions for initializing the simulation application and printing stats.
tests/simulation/sim_test.go Established testing suite for application simulations, including determinism and state export tests.
testutil/simapp/default_constants.go Removed variable defaultConsensusParams.
testutil/simapp/simapp.go Removed utility functions for setting up simulation application environment.

Suggested labels

ci, no-changelog, UPGRADE_TESTS, PERFORMANCE_TESTS

Suggested reviewers

  • fbac
  • skosito
  • lumtis
  • brewmaster012
  • swift1337
  • ws4charlie

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:

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

Copy link

codecov bot commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 27.89969% with 230 lines in your changes missing coverage. Please review.

Project coverage is 64.06%. Comparing base (3aa68fe) to head (1f744f8).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
tests/simulation/sim/sim_state.go 0.00% 189 Missing ⚠️
tests/simulation/sim/sim_utils.go 0.00% 41 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2947      +/-   ##
===========================================
- Coverage    64.47%   64.06%   -0.41%     
===========================================
  Files          409      412       +3     
  Lines        28641    28960     +319     
===========================================
+ Hits         18465    18554      +89     
- Misses        9381     9611     +230     
  Partials       795      795              
Files with missing lines Coverage Δ
tests/simulation/sim/sim_config.go 100.00% <100.00%> (ø)
tests/simulation/sim/sim_utils.go 0.00% <0.00%> (ø)
tests/simulation/sim/sim_state.go 0.00% <0.00%> (ø)

@kingpinXD kingpinXD marked this pull request as ready for review October 3, 2024 04:08
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.

Actionable comments posted: 24

🧹 Outside diff range and nitpick comments (12)
e2e/runner/admin_evm.go (2)

15-15: Approve logging statement change with minor suggestion.

The modification to remove fmt.Sprintf is correct and improves performance. However, for consistency with Go's log package and to potentially leverage structured logging in the future, consider using key-value pairs for logging.

Consider refactoring the logging statement as follows:

r.Logger.Info("TSS Address Update", "tx", tx.Hash().String())

This approach separates the message from the dynamic value, which can be beneficial for log parsing and consistency across the codebase.


29-29: Approve logging statement change with suggestions for improvement.

The modification to remove fmt.Sprintf is correct and improves performance. However, there are opportunities for further enhancement:

  1. For consistency with Go's log package and to potentially leverage structured logging in the future, consider using key-value pairs for logging.

  2. The UpdateTssAddressForConnector and UpdateTssAddressForErc20custody functions are very similar, suggesting an opportunity for refactoring to reduce code duplication.

  3. Consider refactoring the logging statement as follows:

r.Logger.Info("TSS ERC20 Address Update", "tx", tx.Hash().String())
  1. To reduce code duplication, consider creating a generic function for updating TSS addresses:
func (r *E2ERunner) updateTssAddress(updater func(*bind.TransactOpts, common.Address) (*types.Transaction, error), getter func(*bind.CallOpts) (common.Address, error), logMessage string) error {
    if err := r.SetTSSAddresses(); err != nil {
        return err
    }

    tx, err := updater(r.EVMAuth, r.TSSAddress)
    if err != nil {
        return err
    }

    r.Logger.Info(logMessage, "tx", tx.Hash().String())
    receipt := utils.MustWaitForTxReceipt(r.Ctx, r.EVMClient, tx, r.Logger, r.ReceiptTimeout)
    utils.RequireTxSuccessful(r, receipt)

    tssAddress, err := getter(&bind.CallOpts{Context: r.Ctx})
    if err != nil {
        return err
    }

    if tssAddress != r.TSSAddress {
        return fmt.Errorf("TSS address mismatch: expected %s, got %s", r.TSSAddress, tssAddress)
    }

    return nil
}

Then, you can simplify both UpdateTssAddressForConnector and UpdateTssAddressForErc20custody:

func (r *E2ERunner) UpdateTssAddressForConnector() {
    err := r.updateTssAddress(
        r.ConnectorEth.UpdateTssAddress,
        r.ConnectorEth.TssAddress,
        "TSS Address Update",
    )
    require.NoError(r, err)
}

func (r *E2ERunner) UpdateTssAddressForErc20custody() {
    err := r.updateTssAddress(
        r.ERC20Custody.UpdateTSSAddress,
        r.ERC20Custody.TssAddress,
        "TSS ERC20 Address Update",
    )
    require.NoError(r, err)
}

This refactoring reduces code duplication and improves maintainability.

e2e/runner/report.go (1)

62-62: Approve change with minor suggestion for robustness

The modification to use a format specifier for the table string enhances clarity and consistency in logging. This change is appropriate and aligns with best practices for string formatting in Go.

To further improve robustness, consider using the %v format specifier instead of %s. This would allow for graceful handling of potential non-string types without causing a panic.

Consider applying the following change:

-r.Logger.PrintNoPrefix("%s", table)
+r.Logger.PrintNoPrefix("%v", table)

This minor adjustment ensures that the logging remains functional even if table is unexpectedly not a string type.

tests/simulation/sim/sim_config.go (1)

9-30: Consider addressing the TODO comment and grouping related flags.

The global variables for simulation flags are well-defined. However, there are two points to consider:

  1. There's a TODO comment on line 23 suggesting the removal of FlagOnOperationValue. Consider creating an issue to track this task for future refactoring.

  2. To improve readability, consider grouping related flags together. For example, you could group all path-related flags, all boolean flags, etc.

Example of grouping:

var (
    // File path flags
    FlagGenesisFileValue        string
    FlagParamsFileValue         string
    FlagExportParamsPathValue   string
    FlagExportStatePathValue    string
    FlagExportStatsPathValue    string

    // Numeric configuration flags
    FlagExportParamsHeightValue int
    FlagSeedValue               int64
    FlagInitialBlockHeightValue int
    FlagNumBlocksValue          int
    FlagBlockSizeValue          int
    FlagGenesisTimeValue        int64

    // Boolean flags
    FlagLeanValue          bool
    FlagCommitValue        bool
    FlagOnOperationValue   bool // TODO: Remove in favor of binary search for invariant violation
    FlagAllInvariantsValue bool
    FlagEnabledValue       bool
    FlagVerboseValue       bool

    // Other flags
    FlagPeriodValue uint
)

This grouping enhances code readability and maintainability.

changelog.md (3)

Line range hint 1-39: Enhance changelog structure and consistency.

The "Unreleased" section provides a comprehensive overview of recent changes. However, consider the following improvements:

  1. Add dates to each entry to provide better context for when changes were made.
  2. Ensure consistent formatting across all entries (e.g., some entries start with asterisks, others with pull request numbers).
  3. Consider grouping similar changes together (e.g., all simulation test-related changes).

To improve consistency, consider applying the following format to all entries:

### Category (e.g., Features, Fixes, etc.)

- [#PR_NUMBER](PR_URL) - Brief description of the change (YYYY-MM-DD)

Line range hint 41-53: Enhance v12.2.4 section with additional context.

The v12.2.4 section provides a clear list of fixes. To improve it further:

  1. Add a brief summary of the version's main focus or theme.
  2. Consider adding dates to each fix for better tracking.
  3. Provide more context for each fix, explaining the impact of the change.

Consider adding a summary at the beginning of the section:

## v12.2.4 (YYYY-MM-DD)

This release focuses on improving stability and addressing critical issues in gas price calculation, transaction processing, and chain-specific optimizations.

### Fixes

- [#1638](ISSUE_URL) - Ensure external chain height always increases (YYYY-MM-DD)
  - Impact: Prevents potential synchronization issues and improves chain reliability.
...

Line range hint 1-1589: Improve overall changelog structure and content.

The changelog provides a comprehensive history of changes across multiple versions. To enhance its usefulness and readability:

  1. Add a table of contents at the beginning of the file, linking to each version.
  2. Ensure consistent formatting across all versions and categories.
  3. Consider adding a "Breaking Changes" section at the top of each version, if applicable.
  4. Provide more context for significant changes, explaining the rationale and impact.
  5. Use consistent date formatting throughout the changelog.

Consider restructuring the changelog as follows:

# Changelog

## Table of Contents

- [Unreleased](#unreleased)
- [v12.2.4](#v1224)
- [v12.1.0](#v1210)
...

## Unreleased

### Breaking Changes

...

### Features

...

### Fixes

...

## v12.2.4 (YYYY-MM-DD)

### Breaking Changes

...

### Fixes

...

This structure will improve navigation and readability, making it easier for users and developers to track changes across versions.

tests/simulation/sim_test.go (2)

75-76: Use t.Log and t.Logf instead of fmt.Println and fmt.Printf in tests

Using t.Log and t.Logf ensures that log messages are properly associated with the test's output and are only displayed when the test fails or when verbose output is requested. This enhances the readability of test results and integrates better with Go's testing framework.

Apply this diff to replace fmt.Println and fmt.Printf:

-	fmt.Println("Running tests for numSeeds: ", numSeeds, " numTimesToRunPerSeed: ", numTimesToRunPerSeed)
+	t.Log("Running tests for numSeeds: ", numSeeds, " numTimesToRunPerSeed: ", numTimesToRunPerSeed)

-	fmt.Printf(
+	t.Logf(
 		"running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n",
 		config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed,
 	)

Also applies to: 101-104


132-142: Compare byte slices directly without converting to strings

When comparing byte slices, it's more idiomatic to compare them directly rather than converting them to strings. Converting byte slices to strings can cause unexpected results if the byte slices contain invalid UTF-8 sequences. Using require.Equal with byte slices will correctly handle the comparison.

Apply this diff to compare byte slices directly:

 	require.Equal(
 		t,
-		string(appHashList[0]),
-		string(appHashList[j]),
+		appHashList[0],
+		appHashList[j],
 		"non-determinism in seed %d: %d/%d, attempt: %d/%d\n",
 		config.Seed,
 		i+1,
tests/simulation/sim/sim_state.go (2)

214-222: Replace fmt.Printf with structured logging

Using fmt.Printf for logging is not recommended in production code. Consider using a structured logging library like log or zap to provide better log management and configurability.

Refactor the code:

- fmt.Printf(
+ log.Infof(
     `Selected randomly generated parameters for simulated genesis:
 {
   stake_per_account: "%d",
   initially_bonded_validators: "%d"
 }
 `, initialStake, numInitiallyBonded,
 )

Ensure you import the appropriate logging package.


207-209: Log adjustments when numInitiallyBonded exceeds numAccs

When adjusting numInitiallyBonded to not exceed numAccs, it's helpful to log this adjustment for transparency.

Add a log statement:

 if numInitiallyBonded > numAccs {
     numInitiallyBonded = numAccs
+    log.Warnf("Adjusted numInitiallyBonded to %d as it exceeded the number of accounts", numInitiallyBonded)
 }
app/modules.go (1)

59-108: Consider modularizing the simulation modules setup for better maintainability.

The simulationModules function initializes a list of AppModuleSimulation instances in a monolithic manner. As the application grows and more modules are added, this approach can become unwieldy. Consider breaking down the initialization into smaller, dedicated functions or employing a registration pattern to enhance scalability and readability.

For example, you might refactor the code like this:

func simulationModules(
    app *App,
    appCodec codec.Codec,
    _ bool,
) []module.AppModuleSimulation {
    modules := []module.AppModuleSimulation{
        auth.NewAppModule(
            appCodec,
            app.AccountKeeper,
            authsims.RandomGenesisAccounts,
            app.GetSubspace(authtypes.ModuleName),
        ),
        // ... other modules ...
    }
    return modules
}

Then, for each module, create an initialization function or use a loop if applicable.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f9cbcfc and 73fbcf5.

📒 Files selected for processing (12)
  • app/app.go (4 hunks)
  • app/modules.go (1 hunks)
  • changelog.md (1 hunks)
  • e2e/runner/admin_evm.go (2 hunks)
  • e2e/runner/report.go (1 hunks)
  • sims.mk (1 hunks)
  • tests/simulation/sim/sim_config.go (1 hunks)
  • tests/simulation/sim/sim_state.go (1 hunks)
  • tests/simulation/sim/sim_utils.go (1 hunks)
  • tests/simulation/sim_test.go (1 hunks)
  • testutil/simapp/default_constants.go (0 hunks)
  • testutil/simapp/simapp.go (0 hunks)
💤 Files with no reviewable changes (2)
  • testutil/simapp/default_constants.go
  • testutil/simapp/simapp.go
🧰 Additional context used
📓 Path-based instructions (8)
app/app.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

app/modules.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

e2e/runner/admin_evm.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

e2e/runner/report.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

tests/simulation/sim/sim_config.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

tests/simulation/sim/sim_state.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

tests/simulation/sim/sim_utils.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

tests/simulation/sim_test.go (1)

Pattern **/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.

🔇 Additional comments (6)
sims.mk (1)

38-42: Correct usage of .PHONY declaration.

The .PHONY declaration is correctly implemented, including all the defined targets. This follows Makefile best practices and ensures that these targets are always executed, regardless of whether a file with the same name exists.

tests/simulation/sim/sim_config.go (1)

1-7: Package declaration and imports are appropriate.

The package name sim is concise and fitting for a simulation configuration package. The import statement correctly references the Cosmos SDK simulation package.

tests/simulation/sim/sim_utils.go (1)

47-47: Review the setting of MaxTxGasWanted in ante handler options

At line 47, MaxTxGasWanted is set to 0. This configuration may impact the gas consumption behavior during transaction processing.

Ensure that setting MaxTxGasWanted to 0 aligns with the simulation requirements. If unlimited gas is intended, this setting is acceptable. Otherwise, consider specifying a reasonable default value to prevent potential issues with gas calculations.

tests/simulation/sim/sim_state.go (1)

240-240: ⚠️ Potential issue

Unchecked error after JSON marshaling

After marshaling genesisState, it's good practice to check for errors before proceeding.

Ensure that the error is handled:

 appState, err := json.Marshal(genesisState)
 if err != nil {
+    return nil, nil, fmt.Errorf("failed to marshal genesis state: %w", err)
 }

Likely invalid or redundant comment.

app/app.go (1)

820-821: Proper registration of store decoders

The call to app.sm.RegisterStoreDecoders() ensures that the simulation manager has the necessary store decoders registered. Verify that all relevant modules have their store decoders implemented and registered correctly.

app/modules.go (1)

54-54: Ensure all interfaces are properly registered to prevent runtime errors.

While basicManager.RegisterInterfaces(app.interfaceRegistry) registers interfaces for the modules, it's important to verify that all necessary interfaces are included, especially after adding new modules or making changes. Missing interface registrations can lead to issues with serialization and module interactions.

Run the following script to review registered interfaces:

✅ Verification successful

All interfaces are properly registered.

The review of the RegisterInterfaces calls across the codebase confirms that basicManager.RegisterInterfaces(app.interfaceRegistry) effectively aggregates all necessary interface registrations. No omissions were detected, ensuring comprehensive interface registration and safeguarding against potential runtime errors.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: List all registered interfaces to verify completeness.

# Expected Result: All module interfaces should be registered without omissions.

rg 'RegisterInterfaces' -t go -A 3

Length of output: 10035

sims.mk Outdated Show resolved Hide resolved
sims.mk Outdated Show resolved Hide resolved
sims.mk Outdated Show resolved Hide resolved
sims.mk Outdated Show resolved Hide resolved
tests/simulation/sim/sim_config.go Outdated Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
app/modules.go Outdated Show resolved Hide resolved
app/modules.go Outdated Show resolved Hide resolved
app/modules.go Outdated Show resolved Hide resolved
@kingpinXD kingpinXD changed the title test: add simulation tests [WIP] test: add simulation tests Oct 3, 2024
Copy link
Member

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

Anyway we can add instruction how to run?
Can be added in docs/development with a link in the readme

@kingpinXD
Copy link
Contributor Author

Anyway we can add instruction how to run? Can be added in docs/development with a link in the readme

c1db4cf
I added a simple doc will add more information to it about how the tests work , and the different parameters to adjust

@kingpinXD kingpinXD requested a review from lumtis October 3, 2024 15:18
docs/development/SIMULATION_TESTING.md Outdated Show resolved Hide resolved
changelog.md Outdated Show resolved Hide resolved
sims.mk Outdated Show resolved Hide resolved
sims.mk Outdated Show resolved Hide resolved
Copy link
Member

@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 tweak staking params?

The staking hook issue was not ported on develop: #2968

I was curious if setting a unbonding time of 10 seconds could lead to catching the error in the simulation tests

tests/simulation/sim_test.go Outdated Show resolved Hide resolved
tests/simulation/sim_test.go Outdated Show resolved Hide resolved
docs/development/SIMULATION_TESTING.md Outdated Show resolved Hide resolved
app/encoding.go Show resolved Hide resolved
sims.mk Outdated Show resolved Hide resolved
sims.mk Outdated Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
@kingpinXD
Copy link
Contributor Author

Can we tweak staking params?

The staking hook issue was not ported on develop: #2968

I was curious if setting a unbonding time of 10 seconds could lead to catching the error in the simulation tests

Tried it out , I wasn't able to produce the error .
The unbond amount is randomly selected ,

		unbondAmt, err := simtypes.RandPositiveInt(r, totalBond)
		if err != nil {
			return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "invalid unbond amount"), nil, err
		}

		if unbondAmt.IsZero() {
			return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "unbond amount is zero"), nil, nil
		}

		msg := types.NewMsgUndelegate(
			delAddr, valAddr, sdk.NewCoin(k.BondDenom(ctx), unbondAmt),
		)

Which might be the reason that it is not hitting the edge case which caused the panic in our tests

@kingpinXD kingpinXD requested a review from lumtis October 14, 2024 06:31
app/app.go Outdated Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
app/modules.go Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
@lumtis lumtis added the UPGRADE_TESTS Run make start-upgrade-tests label Oct 16, 2024
Copy link
Contributor

@fbac fbac left a comment

Choose a reason for hiding this comment

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

LGTM, left some minor changes regarding formatting in a couple markdowns.

Makefile Outdated Show resolved Hide resolved
changelog.md Outdated Show resolved Hide resolved
docs/development/SIMULATION_TESTING.md Show resolved Hide resolved
kingpinXD and others added 4 commits October 22, 2024 08:46
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
Co-authored-by: Francisco de Borja Aranda Castillejo <[email protected]>
@kingpinXD kingpinXD enabled auto-merge October 22, 2024 13:35
@kingpinXD kingpinXD added this pull request to the merge queue Oct 22, 2024
Merged via the queue into develop with commit 0f8a4c2 Oct 22, 2024
33 of 35 checks passed
@kingpinXD kingpinXD deleted the debug-sim-genesis branch October 22, 2024 14:14
@coderabbitai coderabbitai bot mentioned this pull request Oct 23, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UPGRADE_TESTS Run make start-upgrade-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initialize simulation tests into the node repository
5 participants