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: adaptive for loading journal file or journal kv during loadJournal #2406

Merged
merged 4 commits into from
Apr 19, 2024

Conversation

jingjunLi
Copy link
Contributor

@jingjunLi jingjunLi commented Apr 18, 2024

Description

During loading, If it is not necessary to judge based on --journalfile, handle it based on the existence of journalkv or journalfile;

  • If trieJournal exists in the database, load it from the database first;
  • If the journal file exists, load it from the journal file;
  • If neither exists, treat it as a kv;

During persistence:
Handle it based on --journalfile, without considering whether it was journalkv or journalfile before;

Verification cases:

  • Start and shut down using the kv method; Verify (type: journal kv);
  • Start by specifying --journalfile to use journal file, and verify if it can start (type: journal kv), then shut down to save (type: journal file); Verify block tracking;
  • Start using the kv method again (type: journal file); Verify block tracking; then shut down to save (type: journal kv); Verify block tracking again;
  • Start by specifying --journalfile;

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

@jingjunLi jingjunLi requested a review from zzzckck as a code owner April 18, 2024 08:07
@jingjunLi jingjunLi changed the title feat: journal file convert feat: Adaptive adaptation for loading journal file or journal kv during loadJournal Apr 18, 2024
@jingjunLi jingjunLi changed the title feat: Adaptive adaptation for loading journal file or journal kv during loadJournal feat: Adaptive for loading journal file or journal kv during loadJournal Apr 18, 2024
@jingjunLi jingjunLi changed the title feat: Adaptive for loading journal file or journal kv during loadJournal feat: adaptive for loading journal file or journal kv during loadJournal Apr 18, 2024
triedb/pathdb/database.go Outdated Show resolved Hide resolved
triedb/pathdb/journal.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fynnss fynnss 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 d653cda into bnb-chain:develop Apr 19, 2024
7 checks passed
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.

None yet

3 participants