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

Root Account File Updater / Trimmer #133

Open
buckyroberts opened this issue Jan 15, 2021 · 0 comments
Open

Root Account File Updater / Trimmer #133

buckyroberts opened this issue Jan 15, 2021 · 0 comments
Assignees

Comments

@buckyroberts
Copy link
Collaborator

New (updated) logic

For this task we are creating an updated Root Account File. The purpose of this is to provide more frequent on-disk backups of account information and allow for faster syncing for new validators coming onto the network.

Documentation:

Old (original) logic

This is older logic from the previous GitHub issue. I wanted to leave it in here as reference though since it does a good job of explaining the problem we are solving.

Basic steps:

  1. Read the HEAD_BLOCK_HASH into memory (this will mark where to stop)
  2. Read in all account data from the SelfConfig.root_account_file
  3. Starting with the first block in the blockchain (find using get_initial_block_identifier()) apply the updated_balances changes to the new temporary root account file
  4. Continue along the blockchain until reaching the stored HEAD_BLOCK_HASH (end of the blockchain)
  5. Once the new root account file has been generated, update the following SelfConfiguration fields root_account_file, root_account_file_hash, and seed_block_identifier

Blank diagram (1)

Notes:

  • This will be a periodic task scheduled using celery beat - it will run every hour
  • We can't simply make a backup from the Account table due to performance issues/race conditions

For reference:

ConfirmationValidatorSyncing

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

No branches or pull requests

2 participants