Skip to content

cmd, core: resolve scheme from a read-write database and refactor resolveChainFreezerDir func#2155

Merged
zzzckck merged 3 commits intobnb-chain:developfrom
sysvm:fix-prunestate
Jan 22, 2024
Merged

cmd, core: resolve scheme from a read-write database and refactor resolveChainFreezerDir func#2155
zzzckck merged 3 commits intobnb-chain:developfrom
sysvm:fix-prunestate

Conversation

@sysvm
Copy link
Copy Markdown
Contributor

@sysvm sysvm commented Jan 12, 2024

Description

This pull request solves four pull requests: #2110, #2131, #2141, #2146

  1. The first question: resolve state scheme from a read-write database:

This issue can occur when unclean shutdown happens and freezer tables need to be repair. In database read-only mode, the freezer will only be validated but not repair and terminates the node abnormally.
This pull request moves the scheme check into the Ethereum constructor where the read-write database is already initialized. This approach can avoid opening read-only database in very early stage, to prevent this error totally.

  1. The second question: ancient directory should be compatible with hash and path mode:

Current geth doesn't deal with chain freezer dir in a good way. Therefore, this pr refactors resolveChainFreezerDir to fix in pruned and non-pruned mode.

Rationale

These will influence how should users use pruenancient mode that block data could be replaced in which.

Example

N/A

Changes

Notable changes:

  • N/A

rjl493456442 and others added 2 commits January 12, 2024 14:47
* cmd, core: resolve scheme from a read-write database

* cmd, core, eth: move the scheme check in the ethereum constructor

* cmd/geth: dump should in ro mode

* cmd: reverts
zzzckck
zzzckck previously approved these changes Jan 12, 2024
Copy link
Copy Markdown
Collaborator

@zzzckck zzzckck left a comment

Choose a reason for hiding this comment

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

LGTM, same as #2135

@joey0612 joey0612 changed the title cmd, core: resolve scheme from a read-write database and refactor resolveChainFreezerDir func [WIP] cmd, core: resolve scheme from a read-write database and refactor resolveChainFreezerDir func Jan 15, 2024
@joey0612 joey0612 added the wip work in process label Jan 15, 2024
RenRick
RenRick previously approved these changes Jan 15, 2024
Copy link
Copy Markdown

@RenRick RenRick left a comment

Choose a reason for hiding this comment

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

LGTM

@sysvm sysvm dismissed stale reviews from RenRick and zzzckck via a17fef4 January 15, 2024 03:09
@sysvm sysvm changed the title [WIP] cmd, core: resolve scheme from a read-write database and refactor resolveChainFreezerDir func cmd, core: resolve scheme from a read-write database and refactor resolveChainFreezerDir func Jan 18, 2024
@sysvm sysvm added r4r ready for review and removed wip work in process labels Jan 18, 2024
Copy link
Copy Markdown

@RenRick RenRick left a comment

Choose a reason for hiding this comment

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

LGTM

@zzzckck zzzckck merged commit ef462c2 into bnb-chain:develop Jan 22, 2024
@sysvm
Copy link
Copy Markdown
Contributor Author

sysvm commented Jan 22, 2024

After this pr is merged, 48Club needs to use new release version to run geth. Because current PBSS snapshot is incorrect, there is no state directory in ancient directory. Use new version to generate state directory.

@du5
Copy link
Copy Markdown

du5 commented Jan 22, 2024

After this pr is merged, 48Club needs to use new release version to run geth. Because current PBSS snapshot is incorrect, there is no state directory in ancient directory. Use new version to generate state directory.

thank you for everything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r4r ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants