You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, the LedgerDB supports a "memory policy" that specifies precisely at which points we store snapshots (e.g., one at the tip, one 10 back to support short chains, and one k back, to support maximum rollback).
This strong guarantee comes with two important drawbacks however.
Because there are gaps between these snapshots, we have to update each of them independently whenever we push a new block. Not only does this duplicate work, it also means that there can be very little sharing between them.
We have to traverse the entire list of k elements every time we process a block. This is of no concern during normal operation, but can become a bottleneck during syncing.
Instead we should simplify the "policy" to a mere number indicating how often we want to take a snapshot, and allow snapshots to gradually get older. For example, if the state is a triple (tip, n, history) where n is a countdown to the next snapshot, the state could evolve something like
(setting the "policy" to 2). Now we get full sharing, and moreover, adding a block is just a single update to the ledger state and a single append to the history (+ a single pattern match to remove the oldest, once we reach k).
The text was updated successfully, but these errors were encountered:
At the moment, the
LedgerDB
supports a "memory policy" that specifies precisely at which points we store snapshots (e.g., one at the tip, one 10 back to support short chains, and onek
back, to support maximum rollback).This strong guarantee comes with two important drawbacks however.
k
elements every time we process a block. This is of no concern during normal operation, but can become a bottleneck during syncing.Instead we should simplify the "policy" to a mere number indicating how often we want to take a snapshot, and allow snapshots to gradually get older. For example, if the state is a triple
(tip, n, history)
wheren
is a countdown to the next snapshot, the state could evolve something like(setting the "policy" to 2). Now we get full sharing, and moreover, adding a block is just a single update to the ledger state and a single append to the history (+ a single pattern match to remove the oldest, once we reach
k
).The text was updated successfully, but these errors were encountered: