-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-discussionA discussion about the direction and design of the projectA discussion about the direction and design of the project
Milestone
Description
High Level
Some draft on the snapshots
and full node
high level specs. Joining them here since they do share some important similarities, and it might help to keep that in mind. They both work on sliding window intervals during syncing, and any table that can be pruned is a candidate for a snapshot file in the end.
Categories (prunable or moveable to snapshots)
- Historical:
AccountChangeSet
/StorageChangeSet
/AccountHistory
/StorageHistory
- Transactions:
Transactions
/TxSenders
/TxLookup
/TxHashNumber
/TransactionBlock
Receipts
Full Node:
- Default pruning. keep data related to the most 256 recent blocks.
- Any table which has a
BlockNumber
orTxNumber
as key is a candidate for pruning. - Customization on what are the most recent blocks [ allow keeping none of the block data, apart from state after verifying ]
- Each category can be fully pruned (eg. no receipts) if desired so.
- Prune levels should allow skipping certain stages (eg.
TxSenders
/TxLookup
)
Snapshots:
- Fixed interval. [ Every N blocks, or every N transactions ]
- Any table which has a
BlockNumber
orTxNumber
as key is a candidate for moving to static files. - Reproducible snapshots. Should include an option to sync from beginning and let the node create all its own snapshots. They should match existing ones.
- Shared through a centralized host and/or p2p
- Static file per category or per table
- Perfect hashing table for keys
- Compressed values (overall dictionary (across 0 - 17M blocks) / per file / or both [double compression])
Syncing
-
Full node:
- Requests block height from CL.
- Sync with pruned options. [eg. don't store/calculate changesets until the most recent blocks or receipt or TxSenders etc.].
- When approaching a block number close to
block_height - 256
, recheck latest block height. - Once it reaches the desired height, register process to
wake-up register
(more on it below) and sleep.
-
Snapshots:
- ??
Tip
Register
- Wake-up register [condition -> wake-up registered process (channel) -> execute]
- Loop through registered processes
- If condition is met, wake-up registered process
- Execute. [full-node: clean-up tables | snapshot: move from tables]
- Either on success or failure, update the condition with a new one.
- Once a block has been handled check wake-up register conditions. [eg. static file waits for an exact block height while full node might execute every N blocks]
Priority
- Full node syncing
- Wake-up register
- Full-node @ tip wake-up process (registration & table clean-up)
- Snapshot @ tip wake-up process (registration & moving table data )
- Snapshot syncing
dzmitry-lahoda and shunkakinoki
Metadata
Metadata
Assignees
Labels
C-discussionA discussion about the direction and design of the projectA discussion about the direction and design of the project
Type
Projects
Status
Done