Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add errorlint and refactor check error #6292

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hoank101
Copy link
Contributor

@hoank101 hoank101 commented May 11, 2024

Description

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against the correct branch (see CONTRIBUTING.md).
  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

Summary by CodeRabbit

  • New Features

    • Improved error message formatting in various modules for enhanced debugging and traceability.
  • Bug Fixes

    • Updated error handling in functions to utilize modern error wrapping conventions, ensuring more precise error diagnostics.
  • Documentation

    • Updated documentation to reflect changes in error message formatting.
  • Refactor

    • Standardized error handling practices across multiple components and modules for consistent error wrapping.
  • Chores

    • Enabled additional linting tools to uphold code quality and standards.

Copy link
Contributor

coderabbitai bot commented May 11, 2024

Walkthrough

Walkthrough

The updates primarily focus on improving error handling by enhancing error message formats to include the original error using the %w format specifier. This change aims to enhance error traceability and debugging. Additionally, there are adjustments in error type checking and message consistency across various modules.

Changes

File Path Change Summary
Various .go files in modules/apps and modules/core Updated error message formats to include the original error using %w.
e2e/dockerutil/dockerutil.go, e2e/testsuite/testconfig.go Error handling messages updated to use %w for improved error traceability.
docs/docs/.../03-integration.md, modules/light-clients/.../app.go Updated error message format from %s to %w in NewSimApp function.
modules/core/04-channel/keeper/upgrade.go, modules/core/04-channel/keeper/upgrade_test.go Added errors import and updated error handling using errors.As.
modules/apps/callbacks/ibc_middleware_test.go Import of errors added and switch conditions updated for error checks.
modules/light-clients/08-wasm/keeper/snapshotter.go New import for errors and updated error checking logic to use errors.Is(err, io.EOF).
.golangci.yml Added errorlint to the list of enabled linters.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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
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: 28

Out of diff range and nitpick comments (9)
docs/versioned_docs/version-v7.4.x/03-light-clients/04-wasm/03-integration.md (1)

Line range hint 14-14: Correct verb usage for "setup".

- required to setup the `08-wasm` module
+ required to set up the `08-wasm` module
docs/versioned_docs/version-v8.2.x/03-light-clients/04-wasm/03-integration.md (1)

Line range hint 14-14: Correct the verb form for clarity.

- required to setup the `08-wasm` module
+ required to set up the `08-wasm` module
docs/docs/03-light-clients/04-wasm/03-integration.md (1)

Line range hint 14-14: Correct the verb form for clarity.

- required to setup the `08-wasm` module
+ required to set up the `08-wasm` module
modules/core/04-channel/keeper/upgrade.go (2)

Line range hint 36-58: Consider replacing panic with error handling in WriteUpgradeInitChannel.

- panic(fmt.Errorf("could not find existing channel when updating channel state in successful ChanUpgradeInit step, channelID: %s, portID: %s", channelID, portID))
+ return fmt.Errorf("could not find existing channel when updating channel state in successful ChanUpgradeInit step, channelID: %s, portID: %s", channelID, portID)

Line range hint 60-150: Refactor ChanUpgradeTry to reduce complexity and improve readability.

Consider breaking down this function into smaller, more manageable helper functions that handle specific parts of the channel upgrade process.

modules/core/keeper/msg_server.go (4)

Line range hint 479-510: Refactor error handling in RecvPacket to enhance readability and maintainability.

	switch {
	case err == nil:
		writeFn()
	case errors.Is(err, channeltypes.ErrNoOpMsg):
		// no-ops do not need event emission as they will be ignored
		ctx.Logger().Debug("no-op on redundant relay", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel)
		return &channeltypes.MsgRecvPacketResponse{Result: channeltypes.NOOP}, nil
	default:
		ctx.Logger().Error("receive packet failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "receive packet verification failed"))
		return nil, errorsmod.Wrap(err, "receive packet verification failed")
	}

Consider using a helper function to handle the repetitive error wrapping and logging to reduce code duplication and improve clarity.


Line range hint 560-591: Refactor error handling in Timeout to enhance readability and maintainability.

	switch {
	case err == nil:
		writeFn()
	case errors.Is(err, channeltypes.ErrNoOpMsg):
		// no-ops do not need event emission as they will be ignored
		ctx.Logger().Debug("no-op on redundant relay", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel)
		return &channeltypes.MsgTimeoutResponse{Result: channeltypes.NOOP}, nil
	default:
		ctx.Logger().Error("timeout failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "timeout packet verification failed"))
		return nil, errorsmod.Wrap(err, "timeout packet verification failed")
	}

Similar to the previous comment, consider using a helper function to handle the repetitive error wrapping and logging to reduce code duplication and improve clarity.


Line range hint 632-663: Refactor error handling in TimeoutOnClose to enhance readability and maintainability.

	switch {
	case err == nil:
		writeFn()
	case errors.Is(err, channeltypes.ErrNoOpMsg):
		// no-ops do not need event emission as they will be ignored
		ctx.Logger().Debug("no-op on redundant relay", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel)
		return &channeltypes.MsgTimeoutOnCloseResponse{Result: channeltypes.NOOP}, nil
	default:
		ctx.Logger().Error("timeout on close failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "timeout on close packet verification failed"))
		return nil, errorsmod.Wrap(err, "timeout on close packet verification failed")
	}

Again, using a helper function for error handling could significantly clean up the code and make it easier to maintain.


Line range hint 707-738: Refactor error handling in Acknowledgement to enhance readability and maintainability.

	switch {
	case err == nil:
		writeFn()
	case errors.Is(err, channeltypes.ErrNoOpMsg):
		// no-ops do not need event emission as they will be ignored
		ctx.Logger().Debug("no-op on redundant relay", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel)
		return &channeltypes.MsgAcknowledgementResponse{Result: channeltypes.NOOP}, nil
	default:
		ctx.Logger().Error("acknowledgement failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "acknowledge packet verification failed"))
		return nil, errorsmod.Wrap(err, "acknowledge packet verification failed")
	}

This is another instance where a helper function for error handling could improve code readability and maintainability.

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0a22b7a and 8727d71.
Files selected for processing (27)
  • .golangci.yml (1 hunks)
  • cmd/build_test_matrix/main.go (2 hunks)
  • docs/docs/03-light-clients/04-wasm/03-integration.md (1 hunks)
  • docs/versioned_docs/version-v7.4.x/03-light-clients/04-wasm/03-integration.md (1 hunks)
  • docs/versioned_docs/version-v8.2.x/03-light-clients/04-wasm/03-integration.md (1 hunks)
  • e2e/dockerutil/dockerutil.go (2 hunks)
  • e2e/testsuite/testconfig.go (2 hunks)
  • e2e/testsuite/testsuite.go (1 hunks)
  • modules/apps/27-interchain-accounts/controller/keeper/genesis.go (1 hunks)
  • modules/apps/27-interchain-accounts/host/keeper/genesis.go (2 hunks)
  • modules/apps/27-interchain-accounts/module.go (2 hunks)
  • modules/apps/29-fee/module.go (1 hunks)
  • modules/apps/callbacks/ibc_middleware_test.go (2 hunks)
  • modules/apps/transfer/keeper/genesis.go (1 hunks)
  • modules/apps/transfer/keeper/relay.go (2 hunks)
  • modules/apps/transfer/module.go (1 hunks)
  • modules/core/02-client/genesis.go (1 hunks)
  • modules/core/04-channel/keeper/upgrade.go (2 hunks)
  • modules/core/04-channel/keeper/upgrade_test.go (4 hunks)
  • modules/core/keeper/msg_server.go (4 hunks)
  • modules/core/module.go (1 hunks)
  • modules/light-clients/06-solomachine/light_client_module_test.go (12 hunks)
  • modules/light-clients/08-wasm/keeper/keeper_vm.go (1 hunks)
  • modules/light-clients/08-wasm/keeper/snapshotter.go (2 hunks)
  • modules/light-clients/08-wasm/light_client_module_test.go (4 hunks)
  • modules/light-clients/08-wasm/module.go (2 hunks)
  • modules/light-clients/08-wasm/testing/simapp/app.go (1 hunks)
Files skipped from review due to trivial changes (6)
  • cmd/build_test_matrix/main.go
  • modules/apps/27-interchain-accounts/host/keeper/genesis.go
  • modules/apps/transfer/keeper/genesis.go
  • modules/apps/transfer/module.go
  • modules/light-clients/08-wasm/keeper/keeper_vm.go
  • modules/light-clients/08-wasm/testing/simapp/app.go
Additional Context Used
LanguageTool (47)
docs/docs/03-light-clients/04-wasm/03-integration.md (17)

Near line 14: The word “setup” is a noun. The verb is spelled with a white space.
Context: ...egration points in app.go required to setup the 08-wasm module in a chain binary....


Near line 128: Consider adding a comma.
Context: ...omes to instantiating 08-wasm's keeper there are two recommended ways of doing it. C...


Near line 132: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ry when the VM stores blobs and various caches, otherwise unexpected behaviour is likely to happe...


Near line 133: Consider a shorter alternative to avoid wordiness.
Context: ...ances to shared the same data folder). In order to share the Wasm VM instance please follo...


Near line 134: Consider adding a comma here.
Context: ... In order to share the Wasm VM instance please follow the guideline below. Please note...


Near line 137: Unpaired symbol: ‘[’ seems to be missing
Context: ...e an Option with this Wasm VM instance](https://github.com/CosmWasm/wasmd/blob/...


Near line 214: Unpaired symbol: ‘)’ seems to be missing
Context: ... method above from the previous section (e.g. instantiating a Wasm VM in app.go a...


Near line 215: Did you mean “and pass it”?
Context: ...(e.g. instantiating a Wasm VM in app.go an pass it to 08-wasm's [NewKeeperWithVM constru...


Near line 260: A comma may be missing after the conjunctive/linking adverb ‘Currently’.
Context: ...ns API inspired by the one in x/wasm. Currently the only option available is the `WithQ...


Near line 261: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... module. The use of this API is optional and it is only required if the chain wants ...


Near line 282: Did you mean “except”?
Context: ...rgate` querier appends the user defined accept list of query routes to a default list ...


Near line 283: Unpaired symbol: ‘"’ seems to be missing
Context: ...ceptListdefines a single query route:"/ibc.core.client.v1.Query/VerifyMembership"`. This allows for light client smart co...


Near line 328: Consider a shorter alternative to avoid wordiness.
Context: ...then it is not necessary to do anything in order to allow the creation of 08-wasm clients...


Near line 328: Consider a shorter alternative to avoid wordiness.
Context: ...-solomachine", "07-tendermint"]), then in order to use the 08-wasm` module chains must up...


Near line 356: Possible missing comma found.
Context: ...ns(ctx, configurator, vm) } } ``` Or alternatively the parameter can be updated via a gove...


Near line 360: Possible missing comma found.
Context: ...le to the store As part of the upgrade migration you must also add the module to the upg...


Near line 381: Consider a shorter alternative to avoid wordiness.
Context: ... } } ``` ## Adding snapshot support In order to use the 08-wasm module chains are req...

docs/versioned_docs/version-v7.4.x/03-light-clients/04-wasm/03-integration.md (12)

Near line 14: The word “setup” is a noun. The verb is spelled with a white space.
Context: ...egration points in app.go required to setup the 08-wasm module in a chain binary....


Near line 128: Consider adding a comma.
Context: ...omes to instantiating 08-wasm's keeper there are two recommended ways of doing it. C...


Near line 132: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ry when the VM stores blobs and various caches, otherwise unexpected behaviour is likely to happe...


Near line 133: Consider a shorter alternative to avoid wordiness.
Context: ...xpected behaviour is likely to happen. In order to share the Wasm VM instance please follo...


Near line 134: Consider adding a comma here.
Context: ... In order to share the Wasm VM instance please follow the guideline below. Please note...


Near line 137: Unpaired symbol: ‘[’ seems to be missing
Context: ...e an Option with this Wasm VM instance](https://github.com/CosmWasm/wasmd/blob/...


Near line 214: Unpaired symbol: ‘)’ seems to be missing
Context: ... method above from the previous section (e.g. instantiating a Wasm VM in app.go a...


Near line 215: Did you mean “and pass it”?
Context: ...(e.g. instantiating a Wasm VM in app.go an pass it to 08-wasm's [NewKeeperWithVM constru...


Near line 260: A comma may be missing after the conjunctive/linking adverb ‘Currently’.
Context: ...ns API inspired by the one in x/wasm. Currently the only option available is the `WithQ...


Near line 261: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... module. The use of this API is optional and it is only required if the chain wants ...


Near line 317: Consider a shorter alternative to avoid wordiness.
Context: ...n, ) ``` ## Updating AllowedClients In order to use the `08-wasm` module chains must up...


Near line 371: Consider a shorter alternative to avoid wordiness.
Context: ... } } ``` ## Adding snapshot support In order to use the 08-wasm module chains are req...

docs/versioned_docs/version-v8.2.x/03-light-clients/04-wasm/03-integration.md (18)

Near line 14: The word “setup” is a noun. The verb is spelled with a white space.
Context: ...egration points in app.go required to setup the 08-wasm module in a chain binary....


Near line 128: Consider adding a comma.
Context: ...omes to instantiating 08-wasm's keeper there are two recommended ways of doing it. C...


Near line 132: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ry when the VM stores blobs and various caches, otherwise unexpected behaviour is likely to happe...


Near line 133: Consider a shorter alternative to avoid wordiness.
Context: ...xpected behaviour is likely to happen. In order to share the Wasm VM instance please follo...


Near line 134: Consider adding a comma here.
Context: ... In order to share the Wasm VM instance please follow the guideline below. Please note...


Near line 137: Unpaired symbol: ‘[’ seems to be missing
Context: ...e an Option with this Wasm VM instance](https://github.com/CosmWasm/wasmd/blob/...


Near line 214: Unpaired symbol: ‘)’ seems to be missing
Context: ... method above from the previous section (e.g. instantiating a Wasm VM in app.go a...


Near line 215: Did you mean “and pass it”?
Context: ...(e.g. instantiating a Wasm VM in app.go an pass it to 08-wasm's [NewKeeperWithVM constru...


Near line 219: A determiner appears to be missing. Consider inserting it.
Context: ...7f29f5ba35a003970fdba/app/app.go#L579). Default value is 256. - ContractDebugMode is ...


Near line 220: A determiner appears to be missing. Consider inserting it.
Context: ...ld be false in production environments. Default value is false. Another configuration ...


Near line 260: A comma may be missing after the conjunctive/linking adverb ‘Currently’.
Context: ...ns API inspired by the one in x/wasm. Currently the only option available is the `WithQ...


Near line 261: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... module. The use of this API is optional and it is only required if the chain wants ...


Near line 318: Consider a shorter alternative to avoid wordiness.
Context: ...then it is not necessary to do anything in order to allow the creation of 08-wasm clients...


Near line 318: Consider a shorter alternative to avoid wordiness.
Context: ...-solomachine", "07-tendermint"]), then in order to use the 08-wasm` module chains must up...


Near line 346: A comma might be missing here.
Context: ...ns(ctx, configurator, vm) } } ``` Or alternatively the parameter can be updated via a gove...


Near line 371: Consider a shorter alternative to avoid wordiness.
Context: ... } } ``` ## Adding snapshot support In order to use the 08-wasm module chains are req...


Near line 372: You might be missing the article “the” here.
Context: ...p/app.go#L775-L782) should be placed in NewSimApp function in app.go. ## Pin...


Near line 376: You might be missing the article “the” here.
Context: ...p/app.go#L825-L830) should be placed in NewSimApp function in app.go.

Path-based Instructions (20)
modules/apps/27-interchain-accounts/controller/keeper/genesis.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

e2e/dockerutil/dockerutil.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern e2e/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"

modules/core/02-client/genesis.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

modules/light-clients/08-wasm/keeper/snapshotter.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

modules/light-clients/08-wasm/module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

modules/apps/29-fee/module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

modules/core/module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

modules/apps/27-interchain-accounts/module.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

docs/versioned_docs/version-v7.4.x/03-light-clients/04-wasm/03-integration.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

modules/apps/transfer/keeper/relay.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

docs/versioned_docs/version-v8.2.x/03-light-clients/04-wasm/03-integration.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

docs/docs/03-light-clients/04-wasm/03-integration.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

e2e/testsuite/testsuite.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern e2e/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"

e2e/testsuite/testconfig.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern e2e/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"

modules/apps/callbacks/ibc_middleware_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

modules/core/04-channel/keeper/upgrade.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

modules/light-clients/06-solomachine/light_client_module_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

modules/light-clients/08-wasm/light_client_module_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

modules/core/keeper/msg_server.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

modules/core/04-channel/keeper/upgrade_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

Learnings (2)
modules/light-clients/06-solomachine/light_client_module_test.go (1)
User: charleenfei
URL: https://github.com/cosmos/ibc-go/pull/6135

Timestamp: 2024-04-11T11:01:16.856Z
Learning: In the `upgrade_test.go` file within the `modules/light-clients/07-tendermint` directory, the absence of error checking in type assertions within test cases is intentional to simplify the test setup or focus on specific behaviors.
modules/light-clients/08-wasm/light_client_module_test.go (1)
User: charleenfei
URL: https://github.com/cosmos/ibc-go/pull/6135

Timestamp: 2024-04-11T11:01:16.856Z
Learning: In the `upgrade_test.go` file within the `modules/light-clients/07-tendermint` directory, the absence of error checking in type assertions within test cases is intentional to simplify the test setup or focus on specific behaviors.
Additional comments not posted (27)
modules/apps/27-interchain-accounts/controller/keeper/genesis.go (1)

24-24: Use of fmt.Errorf with %w for error wrapping aligns with best practices for modern Go error handling.

e2e/dockerutil/dockerutil.go (2)

31-31: Use of fmt.Errorf with %w for error wrapping in GetTestContainers function is a good practice for error handling.


44-44: Use of fmt.Errorf with %w for error wrapping in GetContainerLogs function enhances error traceability.

modules/core/02-client/genesis.go (1)

18-18: Use of fmt.Errorf with %w for error wrapping in InitGenesis function aligns with best practices for modern Go error handling.

.golangci.yml (1)

9-9: Addition of errorlint to the linter configuration supports the PR's goal of enhancing error handling across the codebase.

modules/light-clients/08-wasm/keeper/snapshotter.go (1)

135-135: Handling of io.EOF in processAllItems method is correctly implemented for end-of-file detection during payload reading.

modules/light-clients/08-wasm/module.go (2)

117-117: Use of panic in RegisterServices for critical error handling during module migration is appropriate given the context.


133-133: Use of fmt.Errorf with %w for error wrapping in InitGenesis enhances error traceability and handling.

modules/apps/29-fee/module.go (1)

114-114: Use of panic in RegisterServices for critical error handling during module migration is appropriate given the context.

modules/core/module.go (1)

175-175: Use of fmt.Errorf with %w for error wrapping in InitGenesis enhances error traceability and handling.

modules/apps/callbacks/ibc_middleware_test.go (13)

Line range hint 14-14: The test cases in TestNewIBCMiddleware are well-structured and effectively cover various instantiation scenarios, including error conditions.


Line range hint 14-14: TestWithICS4Wrapper correctly tests the setting and retrieval of the ICS4 wrapper, ensuring type safety.


Line range hint 14-14: TestSendPacket effectively tests various scenarios in packet sending, including error handling and callback execution, aligning well with the PR's focus on robust error management.


Line range hint 14-14: TestOnAcknowledgementPacket provides thorough testing for the handling of acknowledgement packets, covering various scenarios and error conditions effectively.


Line range hint 14-14: TestOnTimeoutPacket robustly tests the handling of timeout packets, including detailed scenarios for error handling and callback execution.


Line range hint 14-14: TestOnRecvPacket effectively tests the receipt of packets, covering a wide range of scenarios including error handling and callback execution.


Line range hint 14-14: TestWriteAcknowledgement provides comprehensive testing for writing acknowledgements, including handling of errors and callback data.


Line range hint 14-14: TestProcessCallback robustly tests the callback processing functionality, covering various error scenarios and handling of gas limits effectively.


Line range hint 14-14: TestUnmarshalPacketData correctly tests the unmarshalling of packet data, ensuring that the data is accurately interpreted.


Line range hint 14-14: TestGetAppVersion effectively tests the retrieval of the application version, ensuring that the version is accurately obtained from the IBC stack.


Line range hint 14-14: TestOnChanCloseInit correctly tests the initial channel closure request, ensuring that it is properly propagated through the IBC stack.


Line range hint 14-14: TestOnChanCloseConfirm correctly tests the confirmation of channel closure, ensuring that it is properly handled through the IBC stack.


Line range hint 14-14: TestOnRecvPacketAsyncAck effectively tests the handling of asynchronous acknowledgements, ensuring that they are properly managed through the IBC stack.

modules/core/04-channel/keeper/upgrade.go (1)

Line range hint 15-34: LGTM! Proper use of error wrapping in ChanUpgradeInit.

modules/light-clients/08-wasm/light_client_module_test.go (3)

1033-1033: Ensure proper error handling for client state retrieval failures.


1327-1327: Validate that all error paths are tested, especially for critical operations like client state updates.

Verification successful

The expanded search for error handling in the Go tests has confirmed that error paths are indeed being checked in the codebase, including within the specific module under review (modules/light-clients/08-wasm/). The presence of error handling in the light_client_module_test.go file and other related files within the module suggests that critical operations, such as client state updates, are being tested for error conditions.

  • File: modules/light-clients/08-wasm/light_client_module_test.go
    • Error handling is present in various parts of the test file, indicating that error paths are being tested.

This verification addresses the concern raised in the review comment regarding the testing of error paths for critical operations.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Ensure all critical error paths are covered by tests.

# Test: Search for tests covering error paths in client state updates. Expect: Comprehensive coverage.
rg --type go 'suite.Require().ErrorIs\(err,'

Length of output: 46



Script:

#!/bin/bash
# Broadening the search to include other common patterns for error checking in Go tests.
rg --type go 'suite.Error(err)'  # Check for any direct error assertions without comparison to a specific error.
rg --type go 'err != nil'        # Check for generic error checks in the test files.

Length of output: 275617


1033-1033: Ensure that non-membership verification handles all potential edge cases, particularly with malformed proofs.

Verification successful

The verification process has confirmed that the 08-wasm module does indeed handle various edge cases related to non-membership verification, including scenarios with malformed proofs, invalid proof heights, and other error conditions. This is evident from the detailed test cases provided in the TestVerifyNonMembership function, which explicitly test for conditions such as invalid proofs and proof heights exceeding the client state's latest height.

Here are the specific test cases that address these concerns:

  • Handling of invalid proofs: The test case labeled "failure: contract returns invalid proof error" uses wasmtesting.MockInvalidProofBz to simulate an invalid proof scenario.
  • Handling of proof height issues: The test cases labeled "failure: proof height greater than client state latest height" and "failure: proof height is invalid type" address scenarios where the proof height is incorrect or improperly formatted.

These test cases ensure that the system robustly handles errors and edge cases in non-membership verification within the 08-wasm module.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that non-membership verification handles all edge cases.

# Test: Search for handling of malformed proofs in non-membership verification. Expect: Robust handling of edge cases.
rg --type go 'malformed proof'

Length of output: 264



Script:

#!/bin/bash
# Description: Expand search to include general error handling in non-membership verification within the `08-wasm` module.

# Test: Search for error handling related to proofs in the `08-wasm` module. Expect: Identification of relevant test cases or error handling mechanisms.
rg --type go -C 10 'proof' modules/light-clients/08-wasm/light_client_module_test.go

Length of output: 8828

@@ -1,6 +1,7 @@
package keeper

import (
"errors"
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure consistent import aliasing for errors.

- errorsmod "cosmossdk.io/errors"
+ errors "cosmossdk.io/errors"

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.

Suggested change
"errors"
"errors"

@@ -311,10 +311,10 @@ func (s *E2ETestSuite) RecoverRelayerWallets(ctx context.Context, ibcrelayer ibc
chainA, chainB := s.GetChains()

if err := chainA.RecoverKey(ctx, ChainARelayerName, chainARelayerWallet.Mnemonic()); err != nil {
return fmt.Errorf("could not recover relayer wallet on chain A: %s", err)
return fmt.Errorf("could not recover relayer wallet on chain A: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use error wrapping for consistency with the project's new error handling strategy.

-		return fmt.Errorf("could not recover relayer wallet on chain A: %w", err)
+		return errors.Errorf("could not recover relayer wallet on chain A: %w", err)

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.

Suggested change
return fmt.Errorf("could not recover relayer wallet on chain A: %w", err)
return errors.Errorf("could not recover relayer wallet on chain A: %w", err)

}
if err := chainB.RecoverKey(ctx, ChainBRelayerName, chainBRelayerWallet.Mnemonic()); err != nil {
return fmt.Errorf("could not recover relayer wallet on chain B: %s", err)
return fmt.Errorf("could not recover relayer wallet on chain B: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use error wrapping for consistency with the project's new error handling strategy.

-		return fmt.Errorf("could not recover relayer wallet on chain B: %w", err)
+		return errors.Errorf("could not recover relayer wallet on chain B: %w", err)

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.

Suggested change
return fmt.Errorf("could not recover relayer wallet on chain B: %w", err)
return errors.Errorf("could not recover relayer wallet on chain B: %w", err)

@@ -683,7 +683,7 @@ func defaultGovv1Beta1ModifyGenesis(version string) func(ibc.ChainConfig, []byte

govModuleBytes, err := json.Marshal(appStateMap[govtypes.ModuleName])
if err != nil {
return nil, fmt.Errorf("failed to extract gov genesis bytes: %s", err)
return nil, fmt.Errorf("failed to extract gov genesis bytes: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve error message for clarity and debugging.

-			return nil, fmt.Errorf("failed to extract gov genesis bytes: %w", err)
+			return nil, fmt.Errorf("failed to extract gov module genesis bytes from app state: %w", err)

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.

Suggested change
return nil, fmt.Errorf("failed to extract gov genesis bytes: %w", err)
return nil, fmt.Errorf("failed to extract gov module genesis bytes from app state: %w", err)

@@ -700,7 +700,7 @@
if !testvalues.AllowAllClientsWildcardFeatureReleases.IsSupported(version) {
ibcModuleBytes, err := json.Marshal(appStateMap[ibcexported.ModuleName])
if err != nil {
return nil, fmt.Errorf("failed to extract ibc genesis bytes: %s", err)
return nil, fmt.Errorf("failed to extract ibc genesis bytes: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve error message for clarity and debugging.

-				return nil, fmt.Errorf("failed to extract ibc genesis bytes: %w", err)
+				return nil, fmt.Errorf("failed to extract IBC module genesis bytes from app state: %w", err)

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.

Suggested change
return nil, fmt.Errorf("failed to extract ibc genesis bytes: %w", err)
return nil, fmt.Errorf("failed to extract IBC module genesis bytes from app state: %w", err)

@@ -1162,7 +1162,7 @@ func (suite *WasmTestSuite) TestUpdateState() {
func() {
clientID = unusedWasmClientID
},
fmt.Errorf("08-wasm-100: %s", clienttypes.ErrClientNotFound),
fmt.Errorf("08-wasm-100: %w", clienttypes.ErrClientNotFound),
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The review comment suggests ensuring that error messages in the test cases provide sufficient context for debugging. The provided script output lists numerous instances where errors.New() is used across various files in the codebase, including the specific file in question (modules/light-clients/08-wasm/light_client_module_test.go).

From the output, it's evident that error messages are generally descriptive, indicating specific issues like "invalid block ID", "wasm consensus host codec is nil", "client keeper must not be nil", etc. These messages seem to provide a clear indication of what the error is, which is crucial for debugging.

However, the review comment is specifically about the clarity and sufficiency of context provided by error messages in the test cases of the file light_client_module_test.go. The script output shows only one relevant error message from this file:

modules/light-clients/08-wasm/light_client_module_test.go:					return nil, 0, errors.New("invalid block ID")

This error message, "invalid block ID", while somewhat descriptive, could potentially be improved by including more context about why the block ID is considered invalid or under what conditions this error is triggered.

Given this analysis, the error message in the specific test case file could benefit from more detailed context to aid in debugging, especially in a complex testing environment.

Final Response

The error message "invalid block ID" in modules/light-clients/08-wasm/light_client_module_test.go could be enhanced by providing more context or details about the conditions under which the block ID is deemed invalid. This would improve clarity and debugging effectiveness.

  • Consider revising the error message to include more specific details or context.
  • Example: "invalid block ID: expected format [format], received [received format]".
Analysis chain

Ensure error messages are clear and provide sufficient context for debugging.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that error messages throughout the test cases provide sufficient context.

# Test: Search for error handling patterns in test cases. Expect: Detailed error messages that aid debugging.
rg --type go 'errors.New\("'

Length of output: 18120

@@ -1191,7 +1191,7 @@
return &wasmvmtypes.ContractResult{Ok: &wasmvmtypes.Response{Data: []byte("invalid json")}}, wasmtesting.DefaultGasUsed, nil
})
},
fmt.Errorf("invalid character 'i' looking for beginning of value: %s", types.ErrWasmInvalidResponseData),
fmt.Errorf("invalid character 'i' looking for beginning of value: %w", types.ErrWasmInvalidResponseData),
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding more detailed logging for debugging purposes.

// Add detailed logging to help trace the flow and values during test execution.
fmt.Println("Testing initialization with parameters:", params)

@@ -1380,7 +1380,7 @@
func() {
clientID = unusedSmClientID
},
fmt.Errorf("%s: %s", unusedSmClientID, clienttypes.ErrClientNotFound),
fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound),
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure error message formatting aligns with best practices.

- fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound),
+ fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound)

The error message should not have a trailing comma as it is not part of a multi-line declaration or array.


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.

Suggested change
fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound),
fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound)

@@ -1626,7 +1626,7 @@
func() {
clientID = unusedSmClientID
},
fmt.Errorf("%s: %s", unusedSmClientID, clienttypes.ErrClientNotFound),
fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound),
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure error message formatting aligns with best practices.

- fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound),
+ fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound)

The error message should not have a trailing comma as it is not part of a multi-line declaration or array.


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.

Suggested change
fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound),
fmt.Errorf("%s: %w", unusedSmClientID, clienttypes.ErrClientNotFound)

@@ -105,7 +105,7 @@ func NewSimApp(
ibcwasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmClientKeeper),
)
if err != nil {
panic(fmt.Errorf("failed to register snapshot extension: %s", err))
panic(fmt.Errorf("failed to register snapshot extension: %w", err))
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Several files in the codebase use panic extensively without apparent recovery mechanisms, which might indicate a need for a review of the error handling strategy:

  • modules/light-clients/08-wasm/keeper/keeper_vm.go
  • modules/core/02-client/types/encoding.go
  • modules/apps/transfer/keeper/relay.go
  • Many others across various modules.

Consider revising the error handling approach to enhance system robustness and maintainability, especially in production environments where abrupt termination might not be desirable.

Analysis chain

Ensure proper error handling in panic scenarios.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify proper error handling for panic scenarios in the codebase.

# Test: Search for panic usage related to error handling. Expect: Proper context and recovery mechanisms.
rg --type go 'panic\(fmt\.Errorf'

Length of output: 13835



Script:

#!/bin/bash
# Description: Check for recovery mechanisms around panic scenarios in the codebase.

# Test: Search for defer statements that might handle or recover from panics.
rg --type go -C 10 'defer.*recover'

Length of output: 37

@hoank101 hoank101 changed the title chore: add errorlint and refactor check error refactor: add errorlint and refactor check error May 11, 2024
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: 0

Outside diff range and nitpick comments (13)
docs/versioned_docs/version-v7.5.x/03-light-clients/04-wasm/03-integration.md (13)

Line range hint 24-24: Correct verb form usage for "setup".

- The sample code below shows the relevant integration points in `app.go` required to setup the `08-wasm` module in a chain binary.
+ The sample code below shows the relevant integration points in `app.go` required to set up the `08-wasm` module in a chain binary.

Line range hint 138-138: Consider adding a comma for clarity.

- When it comes to instantiating `08-wasm`'s keeper there are two recommended ways of doing it.
+ When it comes to instantiating `08-wasm`'s keeper, there are two recommended ways of doing it.

Line range hint 142-142: Improve sentence structure by separating clauses.

- Having two separate Wasm VM instances is still possible, but care should be taken to make sure that both instances do not share the directory when the VM stores blobs and various caches, otherwise unexpected behaviour is likely to happen.
+ Having two separate Wasm VM instances is still possible, but care should be taken to make sure that both instances do not share the directory when the VM stores blobs and various caches; otherwise, unexpected behaviour is likely to happen.

Line range hint 143-143: Consider a shorter alternative to avoid wordiness.

- In order to share the Wasm VM instance please follow the guideline below.
+ To share the Wasm VM instance, please follow the guideline below.

Line range hint 144-144: Consider adding a comma here.

- In order to share the Wasm VM instance please follow the guideline below. Please note that this requires `x/wasm` v0.41 or above.
+ In order to share the Wasm VM instance, please follow the guideline below. Please note that this requires `x/wasm` v0.41 or above.

Line range hint 225-225: Clarify the sentence by correcting the conjunction.

- If the chain does not use [`x/wasm`](https://github.com/CosmWasm/wasmd/tree/main/x/wasm), even though it is still possible to use the method above from the previous section (e.g. instantiating a Wasm VM in app.go an pass it to 08-wasm's [`NewKeeperWithVM` constructor function](https://github.com/cosmos/ibc-go/blob/b306e7a706e1f84a5e11af0540987bd68de9bae5/modules/light-clients/08-wasm/keeper/keeper.go#L38-L46), since there would be no need in this case to share the Wasm VM instance with another module, you can use the [`NewKeeperWithConfig` constructor function](https://github.com/cosmos/ibc-go/blob/b306e7a706e1f84a5e11af0540987bd68de9bae5/modules/light-clients/08-wasm/keeper/keeper.go#L82-L90) and provide the Wasm VM configuration parameters of your choice instead.
+ If the chain does not use [`x/wasm`](https://github.com/CosmWasm/wasmd/tree/main/x/wasm), even though it is still possible to use the method above from the previous section (e.g. instantiating a Wasm VM in app.go and pass it to 08-wasm's [`NewKeeperWithVM` constructor function](https://github.com/cosmos/ibc-go/blob/b306e7a706e1f84a5e11af0540987bd68de9bae5/modules/light-clients/08-wasm/keeper/keeper.go#L38-L46), since there would be no need in this case to share the Wasm VM instance with another module, you can use the [`NewKeeperWithConfig` constructor function](https://github.com/cosmos/ibc-go/blob/b306e7a706e1f84a5e11af0540987bd68de9bae5/modules/light-clients/08-wasm/keeper/keeper.go#L82-L90) and provide the Wasm VM configuration parameters of your choice instead.

Line range hint 270-270: Add a comma after the conjunctive/linking adverb 'Currently'.

- Currently the only option available is the `WithQueryPlugins` option, which allows registration of custom query plugins for the `08-wasm` module.
+ Currently, the only option available is the `WithQueryPlugins` option, which allows registration of custom query plugins for the `08-wasm` module.

Line range hint 271-271: Use a comma before 'and' if it connects two independent clauses.

- The use of this API is optional and it is only required if the chain wants to register custom query plugins for the `08-wasm` module.
+ The use of this API is optional, and it is only required if the chain wants to register custom query plugins for the `08-wasm` module.

Line range hint 327-327: Consider a shorter alternative to avoid wordiness.

- In order to use the `08-wasm` module chains must update the [`AllowedClients` parameter in the 02-client submodule](https://github.com/cosmos/ibc-go/blob/v7.3.0/proto/ibc/core/client/v1/client.proto#L104) of core IBC.
+ To use the `08-wasm` module, chains must update the [`AllowedClients` parameter in the 02-client submodule](https://github.com/cosmos/ibc-go/blob/v7.3.0/proto/ibc/core/client/v1/client.proto#L104) of core IBC.

Line range hint 328-328: Add a comma for clarity.

- In order to use the `08-wasm` module chains must update the [`AllowedClients` parameter in the 02-client submodule](https://github.com/cosmos/ibc-go/blob/v7.3.0/proto/ibc/core/client/v1/client.proto#L104) of core IBC.
+ In order to use the `08-wasm` module, chains must update the [`AllowedClients` parameter in the 02-client submodule](https://github.com/cosmos/ibc-go/blob/v7.3.0/proto/ibc/core/client/v1/client.proto#L104) of core IBC.

Line range hint 360-360: Add a comma for clarity.

- As part of the upgrade migration you must also add the module to the upgrades store.
+ As part of the upgrade migration, you must also add the module to the upgrades store.

Line range hint 381-381: Consider a shorter alternative to avoid wordiness.

- In order to use the `08-wasm` module chains are required to register the `WasmSnapshotter` extension in the snapshot manager.
+ To use the `08-wasm` module, chains are required to register the `WasmSnapshotter` extension in the snapshot manager.

Line range hint 382-382: Add a comma for clarity.

- In order to use the `08-wasm` module chains are required to register the `WasmSnapshotter` extension in the snapshot manager.
+ In order to use the `08-wasm` module, chains are required to register the `WasmSnapshotter` extension in the snapshot manager.
Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8727d71 and e046277.
Files selected for processing (2)
  • docs/docs/03-light-clients/04-wasm/03-integration.md (1 hunks)
  • docs/versioned_docs/version-v7.5.x/03-light-clients/04-wasm/03-integration.md (1 hunks)
Additional Context Used
LanguageTool (26)
docs/docs/03-light-clients/04-wasm/03-integration.md (13)

Near line 153: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ry when the VM stores blobs and various caches, otherwise unexpected behaviour is likely to happe...


Near line 154: Consider a shorter alternative to avoid wordiness.
Context: ...ances to shared the same data folder). In order to share the Wasm VM instance, please foll...


Near line 236: Did you mean “and pass it”?
Context: ...(e.g. instantiating a Wasm VM in app.go an pass it to 08-wasm's [NewKeeperWithVM constru...


Near line 281: A comma may be missing after the conjunctive/linking adverb ‘Currently’.
Context: ...ns API inspired by the one in x/wasm. Currently the only option available is the `WithQ...


Near line 282: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... module. The use of this API is optional and it is only required if the chain wants ...


Near line 303: Did you mean “except”?
Context: ...rgate` querier appends the user defined accept list of query routes to a default list ...


Near line 304: Unpaired symbol: ‘"’ seems to be missing
Context: ...ceptListdefines a single query route:"/ibc.core.client.v1.Query/VerifyMembership"`. This allows for light client smart co...


Near line 349: Consider a shorter alternative to avoid wordiness.
Context: ...then it is not necessary to do anything in order to allow the creation of 08-wasm clients...


Near line 349: Consider a shorter alternative to avoid wordiness.
Context: ...-solomachine", "07-tendermint"]), then in order to use the 08-wasm` module chains must up...


Near line 377: Possible missing comma found.
Context: ...ns(ctx, configurator, vm) } } ``` Or alternatively the parameter can be updated via a gove...


Near line 381: Possible missing comma found.
Context: ...le to the store As part of the upgrade migration you must also add the module to the upg...


Near line 402: Consider a shorter alternative to avoid wordiness.
Context: ... } } ``` ## Adding snapshot support In order to use the 08-wasm module chains are req...


Near line 403: Possible missing comma found.
Context: ... support In order to use the 08-wasm module chains are required to register the `Wa...

docs/versioned_docs/version-v7.5.x/03-light-clients/04-wasm/03-integration.md (13)

Near line 24: The word “setup” is a noun. The verb is spelled with a white space.
Context: ...egration points in app.go required to setup the 08-wasm module in a chain binary....


Near line 138: Consider adding a comma.
Context: ...omes to instantiating 08-wasm's keeper there are two recommended ways of doing it. C...


Near line 142: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ry when the VM stores blobs and various caches, otherwise unexpected behaviour is likely to happe...


Near line 143: Consider a shorter alternative to avoid wordiness.
Context: ...xpected behaviour is likely to happen. In order to share the Wasm VM instance please follo...


Near line 144: Consider adding a comma here.
Context: ... In order to share the Wasm VM instance please follow the guideline below. Please note...


Near line 225: Did you mean “and pass it”?
Context: ...(e.g. instantiating a Wasm VM in app.go an pass it to 08-wasm's [NewKeeperWithVM constru...


Near line 270: A comma may be missing after the conjunctive/linking adverb ‘Currently’.
Context: ...ns API inspired by the one in x/wasm. Currently the only option available is the `WithQ...


Near line 271: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... module. The use of this API is optional and it is only required if the chain wants ...


Near line 327: Consider a shorter alternative to avoid wordiness.
Context: ...n, ) ``` ## Updating AllowedClients In order to use the `08-wasm` module chains must up...


Near line 328: Possible missing comma found.
Context: ...Clients In order to use the08-wasm module chains must update the [AllowedClients...


Near line 360: Possible missing comma found.
Context: ...le to the store As part of the upgrade migration you must also add the module to the upg...


Near line 381: Consider a shorter alternative to avoid wordiness.
Context: ... } } ``` ## Adding snapshot support In order to use the 08-wasm module chains are req...


Near line 382: Possible missing comma found.
Context: ... support In order to use the 08-wasm module chains are required to register the `Wa...

Markdownlint (5)
docs/docs/03-light-clients/04-wasm/03-integration.md (2)

10: Expected: 0 or 2; Actual: 1
Trailing spaces


8: null
Multiple top-level headings in the same document

docs/versioned_docs/version-v7.5.x/03-light-clients/04-wasm/03-integration.md (3)

10: Expected: 0 or 2; Actual: 1
Trailing spaces


108: Column: 1
Hard tabs


8: null
Multiple top-level headings in the same document

Path-based Instructions (2)
docs/versioned_docs/version-v7.5.x/03-light-clients/04-wasm/03-integration.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

docs/docs/03-light-clients/04-wasm/03-integration.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

Additional comments not posted (13)
docs/docs/03-light-clients/04-wasm/03-integration.md (13)

Line range hint 24-24: Correct verb form usage for "setup".


Line range hint 138-138: Consider adding a comma for clarity.


Line range hint 142-142: Improve sentence structure by separating clauses.


Line range hint 143-143: Consider a shorter alternative to avoid wordiness.


Line range hint 144-144: Consider adding a comma here.


Line range hint 225-225: Clarify the sentence by correcting the conjunction.


Line range hint 270-270: Add a comma after the conjunctive/linking adverb 'Currently'.


Line range hint 271-271: Use a comma before 'and' if it connects two independent clauses.


Line range hint 327-327: Consider a shorter alternative to avoid wordiness.


Line range hint 328-328: Add a comma for clarity.


Line range hint 360-360: Add a comma for clarity.


Line range hint 381-381: Consider a shorter alternative to avoid wordiness.


Line range hint 382-382: Add a comma for clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant