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(server/v2/cometbft): wire app closer #22240

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

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Oct 11, 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, 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 lifecycle management capability for the application with the addition of a closure for cleanup operations.
    • Expanded command-line interface with a new command for bootstrapping state.
    • Added methods for store access and application closure management in the SimApp.
  • Improvements

    • Enhanced resource management by ensuring proper closure of database connections.
  • Bug Fixes

    • Enhanced error handling in the testing framework to ensure robust validation of consensus methods.

@github-actions github-actions bot added C:server/v2 Issues related to server/v2 C:server/v2 cometbft labels Oct 11, 2024
@julienrbrt julienrbrt marked this pull request as ready for review October 11, 2024 18:51
Copy link
Contributor

coderabbitai bot commented Oct 11, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes in this pull request introduce a new function pointer appCloser to the Consensus struct for managing the application's lifecycle. The NewConsensus function signature is updated to include this parameter. Additionally, modifications are made to the CometBFTServer struct, including a new command in the CLI and updates to the AppI interface with a Close() method. The SimApp struct is also enhanced with GetStore and Close methods. These changes collectively improve lifecycle management and expand functionality without altering existing methods' logic.

Changes

File Change Summary
server/v2/cometbft/abci.go Added appCloser function pointer to Consensus struct and updated NewConsensus method signature to include it.
server/v2/cometbft/abci_test.go Updated import statements, modified builder initialization, changed setUpConsensus return type, and adjusted test function logic to accommodate new consensus setup.
server/v2/cometbft/server.go Added appI.Close parameter to NewConsensus call in Init method and introduced BootstrapStateCmd() method for CLI commands.
server/v2/types.go Added Close() method to AppI[T] interface for resource cleanup.
simapp/v2/app_di.go Added GetStore() and Close() methods to SimApp struct for better store access and custom closing logic.
store/v2/commitment/store.go Added db field to CommitStore struct and updated Close method to include database closure logic.
store/v2/root/factory.go Updated comment for SSType field in Options struct for clarity.
store/v2/root/store.go Added dbCloser field to Store struct and updated Close method to manage database closure.
store/v2/root/migrate_test.go Changed initialization of rootStore to use dbm.NewMemDB() instead of testLog.
store/v2/root/store_test.go Updated New function instantiation to use dbm.NewMemDB() in multiple test methods.
store/v2/root/upgrade_test.go Changed rootStore initialization in SetupTest and loadWithUpgrades methods to use s.commitDB.

Possibly related PRs

Suggested reviewers

  • facundomedica
  • sontrinh16
  • kocubinski
  • 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.

@julienrbrt julienrbrt changed the title fix(server/v2/cometbft): close app fix(server/v2/cometbft): wire app closer Oct 11, 2024
Copy link
Contributor

@julienrbrt your pull request is missing a changelog!

@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Oct 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: 1

🧹 Outside diff range and nitpick comments (5)
simapp/v2/app_di.go (1)

221-224: Consider the implications of exposing internal state.

The GetStore method provides direct access to the store field. While this can be useful for testing or debugging, it may violate encapsulation principles. Ensure that this exposure is necessary and doesn't lead to unexpected modifications of the store outside the SimApp struct.

Consider if there are more specific, controlled ways to provide necessary access to store functionality without exposing the entire RootStore.

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

BootstrapStateCmd lacks documentation and tests.

While the BootstrapStateCmd is properly implemented and integrated into the CLI, it currently lacks necessary documentation and corresponding tests. To ensure maintainability and reliability, please add comprehensive documentation and relevant tests for BootstrapStateCmd.

🔗 Analysis chain

Line range hint 271-271: LGTM. Verify implementation and documentation of BootstrapStateCmd.

The addition of s.BootstrapStateCmd() to the CLI commands expands the server's functionality, likely providing a way to bootstrap the application state.

Please ensure that the BootstrapStateCmd is properly implemented and documented. Run the following script to verify:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation and documentation of BootstrapStateCmd

# Test 1: Check for the implementation of BootstrapStateCmd
echo "Checking BootstrapStateCmd implementation:"
ast-grep --lang go --pattern 'func ($_) BootstrapStateCmd() *cobra.Command {
  $$$
}'

# Test 2: Check for documentation of BootstrapStateCmd
echo "Checking BootstrapStateCmd documentation:"
rg --type go 'BootstrapStateCmd' -B 5

# Test 3: Check for usage examples or tests of BootstrapStateCmd
echo "Checking for usage examples or tests of BootstrapStateCmd:"
rg --type go 'BootstrapStateCmd'

Length of output: 3639

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

675-675: Changes look good, but consider improving the new parameter.

The modifications to use appmanager.Builder and update the NewConsensus function call are correct and align with the import changes. However, the new parameter func() error { return nil } seems to be a placeholder.

Consider replacing the placeholder with a more meaningful function or add a comment explaining its purpose. For example:

func mockAppCloser() error {
    // This is a placeholder for application closing logic in tests
    return nil
}

// Then use mockAppCloser in the NewConsensus call

This would improve code readability and make the intention clearer.

Also applies to: 691-691

server/v2/cometbft/abci.go (2)

46-46: LGTM! Consider adding documentation for the new field.

The addition of the appCloser field to the Consensus struct is a good way to manage the application's lifecycle. It follows Go naming conventions and is appropriately unexported.

Consider adding a brief comment explaining the purpose of this field, e.g.:

// appCloser is a function used to close the application gracefully
appCloser func() error

81-81: LGTM! Consider refactoring for improved readability.

The addition of the appCloser parameter to the NewConsensus function and its initialization in the Consensus struct are correct and consistent with the struct modification.

The function signature is becoming quite long. Consider using a configuration struct to group related parameters, which could improve readability and make future additions easier. For example:

type ConsensusConfig[T transaction.Tx] struct {
    Logger           log.Logger
    AppName          string
    App              *appmanager.AppManager[T]
    AppCloser        func() error
    Mempool          mempool.Mempool[T]
    IndexedEvents    map[string]struct{}
    QueryHandlersMap map[string]appmodulev2.Handler
    Store            types.Store
    Config           Config
    TxCodec          transaction.Codec[T]
    ChainID          string
}

func NewConsensus[T transaction.Tx](cfg ConsensusConfig[T]) *Consensus[T] {
    // Use cfg fields to initialize the Consensus struct
}

This approach would make the function signature more concise and easier to maintain as the number of parameters grows.

Also applies to: 94-94

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4733fc1 and 9c2af67.

📒 Files selected for processing (5)
  • server/v2/cometbft/abci.go (3 hunks)
  • server/v2/cometbft/abci_test.go (3 hunks)
  • server/v2/cometbft/server.go (1 hunks)
  • server/v2/types.go (1 hunks)
  • simapp/v2/app_di.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
server/v2/cometbft/abci.go (1)

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

server/v2/cometbft/abci_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"

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/types.go (1)

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

simapp/v2/app_di.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)

24-24: LGTM: New method adheres to Go conventions.

The addition of the Close() error method to the AppI[T] interface is consistent with Go naming conventions and the Uber Go Style Guide. It follows the common pattern for cleanup methods in Go.

However, consider the following suggestions:

  1. Add a comment describing the purpose and expected behavior of the Close method.
  2. Ensure all existing implementations of AppI[T] are updated to include this new method.

Would you like me to propose a comment for the Close method?

To ensure all implementations are updated, run:

simapp/v2/app_di.go (1)

226-233: LGTM! Good error handling and resource management.

The Close method effectively overrides the base method to include closing the store. It demonstrates good practices:

  1. Proper error handling by checking and returning the error from store.Close().
  2. Ensuring the store is closed before calling the base Close method.
  3. Following the Uber Go Style Guide for error handling and method structure.

This implementation ensures proper resource management during the application shutdown process.

server/v2/cometbft/abci_test.go (2)

22-22: LGTM: Import statement addition is appropriate.

The addition of the appmanager import aligns with the changes made in the setUpConsensus function. This change is necessary and correctly implemented.


22-22: Overall changes are well-contained and don't affect existing tests.

The modifications to the import statements and the setUpConsensus function are well-contained and don't impact the existing test functions. This is a positive aspect of the changes as it minimizes the risk of unintended side effects.

To ensure that the changes don't have any unforeseen impacts, you may want to run the following command to check for any other occurrences of am.Builder that might need updating:

This will help verify that all instances have been updated consistently.

Also applies to: 675-675, 691-691

✅ Verification successful

Further verification needed to ensure all instances of am.Builder are addressed.

The previous search did not yield any results, which could mean that am.Builder is no longer used or that the search command had issues. To confirm, please run the following command:


All instances of am.Builder have been successfully removed.

No remaining occurrences of am.Builder were found in the codebase, ensuring that the changes are well-contained and do not impact other parts of the code.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

rg "am\.Builder" --type go

Length of output: 28


Script:

# Corrected command to search for 'am.Builder' in Go files
rg "am\\.Builder" --type go

Length of output: 28

@@ -107,6 +107,7 @@ func (s *CometBFTServer[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logg
s.logger,
appI.Name(),
appI.GetAppManager(),
appI.Close,
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistency Detected in NewConsensus Function Signature

The NewConsensus function is being called with an additional appI.Close parameter, but its signature does not reflect this change.

  • File: server/v2/cometbft/server.go
  • Issue: NewConsensus function signature missing the appI.Close parameter.
🔗 Analysis chain

LGTM. Verify consistency of appI.Close usage.

The addition of appI.Close to the NewConsensus function call enhances the application's lifecycle management. This change allows for graceful shutdown of the application.

Please ensure that this change is consistent with the NewConsensus function signature and its usage across the codebase. Run the following script to verify:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of NewConsensus function and appI.Close method

# Test 1: Check the NewConsensus function signature
echo "Checking NewConsensus function signature:"
ast-grep --lang go --pattern 'func NewConsensus($_) $_'

# Test 2: Check for other occurrences of NewConsensus function calls
echo "Checking other NewConsensus function calls:"
rg --type go 'NewConsensus\(' -A 10 -B 2

# Test 3: Check for the definition and usage of Close method in AppI interface
echo "Checking AppI interface for Close method:"
ast-grep --lang go --pattern 'type AppI[T $_] interface {
  $$$
  Close() $_
  $$$
}'

Length of output: 1613

@github-actions github-actions bot added the C:Confix Issues and PR related to Confix label Oct 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 (1)
store/v2/commitment/store.go (1)

504-505: LGTM with suggestion: Updated Close method

The addition of c.db.Close() in the Close method is a good improvement for proper resource management. However, consider enhancing the error handling to ensure all resources are closed even if an error occurs.

Consider updating the Close method to ensure all resources are closed and errors are properly aggregated:

 func (c *CommitStore) Close() error {
+    var errs []error
     for _, tree := range c.multiTrees {
         if err := tree.Close(); err != nil {
-            return err
+            errs = append(errs, err)
         }
     }
-    return c.db.Close()
+    if err := c.db.Close(); err != nil {
+        errs = append(errs, err)
+    }
+    return errors.Join(errs...)
 }

This change ensures that all trees and the database are closed, and all errors are reported.

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 9c2af67 and 029d19f.

📒 Files selected for processing (5)
  • server/v2/testdata/app.toml (1 hunks)
  • store/v2/commitment/metadata.go (1 hunks)
  • store/v2/commitment/store.go (3 hunks)
  • store/v2/root/factory.go (1 hunks)
  • tools/confix/data/v2-app.toml (1 hunks)
✅ Files skipped from review due to trivial changes (4)
  • server/v2/testdata/app.toml
  • store/v2/commitment/metadata.go
  • store/v2/root/factory.go
  • tools/confix/data/v2-app.toml
🧰 Additional context used
📓 Path-based instructions (1)
store/v2/commitment/store.go (1)

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

🔇 Additional comments (2)
store/v2/commitment/store.go (2)

41-41: LGTM: Addition of db field to CommitStore struct

The new db field of type corestore.KVStoreWithBatch is a good addition to the CommitStore struct. It provides a clear way to manage the database instance and ensures proper resource management.


50-53: LGTM: Updated NewCommitStore function

The NewCommitStore function has been correctly updated to include the db parameter and initialize it in the returned CommitStore instance. This change is consistent with the struct modification and follows good Go practices.

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 (2)
store/v2/root/upgrade_test.go (1)

Line range hint 1-168: Summary: Consistent changes to rootStore initialization. Ensure comprehensive testing.

The changes in this file are focused and consistent, modifying the rootStore initialization in both the SetupTest and loadWithUpgrades methods. While these changes are minimal, they could significantly impact test behavior by altering how the rootStore interacts with the database.

To ensure the integrity of the test suite:

  1. Run the entire test suite for the store/v2/root package to catch any potential regressions.
  2. Consider adding specific tests to verify the behavior of the rootStore with the new initialization parameters.
  3. If possible, conduct integration tests to ensure these changes don't affect the broader system behavior.
#!/bin/bash
# Run all tests in the store/v2/root package
go test -v ./store/v2/root/...
store/v2/root/migrate_test.go (1)

83-83: LGTM with a minor suggestion for clarity.

The change correctly adds an in-memory database as the first argument to the New function, which is appropriate for testing purposes. This modification aligns with an updated New function signature in the root package.

For improved clarity, consider naming the new database instance:

- s.rootStore, err = New(dbm.NewMemDB(), testLog, ss, orgSC, pm, migrationManager, nil)
+ memDB := dbm.NewMemDB()
+ s.rootStore, err = New(memDB, testLog, ss, orgSC, pm, migrationManager, nil)

This change would make it more explicit that we're using an in-memory database for testing.

📜 Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 029d19f and 9b6e888.

📒 Files selected for processing (5)
  • store/v2/root/factory.go (2 hunks)
  • store/v2/root/migrate_test.go (1 hunks)
  • store/v2/root/store.go (5 hunks)
  • store/v2/root/store_test.go (3 hunks)
  • store/v2/root/upgrade_test.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • store/v2/root/factory.go
🧰 Additional context used
📓 Path-based instructions (4)
store/v2/root/migrate_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"

store/v2/root/store.go (1)

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

store/v2/root/store_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"

store/v2/root/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"

🔇 Additional comments (9)
store/v2/root/upgrade_test.go (2)

95-95: LGTM. Consistent with previous change.

This modification aligns with the earlier change in the SetupTest method, maintaining consistency in how the rootStore is initialized throughout the test suite. The use of s.commitDB instead of testLog as the first argument in the New function call is appropriate.


53-53: LGTM. Verify the impact of this change on test behavior.

The modification to use s.commitDB instead of testLog as the first argument in the New function call appears intentional and aligns with the PR objectives. This change may alter how the rootStore interacts with the database during tests.

To ensure this change doesn't introduce unexpected behavior, please verify:

  1. All tests in this file still pass.
  2. The rootStore initialization behaves as expected with this new parameter.
store/v2/root/migrate_test.go (1)

Line range hint 1-180: Comprehensive test coverage for store migration.

The test file provides thorough coverage of the store migration process:

  1. It sets up both original and new stores.
  2. Tests querying during different stages of migration.
  3. Simulates applying changesets before, during, and after migration.
  4. Includes checks for version consistency and data integrity.

The use of delays to simulate consensus processes adds realism to the test scenario. The comprehensive coverage across different versions and store keys ensures robustness of the migration process.

Great job on maintaining such a detailed test suite!

store/v2/root/store.go (4)

8-8: LGTM: Import addition is appropriate.

The addition of the "io" import is necessary and consistent with the new dbCloser field in the Store struct.


37-39: LGTM: New field addition is appropriate and well-documented.

The addition of the dbCloser io.Closer field to the Store struct is a good practice for managing the database instance's lifecycle. The comment above the field clearly explains its purpose.


75-75: LGTM: Function signature update and field initialization are correct.

The New function has been appropriately updated to include the dbCloser parameter, and the dbCloser field is correctly initialized in the returned Store instance.

Also applies to: 84-84


101-101: LGTM: Proper closure of dbCloser added.

The Close method has been correctly updated to include the closure of the dbCloser. The use of errors.Join for error handling is a good practice for aggregating multiple errors.

store/v2/root/store_test.go (2)

96-96: ⚠️ Potential issue

Consistent change across methods, but overall impact on tests needs clarification.

This change in newStoreWithBackendMount is consistent with the modifications in SetupTest and newStoreWithPruneConfig. However, replacing noopLog with dbm.NewMemDB() across all these methods raises concerns about the overall impact on the test suite.

  1. It changes the type of the first argument from a logger to a database in all New function calls.
  2. This modification could potentially alter the behavior of various tests, including those for pruning and custom backend mounts.
  3. The rationale behind using a database where a logger was previously used is unclear and needs explanation.

Please provide a comprehensive explanation of why this change was made across all methods and how it affects the test suite's behavior and reliability. Additionally, ensure that these changes align with any updates made to the New function in the main implementation.

To verify the impact of these changes on the test suite, we can check for any failing tests:

#!/bin/bash
# Description: Run the tests in the package and check for any failures
go test ./store/v2/root/... -v

62-62: ⚠️ Potential issue

Clarify the rationale for replacing logger with in-memory database.

The change from noopLog to dbm.NewMemDB() as the first argument in the New function call is unexpected. These serve different purposes - a logger for logging and a database for data storage. This modification could significantly alter the test setup and potentially the behavior of the RootStore in tests. Could you please explain the reasoning behind this change and confirm if this is intentional?

To verify the impact of this change, we can check if the New function signature has been updated in the main implementation:

@@ -84,7 +84,7 @@ func (s *RootStoreTestSuite) newStoreWithPruneConfig(config *store.PruningOption

pm := pruning.NewManager(sc, ss, config, config)

rs, err := New(noopLog, ss, sc, pm, nil, nil)
rs, err := New(dbm.NewMemDB(), noopLog, ss, sc, pm, nil, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Consistent change, but concerns remain about logger replacement.

This change is consistent with the modification in SetupTest, replacing noopLog with dbm.NewMemDB(). However, the same concerns apply here. Replacing a logger with an in-memory database in the New function call could potentially alter the behavior of pruning tests. Please confirm if this change is intentional and explain how it affects the test setup for pruning configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release C:Confix Issues and PR related to Confix C:server/v2 cometbft C:server/v2 Issues related to server/v2 C:Store
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants