Skip to content

Root Account File Updater / Trimmer #133

@buckyroberts

Description

@buckyroberts

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions