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
Full and archive nodes #293
Full and archive nodes #293
Conversation
priv_getCode API method (#145)
Include a section (in Pruning.md) about the difference between the two nodes and how to run them. Misc changes to the various pruning options and sync mode options. Signed-off-by: grantnoble <grant.noble@consensys.net>
Signed-off-by: grantnoble <grant.noble@consensys.net>
Signed-off-by: grantnoble <grant.noble@consensys.net>
Included a "Fast Synchronization" section in Pruning.md Signed-off-by: grantnoble <grant.noble@consensys.net>
Specifically: - Archive node is full sync and not pruned - Full node is fast sync and pruned - Pruning is default on for fast sync and off for full sync. Can turn pruning on/off explicitly if they so choose. - Full nodes have the current state, so can’t serve the network with any data request (i.e. balance of address X at block Y, where Y is old). You can guarantee the latest state for everything (and some older states, but not all). Signed-off-by: grantnoble <grant.noble@consensys.net>
Signed-off-by: grantnoble <grant.noble@consensys.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@@ -49,7 +49,7 @@ the revert reason as an ABI-encoded string. | |||
The revert reason is not included in the transactions receipts root hash. Not including the | |||
revert reason in the transactions receipts root hash means the revert reason is only available | |||
to nodes that execute the transaction when importing the block. That is, the revert reason is | |||
not available if using fast sync. | |||
not available if using fast synchronization (`--sync-mode=FAST`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a link to ../../Reference/CLI/CLI-Syntax.md#sync-mode ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
docs/Concepts/Pruning.md
Outdated
|
||
Besu supports two node types, commonly referred to as _full nodes_ and _archive nodes_. | ||
|
||
Full nodes have just the current state of the blockchain so cannot serve the network with all data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove the just
to reflect that they can have more than the current state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
Archive nodes require significantly more disk space (approximately 3TB) than full nodes | ||
(approximately 750GB). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe one thing we should add is that it is possible to re-generate all the data for an archive node using a full node (it's long, inconvenient, etc., but the data is not lost).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the process for this? If we say you can do it, we should document how.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not trivial, not something that most people will want to do (easier to just sync an archive node), but it just speaks to the security properties of a full node. Thinking about it again, I'm not sure how relevant it is here 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. We'll leave it as is. Thanks!
docs/Concepts/Pruning.md
Outdated
contract for every block since the genesis block. With an archive node you can do everything you | ||
do with a full node, as well as access historical state data. | ||
|
||
Archive nodes require significantly more disk space (approximately 3TB) than full nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth adding these are Besu numbers, as they differ from other client implementations, especially for full nodes. We should also precise this is for mainnet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
docs/Concepts/Pruning.md
Outdated
|
||
Instead of a full synchronization ([`--sync-mode=FULL`](../Reference/CLI/CLI-Syntax.md#sync-mode)), | ||
which starts from the genesis block and reprocesses all transactions, fast synchronization | ||
([`--sync-mode=FAST`](../Reference/CLI/CLI-Syntax.md#sync-mode)) downloads the transaction receipts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it also verify some blocks? I thought it did verify 1/n blocks, see: ethereum/go-ethereum#1889. I'm not sure if our implementation is the same, though. cc: @RatanRSur
Also, it's worth highlighting that past the pivot block, fast sync switches to full sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It verifies the chain of headers from the genesis until a block when it switches to processing blocks in their entirety (full sync as you mentioned).
I would mention that it downloads the headers but I wouldn't mention that it switches to full sync at because it's an implementation detail and isn't really something they can rely on. The guarantee we give them is that they'll have the full current state but we don't want them assuming they'll have full state from any previous block because the pivot block switches many times while downloading the world state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
docs/Concepts/Pruning.md
Outdated
|
||
Use pruning to reduce storage required for the world state. Pruning removes state trie nodes that | ||
are not required. | ||
Pruning reduces the storage required for the world state, removing state trie nodes that are not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it reduce the storage required by removing state trie nodes from previous states? cc: @RatanRSur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pruning reduces the storage required for by Besu by removing state trie nodes that are unreachable from recent blocks
You can then link to the option --pruning-blocks-retained
after the recent blocks statement to make it explicit how "recent" is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
Signed-off-by: grantnoble <grant.noble@consensys.net>
…thub.com/grantnoble/besu-docs into grantnoble-grantnoble-full-archive-nodes
Signed-off-by: grantnoble <grant.noble@consensys.net>
This combines the changes made in PR #283