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

Change ancient chain segments from root ancient to sub folders #572

Conversation

huyngopt1994
Copy link
Collaborator

@huyngopt1994 huyngopt1994 commented Sep 12, 2024

Reference ethereum/go-ethereum#25487 .

Before The chain segment should be stored in <chaindata/ancient>. Now it will locate in <chaindata/ancient/chain> in case u start the new disk, otherwise support backward compatibility

Handling main idea is here.

	if !common.FileExist(freezer) {
		if !common.FileExist(ancient) {
			// The entire ancient store is not initialized, still use the sub
			// folder for initialization.
		} else {
			// Ancient root is already initialized, then we hold the assumption
			// that chain freezer is also initialized and located in root folder.
			// In this case fallback to legacy location.
			freezer = ancient
			log.Info("Found legacy ancient chain path", "location", ancient)
		}
	}

@huyngopt1994 huyngopt1994 force-pushed the change-ancient-chain-segments-from-root-ancient-to-sub-folders branch 3 times, most recently from 3dbf061 to 8b76648 Compare September 13, 2024 04:06
@huyngopt1994 huyngopt1994 force-pushed the change-ancient-chain-segments-from-root-ancient-to-sub-folders branch from 8b76648 to 8f8fb65 Compare September 13, 2024 06:40
@huyngopt1994 huyngopt1994 merged commit 5dc0bd6 into path-base-implementing Sep 13, 2024
1 check passed
@huyngopt1994 huyngopt1994 deleted the change-ancient-chain-segments-from-root-ancient-to-sub-folders branch September 13, 2024 08:49
Francesco4203 pushed a commit to Francesco4203/ronin that referenced this pull request Sep 16, 2024
huyngopt1994 added a commit that referenced this pull request Sep 17, 2024
* cmd, core, ethdb, node: rework ancient store folder reference by ethereum/go-ethereum@e44d655
huyngopt1994 added a commit that referenced this pull request Oct 25, 2024
* cmd, core, ethdb, node: rework ancient store folder reference by ethereum/go-ethereum@e44d655
huyngopt1994 added a commit that referenced this pull request Nov 21, 2024
* cmd, core, ethdb, node: rework ancient store folder reference by ethereum/go-ethereum@e44d655
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.

2 participants