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

fix: Sync with upstream #7

Closed

Conversation

mantrachain-support
Copy link

@mantrachain-support mantrachain-support commented Sep 20, 2024

Description

Closes: #XXXX


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

    • Introduced CLI commands: module-hash-by-height for querying module hashes and bulk-add-genesis-account for adding multiple genesis accounts.
    • Added LegacyDec collection value for enhanced data handling.
  • Improvements

    • Enhanced MsgMultiSend event with a Sender attribute.
    • Improved error messages for genesis validation.
    • Updated NewIntegrationApp to accept additional baseapp options.
  • Bug Fixes

    • Corrected the ordering of baseapp options and fixed issues with the GetSigners function.
    • Resolved a regression affecting upgrades beyond v0.50.7.
  • Documentation

    • Updated changelog and release notes to reflect version v0.50.10.

Copy link

coderabbitai bot commented Sep 20, 2024

Walkthrough

The changes introduce version v0.50.10 of the Cosmos SDK, released on September 20, 2024. Key updates include new CLI commands for querying module hashes and bulk adding genesis accounts, enhancements to event attributes and error messages, and several bug fixes across various modules. Additionally, the NewIntegrationApp function has been updated to accept baseapp options, improving integration testing capabilities.

Changes

File Change Summary
CHANGELOG.md Introduced version v0.50.10 with new features, improvements, and bug fixes.
RELEASE_NOTES.md Updated release notes for v0.50.10, highlighting new commands and fixes.
testutil/integration/router.go Updated NewIntegrationApp to accept multiple baseAppOptions.
types/collections.go Introduced LegacyDec collection value for enhanced type handling.
runtime/... Fixed ordering of baseapp options to prevent overwriting and corrected GetSigners function length.
x/consensus/... Resolved regression affecting upgrades beyond v0.50.7 due to consensus parameters.
baseapp/... Reverted halt height behavior to original functionality for block commitment.
client/v2/... Various updates related to marshaling improvements and dependency versions.
go.mod, simapp/... Updated versions for multiple dependencies.

Poem

In the garden where code hops and plays,
New features bloom on this bright sunny day.
With hashes and accounts, we leap with delight,
Bugs fixed, paths clear, everything feels right!
So here’s to the changes, let’s give them a cheer,
For a sprightly new version, we hold so dear! 🐇✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 043cea3 and 6dc6e8b.

Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

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

@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: 4

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8529343 and 043cea3.

Files ignored due to path filters (4)
  • client/v2/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • simapp/go.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
Files selected for processing (18)
  • CHANGELOG.md (1 hunks)
  • RELEASE_NOTES.md (2 hunks)
  • client/v2/CHANGELOG.md (1 hunks)
  • client/v2/autocli/query.go (1 hunks)
  • client/v2/go.mod (1 hunks)
  • go.mod (2 hunks)
  • runtime/builder.go (1 hunks)
  • simapp/app_config.go (1 hunks)
  • simapp/app_di.go (5 hunks)
  • simapp/go.mod (2 hunks)
  • tests/go.mod (3 hunks)
  • testutil/integration/router.go (2 hunks)
  • types/collections.go (2 hunks)
  • x/circuit/autocli.go (3 hunks)
  • x/tx/CHANGELOG.md (1 hunks)
  • x/tx/signing/aminojson/json_marshal.go (4 hunks)
  • x/tx/signing/aminojson/json_marshal_test.go (1 hunks)
  • x/tx/signing/aminojson/options.go (1 hunks)
Additional context used
LanguageTool
x/tx/CHANGELOG.md

[uncategorized] ~40-~40: You might be missing the article “the” here.
Context: ...712) Add AminoNameAsTypeURL option to Amino JSON encoder. ## [v0.13.4](https://git...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

Additional comments not posted (37)
RELEASE_NOTES.md (3)

1-1: LGTM!

The version number has been correctly updated to v0.50.10, which aligns with the PR objective of synchronizing with upstream changes.


11-13: Significant improvements!

The changes in this segment bring notable enhancements:

  1. The new module-hash-by-height command enables querying and retrieving module hashes at specific heights, which is a valuable addition for developers and users.

  2. Fixing the emission of PreBlock events, particularly for the x/upgrade module, ensures correct behavior and aligns with expected functionality.

  3. Addressing the issue with runtime baseapp option ordering when other modules have options is a crucial fix that prevents potential problems.

These improvements contribute to a more robust and reliable SDK.


17-17: Accurate changelog reference!

The changelog link has been properly updated to point to the v0.50.10 changelog. This ensures that users and developers have access to the correct and up-to-date information about the changes in this release.

runtime/builder.go (1)

32-41: LGTM!

The changes in this code segment are well-structured and improve the initialization process of the BaseApp instance. By setting the message service and gRPC query routers as part of the baseAppOptions, the code ensures that the routers are configured before the BaseApp is created. This is a cleaner approach compared to the previous implementation where the routers were set directly after the BaseApp instantiation.

The removal of the previous direct calls to set the routers is consistent with the new approach and improves code organization. The changes do not introduce any breaking changes or compatibility issues.

Overall, the code segment follows the existing coding style and conventions, and the changes enhance the readability and maintainability of the codebase.

x/circuit/autocli.go (3)

46-46: LGTM!

The change to add leading slashes to the limit_type_urls JSON array elements in the authorize command example is consistent with the modifications made to the other command examples. The change looks good.


56-56: LGTM!

The change to add leading slashes to the message type URLs in the disable command example is consistent with the modifications made to the other command examples. The change looks good.


65-65: LGTM!

The change to add leading slashes to the message type URLs in the reset command example is consistent with the modifications made to the other command examples. The change looks good.

x/tx/CHANGELOG.md (1)

36-40: LGTM!

The changelog entry for v0.13.5 is correctly formatted and accurately reflects the improvement made in #21712. The categorization under "Improvements" is appropriate, and the pull request reference is correctly linked.

Note: The static analysis hint suggesting to add the article "the" before "Amino JSON encoder" is a false positive and can be ignored, as the sentence reads correctly without it.

Tools
LanguageTool

[uncategorized] ~40-~40: You might be missing the article “the” here.
Context: ...712) Add AminoNameAsTypeURL option to Amino JSON encoder. ## [v0.13.4](https://git...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

client/v2/CHANGELOG.md (1)

39-43: LGTM!

The changelog entry for version v2.0.0-beta.5 is well-formatted and follows the guiding principles. The improvement is clearly described with enough context, and the pull request reference is correctly linked.

x/tx/signing/aminojson/options.go (2)

35-36: LGTM!

The changes to getMessageAminoNameAny improve the consistency and usability of the function by always returning a string, either the amino name or the message URL, instead of a boolean indicating failure.


Line range hint 38-51: LGTM!

The new getMessageTypeURL function provides a consistent way to retrieve the message URL, using a series of fallbacks to handle various types of messages. The logic is sound and the fallbacks are reasonable.

client/v2/autocli/query.go (1)

121-126: Verify the impact of the AminoNameAsTypeURL field on message serialization.

The addition of the AminoNameAsTypeURL field to the encoderOptions struct is a valid change that enhances the configuration options for the encoder. However, it's important to ensure that this change is intentional and aligns with the desired encoding behavior.

To verify the impact of the AminoNameAsTypeURL field on message serialization, consider the following:

  1. Review the documentation or specifications related to the AminoNameAsTypeURL field to understand its purpose and expected behavior.

  2. Analyze how the AminoNameAsTypeURL field is used within the encoding process. Trace its usage and identify any potential side effects or changes in the serialized output.

  3. Run the following script to search for relevant test cases that cover the serialization logic affected by the AminoNameAsTypeURL field:

  4. Execute the identified test cases and carefully review the test results to ensure that the serialization behavior aligns with the expected outcomes.

  5. If necessary, consider adding new test cases to comprehensively validate the impact of the AminoNameAsTypeURL field on message serialization across different scenarios.

By thoroughly verifying the impact of this change, you can ensure that the addition of the AminoNameAsTypeURL field does not introduce any unintended consequences and maintains the desired encoding behavior.

Verification successful

These scripts will help us gather more comprehensive information about the AminoNameAsTypeURL field, its usage, and potential impact on serialization. Once we have this information, we can make a more informed decision about the verification process.


Verified: AminoNameAsTypeURL field impacts Amino JSON encoding as intended

The AminoNameAsTypeURL field is correctly used in the BuildQueryMethodCommand function. Its purpose, as documented in x/tx/signing/aminojson/json_marshal.go, is to "use the amino name as the type URL in the JSON output" when set to true. This aligns with the change in query.go.

Impact on message serialization:

  1. When set to true, it modifies how type URLs are represented in the JSON output of Amino-encoded messages.
  2. This change affects the structure of the serialized JSON, potentially impacting how clients parse and interpret the output.

Recommendations:

  1. Review the existing test case TestAminoNameAsTypeURL in json_marshal_test.go to ensure it adequately covers this functionality in the context of query commands.
  2. Add a comment in client/v2/autocli/query.go explaining why AminoNameAsTypeURL is set to true for query commands, to improve code clarity.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for test cases related to message serialization using the `AminoNameAsTypeURL` field.

# Test: Search for test functions that invoke the `BuildQueryMethodCommand` function. 
# Expect: Relevant test cases that cover the serialization logic.
rg --type go -A 10 $'func Test.*BuildQueryMethodCommand'

Length of output: 57


Script:

#!/bin/bash
# Description: Search for usage and information about AminoNameAsTypeURL

# Search for usage of AminoNameAsTypeURL across the codebase
echo "Usage of AminoNameAsTypeURL:"
rg "AminoNameAsTypeURL" --type go

# Look for documentation or comments mentioning AminoNameAsTypeURL
echo -e "\nDocumentation or comments for AminoNameAsTypeURL:"
rg "AminoNameAsTypeURL" --type go -C 3 | rg "//|/\*|\*/"

# Search for encoder options or serialization-related tests
echo -e "\nEncoder options or serialization-related tests:"
rg "func Test.*Encoder|func Test.*Serializ|func Test.*Marshal" --type go

# Find the definition of the struct or interface containing AminoNameAsTypeURL
echo -e "\nStruct or interface definition containing AminoNameAsTypeURL:"
ast-grep --lang go --pattern $'(struct|interface) $_ {
  $$$
  AminoNameAsTypeURL $_
  $$$
}'

Length of output: 4801

client/v2/go.mod (1)

10-10: Dependency version update looks good.

Updating the cosmossdk.io/x/tx module to v0.13.5 is a reasonable change to get the latest features and fixes.

Please ensure that:

  1. The codebase is compatible with the new version of the module.
  2. All unit and integration tests are passing after updating the dependency.

You can run the following commands to verify:

types/collections.go (3)

35-37: LGTM!

The variable declaration follows the established pattern and is consistent with the rest of the code.


45-48: LGTM!

The constant declaration is valid and consistent with the usage of the math.LegacyDec type.


176-210: LGTM!

The legacyDecValueCodec type correctly implements the collcodec.ValueCodec interface for the math.LegacyDec type. The implementation is consistent with the existing code patterns and follows the expected behavior for encoding, decoding, and stringifying the values.

go.mod (2)

13-14: LGTM!

The minor version updates for cosmossdk.io/store and cosmossdk.io/x/tx modules are consistent with semantic versioning and should be backwards compatible.


84-84: LGTM!

The minor version update for the indirect dependency github.com/cosmos/iavl is consistent with semantic versioning and should be backwards compatible.

tests/go.mod (4)

13-13: LGTM!

The minor version update to cosmossdk.io/store from v1.1.0 to v1.1.1 looks good.


17-17: LGTM!

The patch version update to cosmossdk.io/x/tx from v0.13.4 to v0.13.5 looks good.


39-39: Verify the compatibility and stability of the pre-release version update.

The version of cosmossdk.io/client/v2 has been updated to a pre-release version v2.0.0-beta.4.0.20240918122632-1879050ca719, which includes a specific commit hash.

Please ensure that this pre-release version is compatible with the current project and has been thoroughly tested for stability and potential breaking changes.


68-68: LGTM!

The minor version update to github.com/cosmos/iavl from v1.1.2 to v1.2.0 looks good.

simapp/go.mod (4)

7-7: Ensure the specific commit has been properly validated.

The version update to include a specific commit hash can help with reproducibility and stability. However, please ensure this commit (1879050ca719) has been thoroughly tested and validated before merging.


13-13: Review the changelog for any notable changes.

The minor version update to cosmossdk.io/store suggests there may be new features or bug fixes. Please review the changelog for this version and ensure there are no breaking changes or issues that could affect the current codebase.


19-19: Quickly scan the changelog for relevant fixes or changes.

The patch version update to cosmossdk.io/x/tx likely contains bug fixes or minor improvements. While patch updates are generally safe, it's still good to quickly review the changelog for any changes that are particularly relevant to the codebase.


68-68: Carefully review the changelog and thoroughly test the new version.

The update to github.com/cosmos/iavl from v1.1.2 to v1.2.0 is a significant version bump that likely includes substantial changes or new features. Please do the following:

  1. Carefully review the entire changelog for this version, noting any breaking changes or updates that could impact our codebase.

  2. Thoroughly test the integration of this new version to ensure compatibility and catch any issues early.

  3. Consider noting any major changes from the changelog in the PR description.

x/tx/signing/aminojson/json_marshal_test.go (1)

359-416: LGTM!

The TestAminoNameAsTypeURL function provides good test coverage for the AminoNameAsTypeURL option. It verifies that the marshaled output includes the type URL and the expected fields, with default values omitted. The test also checks for any errors during the marshaling process.

Adding this test helps ensure the correctness of the marshaling behavior when the AminoNameAsTypeURL option is enabled.

x/tx/signing/aminojson/json_marshal.go (4)

35-38: LGTM!

The new AminoNameAsTypeURL field in the EncoderOptions struct is a valid addition. It provides more flexibility to the encoder by allowing it to use the type URL instead of the amino name in the JSON output. The field is well-documented with clear comments explaining its purpose and usage.


57-57: LGTM!

The new aminoNameAsTypeURL field in the Encoder struct is a valid addition. It corresponds to the AminoNameAsTypeURL field in the EncoderOptions struct and is used to store the value of the AminoNameAsTypeURL option in the Encoder instance.


88-93: LGTM!

The changes to the NewEncoder function are valid. The aminoNameAsTypeURL field in the Encoder struct is correctly initialized with the value from the AminoNameAsTypeURL field in the EncoderOptions struct. This ensures that the Encoder instance is properly configured with the provided options.


196-206: LGTM!

The changes to the beginMarshal method are valid. The method now conditionally uses the type URL instead of the amino name when marshaling messages, based on the aminoNameAsTypeURL flag. The logic correctly handles the conditional usage of the type URL for both cases where the message is of type Any and when it is not. The changes ensure that the encoder uses the type URL when specified, while still maintaining the correct behavior for the named variable. The changes are well-structured and easy to understand.

CHANGELOG.md (2)

41-42: LGTM!

The new version and release date look good. The format is consistent with the existing changelog entries.


47-53: Looks great!

The changelog entries are well categorized and the descriptions are clear and concise. Referencing the PR numbers is very helpful.

simapp/app_di.go (4)

32-32: Import added for custom ante handler implementation

The addition of github.com/cosmos/cosmos-sdk/x/auth/ante is necessary for implementing the custom ante handler in the setAnteHandler method.


85-85: Renaming to CircuitKeeper improves clarity

Renaming CircuitBreakerKeeper to CircuitKeeper in the SimApp struct enhances readability and aligns with naming conventions.


186-186: Injecting CircuitKeeper into dependency injection

Including &app.CircuitKeeper in the dependency injection ensures that the CircuitKeeper is properly initialized and available throughout the application.


252-254: Setting custom ante handler during initialization

Calling app.setAnteHandler(app.txConfig) within NewSimApp correctly initializes the custom ante handler during application setup.

Comment on lines +205 to +208
Name: "tx",
Config: appconfig.WrapAny(&txconfigv1.Config{
SkipAnteHandler: true, // Enable this to skip the default antehandlers and set custom ante handlers.
}),
Copy link

Choose a reason for hiding this comment

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

Skipping default ante handlers and using custom ones

The change allows the application to skip the default ante handlers and set custom ones by configuring SkipAnteHandler: true in the "tx" module. This provides flexibility to implement custom transaction processing logic.

However, it's crucial to ensure that the custom ante handlers perform the necessary checks and validations to maintain the integrity and security of transactions. Please verify that the custom ante handlers are correctly implemented and tested.

Also, consider the impact of this change on other parts of the application that may rely on the default ante handler behavior. Ensure that the custom ante handlers are properly integrated with the rest of the application.

Lastly, document the custom ante handler logic thoroughly, including the checks performed and any assumptions made.

Comment on lines +273 to +295
// setAnteHandler sets custom ante handlers.
// "x/auth/tx" pre-defined ante handler have been disabled in app_config.
func (app *SimApp) setAnteHandler(txConfig client.TxConfig) {
anteHandler, err := NewAnteHandler(
HandlerOptions{
ante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
SignModeHandler: txConfig.SignModeHandler(),
FeegrantKeeper: app.FeeGrantKeeper,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
},
&app.CircuitKeeper,
},
)
if err != nil {
panic(err)
}

// Set the AnteHandler for the app
app.SetAnteHandler(anteHandler)
}

Copy link

Choose a reason for hiding this comment

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

Ensure HandlerOptions struct includes CircuitKeeper

In the setAnteHandler method, the HandlerOptions struct is used to pass options to NewAnteHandler. Ensure that HandlerOptions is properly defined to include both ante.HandlerOptions and the CircuitKeeper.

If HandlerOptions is not already defined, you may need to define it as follows:

type HandlerOptions struct {
    ante.HandlerOptions
    CircuitKeeper *circuitkeeper.Keeper
}

This ensures that NewAnteHandler receives all necessary options for the custom ante handler.

@@ -56,7 +57,7 @@ func NewIntegrationApp(
basicModuleManager.RegisterInterfaces(interfaceRegistry)

txConfig := authtx.NewTxConfig(codec.NewProtoCodec(interfaceRegistry), authtx.DefaultSignModes)
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName))
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), append(baseAppOptions, baseapp.SetChainID(appName))...)
Copy link

Choose a reason for hiding this comment

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

Order of Options May Override User-Provided Chain ID

In the call to NewBaseApp, you're appending baseAppOptions before baseapp.SetChainID(appName). This means that baseapp.SetChainID(appName) will override any SetChainID options provided in baseAppOptions. If you want to allow baseAppOptions to override the default chain ID, consider placing baseapp.SetChainID(appName) before baseAppOptions.

Apply this diff to adjust the order of options:

-bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), append(baseAppOptions, baseapp.SetChainID(appName))...)
+bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), append([]func(*baseapp.BaseApp){baseapp.SetChainID(appName)}, baseAppOptions...)...)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), append(baseAppOptions, baseapp.SetChainID(appName))...)
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), append([]func(*baseapp.BaseApp){baseapp.SetChainID(appName)}, baseAppOptions...)...)

@@ -47,6 +47,7 @@
keys map[string]*storetypes.KVStoreKey,
appCodec codec.Codec,
modules map[string]appmodule.AppModule,
baseAppOptions ...func(*baseapp.BaseApp),
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Based on the analysis of the NewIntegrationApp function calls across various test files, we can conclude that there is an issue that needs to be addressed.

Update Required: NewIntegrationApp Function Calls

The NewIntegrationApp function has been updated to include a new parameter baseAppOptions ...func(*baseapp.BaseApp), but this change has not been reflected in the existing function calls throughout the test files. This inconsistency needs to be addressed to ensure proper functionality and prevent potential compilation errors. The following files contain calls to NewIntegrationApp that need to be updated:

  • testutil/integration/example_test.go
  • tests/integration/slashing/keeper/keeper_test.go
  • tests/integration/staking/keeper/determinstic_test.go
  • tests/integration/staking/keeper/common_test.go
  • tests/integration/bank/keeper/deterministic_test.go
  • tests/integration/gov/keeper/keeper_test.go
  • tests/integration/evidence/keeper/infraction_test.go
  • tests/integration/distribution/keeper/msg_server_test.go

Please update all calls to NewIntegrationApp in these files to include the new baseAppOptions parameter. If no specific options are needed, you can pass an empty variadic parameter (e.g., NewIntegrationApp(..., nil)).

Analysis chain

Potential Breaking Change: Update Function Calls to Match New Signature

The function NewIntegrationApp now includes a variadic parameter baseAppOptions ...func(*baseapp.BaseApp) in its signature. Since this function is exported, any existing code that calls NewIntegrationApp without the new parameter will fail. Please ensure that all calls to this function have been updated to match the new signature.

Run the following script to identify calls to NewIntegrationApp that may need to be updated:


To gather more comprehensive information about the NewIntegrationApp function calls, we need to modify our search approach. Let's use a script that provides more context for each instance.

This script will show us 10 lines of context before and after each NewIntegrationApp call, which should be sufficient to see the entire function call in most cases.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all usages of NewIntegrationApp to verify they match the new signature.

# Test: Search for calls to NewIntegrationApp. Expect: All calls include the new parameter.
rg --type go 'NewIntegrationApp\(' --glob='!testutil/integration/router.go' -A 2

Length of output: 2833


Script:

#!/bin/bash
# Description: Find all usages of NewIntegrationApp with extended context to verify they match the new signature.

# Test: Search for calls to NewIntegrationApp with 10 lines of context before and after. Expect: Full function calls visible.
rg --type go 'NewIntegrationApp\(' --glob='!testutil/integration/router.go' -C 10

Length of output: 17601

@mantrachain-support mantrachain-support changed the title Sync with upstream fix: Sync with upstream Sep 20, 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.

3 participants