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
An archive node is an instance of an Ethereum client configured to build an archive of all historical states. There are two queries that it needs to answer:
the account information at the given block
the storage information at the given block for the given account.
This means that both queries could be transformed into a query that:
starts with the account = @account equality,
then is followed by storage = @storage (for storage)
then is followed by block <= @block as the change might have been applied in the past
It should be possible then to use the same db structure where the key is encoded as a NibblePath by concatenating account + storage + block and mapping some payload to it. This concatenation would allow Paprika's prefixing behavior to potentially make the dataset smaller. Potentially a separate page type with a different flushing behavior and a different fan out could be applied.
From the consumption point of view, archive processing could be a sidecar that processes storage & state slots that are flushed by the Blockchain.FlusherTask method. Then, each block that is applied could be inspected and applied to a separate archive root. This could be done by extending RootPage by only one address that would point to the separate Archive tree.
Remarks:
The application of the data could be done in a relaxed manner, where the flush to disk happens only now and then. There are options for this already.
Storing or calculating hashes, could be made optional.
Querying the state should take into consideration the transient in memory state and the archive.
The other option is to have the Archive totally separated. That could be considered, but there's something into having it embedded into the block processing, where the data are fresh, in-memory and ready to be stored by this archiving sidecar.
The text was updated successfully, but these errors were encountered:
There should be a (slow) way to support deep reorganistations with archive storage.
I expect archive storage to be indexed by block (or each transactions within blocks), it would be good to have an option to prune archive storage, keeping some arbitrary number of blocks there (for example from only last year or month).
Scooletz
added
the
ethereum
An Ethereum specific work item that requires a good understanding of Eth
label
Aug 3, 2023
An archive node is an instance of an Ethereum client configured to build an archive of all historical states. There are two queries that it needs to answer:
account
information at the givenblock
storage
information at the givenblock
for the givenaccount
.This means that both queries could be transformed into a query that:
account = @account
equality,storage = @storage
(for storage)block <= @block
as the change might have been applied in the pastIt should be possible then to use the same db structure where the key is encoded as a
NibblePath
by concatenatingaccount + storage + block
and mapping some payload to it. This concatenation would allow Paprika's prefixing behavior to potentially make the dataset smaller. Potentially a separate page type with a different flushing behavior and a different fan out could be applied.From the consumption point of view, archive processing could be a sidecar that processes storage & state slots that are flushed by the
Blockchain.FlusherTask
method. Then, each block that is applied could be inspected and applied to a separate archive root. This could be done by extendingRootPage
by only one address that would point to the separateArchive
tree.Remarks:
The text was updated successfully, but these errors were encountered: