Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(server/v2): init the indexer in server/v2 #22218

Merged
merged 8 commits into from
Oct 10, 2024

Conversation

cool-develope
Copy link
Contributor

@cool-develope cool-develope commented Oct 10, 2024

Description

Closes: #22217


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, you can find examples of the prefixes below:
  • confirmed ! in 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
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • 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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Introduced a new method for schema decoding, enhancing the application’s ability to handle module data.
    • Added indexing functionality to improve data retrieval and management in the server.
    • Updated configuration settings to include new indexer options.
  • Bug Fixes

    • Removed outdated listener management to streamline consensus operations.
  • Chores

    • Updated dependencies to ensure compatibility and improve overall performance.

Copy link
Contributor

coderabbitai bot commented Oct 10, 2024

Caution

Review failed

The head commit changed during the review from bef865a to fd4e74b.

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes introduce a new method GetSchemaDecoderResolver to the App struct in runtime/v2/app.go, enhancing the AppI interface in server/v2/types.go. The go.mod files in both runtime/v2 and server/v2 are updated to include a new direct dependency on cosmossdk.io/schema. Additionally, the server/v2/cometbft/server.go file adds the IndexerConfigKey constant and modifies the Init method for indexer initialization. The tools/confix/data/v2-app.toml file is updated to include new indexer configuration sections.

Changes

File Path Change Summary
runtime/v2/app.go, server/v2/types.go - Added method GetSchemaDecoderResolver to App struct.
- Updated AppI interface to include GetSchemaDecoderResolver() decoding.DecoderResolver.
runtime/v2/go.mod, server/v2/go.mod - Added new direct dependency cosmossdk.io/schema v0.3.1-0.20241010135032-192601639cac.
- Removed indirect dependency for cosmossdk.io/schema v0.3.0.
server/v2/cometbft/server.go - Introduced IndexerConfigKey constant.
- Enhanced Init method for indexer initialization.
- Updated import statements for organization.
server/v2/cometbft/abci.go - Removed SetListener method from Consensus struct.
server/v2/cometbft/config.go - Added Indexer field to AppTomlConfig structure.
- Updated DefaultAppTomlConfig to initialize Indexer.
tools/confix/data/v2-app.toml - Added new sections for indexer configuration under [comet] and updated telemetry address.

Assessment against linked issues

Objective Addressed Explanation
Implement indexer configuration in server/v2 (#22217)
Implement listener constructor in baseapp and server/v2 (#22217) No changes related to listener constructor present.

Possibly related PRs

Suggested labels

C:x/upgrade, C:x/distribution, C:x/params, C:x/evidence, C:x/gov, C:x/slashing, C:x/mint, C:x/bank, C:x/accounts, C:x/nft, C:x/epochs, C:x/protocolpool, backport/v0.52.x

Suggested reviewers

  • kocubinski
  • sontrinh16
  • facundomedica
  • tac0turtle

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added C:server/v2 Issues related to server/v2 C:server/v2 cometbft labels Oct 10, 2024
Copy link
Contributor

@cool-develope your pull request is missing a changelog!

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: 1

🧹 Outside diff range and nitpick comments (3)
server/v2/types.go (1)

21-22: LGTM: New method correctly added to AppI interface.

The GetSchemaDecoderResolver method is a good addition that aligns with the PR objectives. The method signature follows Go naming conventions, and the return type matches the newly imported decoding package.

Consider slightly rewording the comment for clarity:

- // It is used to get the module schema resolver for the indexer.
+ // GetSchemaDecoderResolver returns the module schema resolver for the indexer.

This change makes the comment more directly describe the method's action.

runtime/v2/app.go (1)

101-108: LGTM: New method enhances schema decoding functionality.

The GetSchemaDecoderResolver method is well-implemented and aligns with the PR objectives. It efficiently creates a map of module names to modules and uses it to initialize a ModuleSetDecoderResolver.

A minor optimization suggestion:

Consider pre-allocating the moduleSet map with the known size:

-moduleSet := map[string]any{}
+moduleSet := make(map[string]any, len(a.moduleManager.Modules()))

This can slightly improve performance by avoiding potential map resizing.

server/v2/cometbft/server.go (1)

23-28: Organize import statements according to the Uber Go Style Guide

The import statements at lines 23, 27, and 28 are not grouped correctly. According to the Uber Go Style Guide, imports should be grouped in the following order with blank lines separating them:

  1. Standard library packages
  2. Third-party packages
  3. Local packages

This improves 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 3a03804 and b9c5fb5.

📒 Files selected for processing (4)
  • runtime/v2/app.go (2 hunks)
  • server/v2/cometbft/server.go (2 hunks)
  • server/v2/config.go (1 hunks)
  • server/v2/types.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
runtime/v2/app.go (1)

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

server/v2/cometbft/server.go (1)

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

server/v2/config.go (1)

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

server/v2/types.go (1)

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

🔇 Additional comments (4)
server/v2/types.go (1)

10-10: LGTM: Import statement is correctly added and used.

The new import for the decoding package is properly placed and follows the Uber Golang style guide. It's grouped correctly with other external imports and is necessary for the new method signature.

server/v2/config.go (1)

47-48: Excellent simplification and efficiency improvement!

The changes to the UnmarshalSubConfig function are well-implemented:

  1. The use of the comma-ok idiom (if val, ok := cfg[subName]; ok) is idiomatic Go and aligns with the Uber Golang Style Guide.
  2. This change simplifies the code by removing the unnecessary loop, making it more readable and efficient.
  3. The new implementation directly checks for the existence of the key in the map, which is more performant, especially for large configurations.

Great job on improving both the clarity and efficiency of this function!

runtime/v2/app.go (1)

11-11: LGTM: Import statement is correctly placed and necessary.

The new import for the decoding package is properly placed and follows the Uber Go Style Guide for import grouping. It's required for the newly added GetSchemaDecoderResolver method.

server/v2/cometbft/server.go (1)

155-155: Verify GetSchemaDecoderResolver does not return nil

The Resolver field in indexer.IndexingOptions is set using appI.GetSchemaDecoderResolver(). Ensure that this method does not return nil to avoid a potential nil pointer dereference during indexer initialization.

Run the following script to check if GetSchemaDecoderResolver could return nil:

server/v2/cometbft/server.go Outdated Show resolved Hide resolved
Comment on lines +104 to +106
for moduleName, module := range a.moduleManager.Modules() {
moduleSet[moduleName] = module
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@julienrbrt julienrbrt changed the title feat: init the indexer in server/v2 feat(server/v2): init the indexer in server/v2 Oct 10, 2024
@@ -145,6 +148,19 @@ func (s *CometBFTServer[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logg
}
consensus.snapshotManager = snapshots.NewManager(snapshotStore, s.serverOptions.SnapshotOptions(cfg), sc, ss, nil, s.logger)

// initialize the indexer
if indexerCfg, ok := cfg[IndexerConfigKey]; ok {
Copy link
Member

Choose a reason for hiding this comment

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

where is the config created? should it be part of the comet config?

Copy link
Member

Choose a reason for hiding this comment

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

opened #22222 for it

@github-actions github-actions bot added the C:Confix Issues and PR related to Confix label Oct 10, 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: 1

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3f2823e and b866c06.

⛔ Files ignored due to path filters (3)
  • server/v2/cometbft/go.sum is excluded by !**/*.sum
  • server/v2/go.sum is excluded by !**/*.sum
  • simapp/v2/go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • server/v2/cometbft/abci.go (0 hunks)
  • server/v2/cometbft/config.go (3 hunks)
  • server/v2/cometbft/go.mod (1 hunks)
  • server/v2/cometbft/server.go (2 hunks)
  • server/v2/go.mod (1 hunks)
  • simapp/v2/go.mod (1 hunks)
  • tools/confix/data/v2-app.toml (2 hunks)
💤 Files with no reviewable changes (1)
  • server/v2/cometbft/abci.go
✅ Files skipped from review due to trivial changes (1)
  • simapp/v2/go.mod
🚧 Files skipped from review as they are similar to previous changes (1)
  • server/v2/go.mod
🧰 Additional context used
📓 Path-based instructions (2)
server/v2/cometbft/config.go (1)

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

server/v2/cometbft/server.go (1)

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

🔇 Additional comments (8)
server/v2/cometbft/config.go (3)

6-6: LGTM: New import added correctly.

The new import for the indexer package is correctly placed and necessary for the new Indexer field in the AppTomlConfig struct.


47-47: LGTM: Indexer field added to AppTomlConfig struct.

The Indexer field is correctly added to the AppTomlConfig struct with appropriate type, struct tags, and comment. This addition aligns well with the existing structure and style of the config.


27-31: LGTM: Indexer field added with default values.

The Indexer field is correctly added to the DefaultAppTomlConfig function. However, could you clarify the reasoning behind the empty string for Type and empty map for Config? Are these intended as placeholders for user configuration?

✅ Verification successful

Verified: Indexer field addition is appropriate and consistent.

All instances of indexer.Config initialization are confined to server/v2/cometbft/config.go and relevant test files. The empty Type and Config fields serve as intended default placeholders for user configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify if there are any other occurrences of indexer.Config initialization
rg --type go 'indexer\.Config\s*{'

Length of output: 138


Script:

#!/bin/bash
# Verify if there are any other occurrences of indexer.Config initialization with corrected regex
rg --type go 'indexer\.Config\s*\{'

Length of output: 252

tools/confix/data/v2-app.toml (3)

24-27: Clarify the indexer type configuration

The type field in the [comet.indexer] section is currently empty. This might lead to issues if a default indexer type is not automatically applied.

Could you please clarify if this is intentional or if a default value should be specified? If a default value is expected, consider adding it to the configuration.


93-93: Verify telemetry address change

The telemetry server address has been changed from 'localhost:1338' to 'localhost:1318'.

Could you please confirm if this change is intentional? If so, ensure that all relevant documentation and any dependent systems are updated to reflect this new address. If not, please revert to the original address.


Line range hint 24-93: Summary of configuration changes

The changes to v2-app.toml introduce new indexer configuration options and update the telemetry address. These modifications align with the PR objectives of initializing the indexer in server/v2. However, there are a few points that require attention:

  1. The indexer type is not specified.
  2. An unsupported indexer filter configuration is included.
  3. The telemetry address has been changed.

Please address the comments above to improve the clarity and reliability of the configuration file.

server/v2/cometbft/go.mod (1)

25-25: Dependency update looks good, but verify compatibility.

The update of cosmossdk.io/schema to version v0.3.1-0.20241010102526-3a03804c148d is in line with the PR objectives. However, as this appears to be a pre-release version, please ensure that it's compatible with the rest of the codebase and doesn't introduce any breaking changes.

To verify compatibility, please run the following commands:

server/v2/cometbft/server.go (1)

148-160: Initialization of the indexer is implemented correctly

The code correctly initializes the indexer when the Indexer configuration is provided and its Type is not empty. The logic integrates the indexer listener with the consensus, and error handling is appropriately implemented.

tools/confix/data/v2-app.toml Outdated Show resolved Hide resolved
@julienrbrt julienrbrt mentioned this pull request Oct 10, 2024
12 tasks
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: 3

🧹 Outside diff range and nitpick comments (3)
server/v2/cometbft/config.go (1)

46-46: LGTM: Indexer field added correctly to AppTomlConfig struct.

The Indexer field is properly added to the AppTomlConfig struct with appropriate tags and a descriptive comment. Its placement at the end of the struct follows the Uber Golang style guide recommendations for adding new fields.

Consider expanding the comment to provide more context about the indexer's purpose and its relationship to the SDK. For example:

Indexer indexer.IndexingConfig `mapstructure:"indexer" toml:"indexer" comment:"indexer defines the configuration for the SDK built-in indexer implementation, which is responsible for indexing application events and enabling efficient querying of blockchain data."`
server/v2/cometbft/server.go (2)

Line range hint 69-81: Avoid using panic for error handling

Using panic for error handling is discouraged, especially in libraries or servers, as it can cause the program to exit unexpectedly. Instead, return errors to allow the caller to handle them gracefully.

Apply this diff to handle errors without panicking:

 if chainID == "" {
     // fallback to genesis chain-id
     reader, err := os.Open(filepath.Join(home, "config", "genesis.json"))
     if err != nil {
-        panic(err)
+        return fmt.Errorf("failed to open genesis file: %w", err)
     }
     defer reader.Close()

     chainID, err = genutiltypes.ParseChainIDFromGenesis(reader)
     if err != nil {
-        panic(fmt.Errorf("failed to parse chain-id from genesis file: %w", err))
+        return fmt.Errorf("failed to parse chain-id from genesis file: %w", err)
     }
 }

23-28: Organize import statements according to Go conventions

Although import sorting is generally handled by tools, ensure that the import statements are grouped and ordered correctly as per Go conventions. Standard library imports should be grouped separately from third-party and project-specific imports.

Consider organizing imports like this:

 import (
     "context"
     "crypto/sha256"
     "encoding/json"
     "fmt"
     "os"
     "path/filepath"

+    // Standard library imports
+
     abciserver "github.com/cometbft/cometbft/abci/server"
     cmtcmd "github.com/cometbft/cometbft/cmd/cometbft/commands"
     cmtcfg "github.com/cometbft/cometbft/config"
     "github.com/cometbft/cometbft/node"
     "github.com/cometbft/cometbft/p2p"
     "github.com/cometbft/cometbft/proxy"
     "github.com/spf13/cobra"
     "github.com/spf13/pflag"

+    // Third-party imports
+
     "cosmossdk.io/core/transaction"
     "cosmossdk.io/log"
     "cosmossdk.io/schema/indexer"
     serverv2 "cosmossdk.io/server/v2"
     cometlog "cosmossdk.io/server/v2/cometbft/log"
     "cosmossdk.io/server/v2/cometbft/mempool"
     "cosmossdk.io/server/v2/store"
     "cosmossdk.io/store/v2/root"
     "cosmossdk.io/store/v2/snapshots"

+    // Project-specific imports
+
     genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
 )

Note: This ensures better readability and maintains consistency with the Go community standards.

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b866c06 and bd6f3a0.

⛔ Files ignored due to path filters (3)
  • server/v2/cometbft/go.sum is excluded by !**/*.sum
  • server/v2/go.sum is excluded by !**/*.sum
  • simapp/v2/go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • schema/indexer/start.go (2 hunks)
  • server/v2/cometbft/config.go (3 hunks)
  • server/v2/cometbft/go.mod (1 hunks)
  • server/v2/cometbft/server.go (2 hunks)
  • server/v2/go.mod (1 hunks)
  • server/v2/types.go (2 hunks)
  • simapp/v2/go.mod (1 hunks)
  • tools/confix/data/v2-app.toml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • server/v2/cometbft/go.mod
  • server/v2/go.mod
  • server/v2/types.go
  • simapp/v2/go.mod
  • tools/confix/data/v2-app.toml
🧰 Additional context used
📓 Path-based instructions (3)
schema/indexer/start.go (1)

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

server/v2/cometbft/config.go (1)

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

server/v2/cometbft/server.go (1)

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

🔇 Additional comments (4)
server/v2/cometbft/config.go (2)

6-6: LGTM: Import statement added correctly.

The new import for the indexer package is placed correctly and follows the Uber Golang style guide recommendations for import grouping and ordering.


27-30: LGTM: Indexer field initialized correctly in DefaultAppTomlConfig.

The Indexer field is properly initialized with default values. The use of make for the Target map and the default ChannelBufferSize of 1024 are appropriate. The initialization follows the struct field order, maintaining consistency with the AppTomlConfig struct definition.

schema/indexer/start.go (2)

54-54: LGTM: Enhanced field annotations and documentation.

The addition of mapstructure, toml, and json tags to the Target field improves its serialization capabilities. The added comment clearly describes the field's purpose, enhancing code readability and maintainability.


58-58: LGTM: Improved field type and annotations.

The ChannelBufferSize field has been improved by:

  1. Changing the type from *int to int, which simplifies usage and removes the need for nil checks.
  2. Adding mapstructure, toml, and json tags for better serialization support.
  3. Including a descriptive comment that explains the field's purpose and default value.

These changes enhance code clarity and usability.

schema/indexer/start.go Outdated Show resolved Hide resolved
server/v2/cometbft/server.go Outdated Show resolved Hide resolved
server/v2/cometbft/server.go Show resolved Hide resolved
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: 3

🧹 Outside diff range and nitpick comments (2)
server/v2/cometbft/config.go (1)

27-30: LGTM with a minor suggestion

The initialization of the new Indexer field in the DefaultAppTomlConfig function is well-structured and follows the Uber Golang style guide. The use of explicit field names enhances readability.

Consider replacing the magic number 1024 for ChannelBufferSize with a named constant or adding a comment to explain its significance. This would improve code maintainability and clarity.

const defaultIndexerChannelBufferSize = 1024

// ...

Indexer: indexer.IndexingConfig{
    Target:            make(map[string]indexer.Config),
    ChannelBufferSize: defaultIndexerChannelBufferSize, // Default buffer size for indexer channels
},
schema/indexer/start.go (1)

58-58: Improved field type and tags for ChannelBufferSize.

The changes to ChannelBufferSize are well-considered:

  • Changing from *int to int simplifies usage.
  • Added tags improve configuration parsing and serialization.
  • The comment clearly explains the field's purpose.

Consider adding a default value to the comment for completeness:

-comment:"Buffer size of the channels used for buffering data sent to indexer go routines."`
+comment:"Buffer size of the channels used for buffering data sent to indexer go routines. Default is 1024."`
📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between b866c06 and bd6f3a0.

⛔ Files ignored due to path filters (3)
  • server/v2/cometbft/go.sum is excluded by !**/*.sum
  • server/v2/go.sum is excluded by !**/*.sum
  • simapp/v2/go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • schema/indexer/start.go (2 hunks)
  • server/v2/cometbft/config.go (3 hunks)
  • server/v2/cometbft/go.mod (1 hunks)
  • server/v2/cometbft/server.go (2 hunks)
  • server/v2/go.mod (1 hunks)
  • server/v2/types.go (2 hunks)
  • simapp/v2/go.mod (1 hunks)
  • tools/confix/data/v2-app.toml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • server/v2/cometbft/go.mod
  • server/v2/go.mod
  • server/v2/types.go
  • simapp/v2/go.mod
  • tools/confix/data/v2-app.toml
🧰 Additional context used
📓 Path-based instructions (3)
schema/indexer/start.go (1)

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

server/v2/cometbft/config.go (1)

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

server/v2/cometbft/server.go (1)

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

🔇 Additional comments (3)
server/v2/cometbft/config.go (2)

6-6: LGTM: Import statement correctly added

The new import for the indexer package is correctly placed and follows the Uber Golang style guide for import grouping. This import is necessary for the new Indexer field in the AppTomlConfig structure.


45-46: LGTM: AppTomlConfig struct updated correctly

The addition of the Indexer field to the AppTomlConfig struct is well-implemented:

  1. It follows the Uber Golang style guide for struct field declarations.
  2. The comment clearly explains the purpose of the field.
  3. The new field is correctly placed at the end of the struct, which is a good practice for maintaining backward compatibility.
schema/indexer/start.go (1)

54-54: Improved struct field tags and documentation.

The addition of mapstructure and toml tags, along with the descriptive comment, enhances the Target field's usability and documentation. These changes improve configuration parsing and provide clear information about the field's purpose.

schema/indexer/start.go Outdated Show resolved Hide resolved
server/v2/cometbft/server.go Outdated Show resolved Hide resolved
server/v2/cometbft/server.go Outdated Show resolved Hide resolved
@cool-develope cool-develope added this pull request to the merge queue Oct 10, 2024
Merged via the queue into main with commit e84c0eb Oct 10, 2024
73 of 74 checks passed
@cool-develope cool-develope deleted the indexer/server_v2_init branch October 10, 2024 21:44
@julienrbrt
Copy link
Member

Noticed while fixing conflicts in #22323 that this should have been backported. Will do once the above pr is merged.

@julienrbrt
Copy link
Member

@Mergifyio backport release/v0.52.x

Copy link
Contributor

mergify bot commented Oct 21, 2024

backport release/v0.52.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Oct 21, 2024
Co-authored-by: Julien Robert <[email protected]>
(cherry picked from commit e84c0eb)

# Conflicts:
#	runtime/v2/app.go
#	runtime/v2/go.mod
#	schema/indexer/start.go
#	server/v2/cometbft/go.mod
#	server/v2/cometbft/go.sum
#	server/v2/cometbft/server.go
#	server/v2/config.go
#	server/v2/go.mod
#	server/v2/go.sum
#	server/v2/types.go
#	simapp/v2/go.mod
#	simapp/v2/go.sum
julienrbrt added a commit that referenced this pull request Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Confix Issues and PR related to Confix C:schema C:server/v2 cometbft C:server/v2 Issues related to server/v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexer config and implement the listener constructor in baseapp and server/v2