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: fix multi-db env #2755

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
}

// startup ancient freeze
if err = chainDb.SetupFreezerEnv(&ethdb.FreezerEnv{
freezeDb := chainDb
if stack.CheckIfMultiDataBase() {
Copy link
Contributor

Choose a reason for hiding this comment

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

if stack.CheckIfMultiDataBase() && chainDb.BlockStore() != nil may be better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not appropriate to use chainDb.BlockStore() for validation because:

  1. When multi-database mode is enabled, chainDb.BlockStore() will return blockDb.
  2. When multi-database mode is disabled, chainDb.BlockStore() will return chainDb.

freezeDb = chainDb.BlockStore()
}
if err = freezeDb.SetupFreezerEnv(&ethdb.FreezerEnv{
ChainCfg: chainConfig,
BlobExtraReserve: config.BlobExtraReserve,
}); err != nil {
Expand Down
Loading