docs(book): pruning & full node RPC breakdown & improvements (#4428)

This commit is contained in:
Alexey Shekhirin
2023-08-31 13:34:27 +01:00
committed by GitHub
parent edf31806d8
commit 71cbddc233
3 changed files with 155 additions and 21 deletions

View File

@ -1,4 +1,4 @@
# Pruning
# Pruning & Full Node
> Pruning and full node are new features of Reth,
> and we will be happy to hear about your experience using them either
@ -26,6 +26,12 @@ the initial sync. Turning Archive into Pruned, or Pruned into Full is not suppor
Default mode, follow the steps from the previous chapter on [how to run on mainnet or official testnets](./mainnet.md).
### Pruned Node
To run Reth as a pruned node configured through a [custom configuration](./config.md#the-prune-section),
modify the `reth.toml` file and run Reth in the same way as archive node by following the steps from
the previous chapter on [how to run on mainnet or official testnets](./mainnet.md).
### Full Node
To run Reth as a full node, follow the steps from the previous chapter on
@ -38,31 +44,21 @@ RUST_LOG=info reth node \
--authrpc.port 8551
```
### Pruned Node
To run Reth as a pruned node configured through a [custom configuration](./config.md#the-prune-section),
modify the `reth.toml` file and run Reth in the same way as archive node by following the steps from
the previous chapter on [how to run on mainnet or official testnets](./mainnet.md).
## Size
All numbers are as of August 2023 at block number 17.9M for mainnet.
### Archive
### Archive Node
Archive node occupies at least 2.1TB.
You can track the growth of Reth archive node size with our
[public Grafana dashboard](https://reth.paradigm.xyz/d/2k8BXz24k/reth?orgId=1&refresh=30s&viewPanel=52).
### Full
Full node occupies 1TB at the peak, and slowly goes down to 920GB.
### Pruned
### Pruned Node
Different parts take up different amounts of disk space.
If pruned fully, this is the total freed space you'll get, per part:
If pruned fully, this is the total freed space you'll get, per part:
| Part | Size |
|--------------------|-------|
@ -72,6 +68,42 @@ If pruned fully, this is the total freed space you'll get, per part:
| Account History | 230GB |
| Storage History | 680GB |
### Full Node
Full node occupies at least 950GB.
Essentially, the full node is the same as following configuration for the pruned node:
```toml
[prune]
block_interval = 5
[prune.parts]
sender_recovery = { distance = 128 }
# transaction_lookup is not pruned
receipts = { before = 11052984 } # Beacon Deposit Contract deployment block: https://etherscan.io/tx/0xe75fb554e433e03763a1560646ee22dcb74e5274b34c5ad644e7c0f619a7e1d0
account_history = { distance = 128 }
storage_history = { distance = 128 }
[prune.parts.receipts_log_filter]
# Prune all receipts, leaving only those which contain logs from address `0x00000000219ab540356cbb839cbe05303d7705fa`,
# starting from the block 11052984. This leaves receipts with the logs from the Beacon Deposit Contract.
"0x00000000219ab540356cbb839cbe05303d7705fa" = { before = 11052984 }
```
Meaning, it prunes:
- Account History and Storage History up to the last 128 blocks
- Sender Recovery up to the last 128 blocks. The caveat is that it's pruned gradually after the initial sync
is completed, so the disk space is reclaimed slowly.
- Receipts up to the last 128 blocks, preserving all receipts with the logs from Beacon Deposit Contract
Given the aforementioned part sizes, we get the following full node size:
```text
Archive Node - Receipts - AccountHistory - StorageHistory = Full Node
```
```text
2.1TB - 240GB - 230GB - 680GB = 950GB
```
## RPC support
As it was mentioned in the [pruning configuration chapter](./config.md#the-prune-section), there are several parts
@ -85,11 +117,113 @@ which can be pruned independently of each other:
Pruning of each of these parts disables different RPC methods, because the historical data or lookup indexes
become unavailable.
### Full Node
The following tables describe RPC methods available in the full node.
#### `debug` namespace
| RPC | Note |
|----------------------------|----------------------------------------------------------|
| `debug_getRawBlock` | |
| `debug_getRawHeader` | |
| `debug_getRawReceipts` | Only for the last 128 blocks and Beacon Deposit Contract |
| `debug_getRawTransaction` | |
| `debug_traceBlock` | Only for the last 128 blocks |
| `debug_traceBlockByHash` | Only for the last 128 blocks |
| `debug_traceBlockByNumber` | Only for the last 128 blocks |
| `debug_traceCall` | Only for the last 128 blocks |
| `debug_traceCallMany` | Only for the last 128 blocks |
| `debug_traceTransaction` | Only for the last 128 blocks |
#### `eth` namespace
| RPC / Part | Note |
|-------------------------------------------|----------------------------------------------------------|
| `eth_accounts` | |
| `eth_blockNumber` | |
| `eth_call` | Only for the last 128 blocks |
| `eth_chainId` | |
| `eth_createAccessList` | Only for the last 128 blocks |
| `eth_estimateGas` | Only for the last 128 blocks |
| `eth_feeHistory` | |
| `eth_gasPrice` | |
| `eth_getBalance` | Only for the last 128 blocks |
| `eth_getBlockByHash` | |
| `eth_getBlockByNumber` | |
| `eth_getBlockReceipts` | Only for the last 128 blocks and Beacon Deposit Contract |
| `eth_getBlockTransactionCountByHash` | |
| `eth_getBlockTransactionCountByNumber` | |
| `eth_getCode` | |
| `eth_getFilterChanges` | |
| `eth_getFilterLogs` | Only for the last 128 blocks and Beacon Deposit Contract |
| `eth_getLogs` | Only for the last 128 blocks and Beacon Deposit Contract |
| `eth_getStorageAt` | Only for the last 128 blocks |
| `eth_getTransactionByBlockHashAndIndex` | |
| `eth_getTransactionByBlockNumberAndIndex` | |
| `eth_getTransactionByHash` | |
| `eth_getTransactionCount` | Only for the last 128 blocks |
| `eth_getTransactionReceipt` | Only for the last 128 blocks and Beacon Deposit Contract |
| `eth_getUncleByBlockHashAndIndex` | |
| `eth_getUncleByBlockNumberAndIndex` | |
| `eth_getUncleCountByBlockHash` | |
| `eth_getUncleCountByBlockNumber` | |
| `eth_maxPriorityFeePerGas` | |
| `eth_mining` | |
| `eth_newBlockFilter` | |
| `eth_newFilter` | |
| `eth_newPendingTransactionFilter` | |
| `eth_protocolVersion` | |
| `eth_sendRawTransaction` | |
| `eth_sendTransaction` | |
| `eth_sign` | |
| `eth_signTransaction` | |
| `eth_signTypedData` | |
| `eth_subscribe` | |
| `eth_syncing` | |
| `eth_uninstallFilter` | |
| `eth_unsubscribe` | |
#### `net` namespace
| RPC / Part |
|-----------------|
| `net_listening` |
| `net_peerCount` |
| `net_version` |
#### `trace` namespace
| RPC / Part | Note |
|---------------------------------|------------------------------|
| `trace_block` | Only for the last 128 blocks |
| `trace_call` | Only for the last 128 blocks |
| `trace_callMany` | Only for the last 128 blocks |
| `trace_get` | Only for the last 128 blocks |
| `trace_rawTransaction` | Only for the last 128 blocks |
| `trace_replayBlockTransactions` | Only for the last 128 blocks |
| `trace_replayTransaction` | Only for the last 128 blocks |
| `trace_transaction` | Only for the last 128 blocks |
#### `txpool` namespace
| RPC / Part |
|----------------------|
| `txpool_content` |
| `txpool_contentFrom` |
| `txpool_inspect` |
| `txpool_status` |
### Pruned Node
The following tables describe the requirements for prune parts, per RPC method:
- if the part is pruned, the RPC method still works
- ❌ - if the part is pruned, the RPC method doesn't work anymore
### `debug` namespace
#### `debug` namespace
| RPC / Part | Sender Recovery | Transaction Lookup | Receipts | Account History | Storage History |
|----------------------------|-----------------|--------------------|----------|-----------------|-----------------|
@ -105,7 +239,7 @@ The following tables describe the requirements for prune parts, per RPC method:
| `debug_traceTransaction` | ✅ | ✅ | ✅ | ❌ | ❌ |
### `eth` namespace
#### `eth` namespace
| RPC / Part | Sender Recovery | Transaction Lookup | Receipts | Account History | Storage History |
|-------------------------------------------|-----------------|--------------------|----------|-----------------|-----------------|
@ -153,7 +287,7 @@ The following tables describe the requirements for prune parts, per RPC method:
| `eth_uninstallFilter` | ✅ | ✅ | ✅ | ✅ | ✅ |
| `eth_unsubscribe` | ✅ | ✅ | ✅ | ✅ | ✅ |
### `net` namespace
#### `net` namespace
| RPC / Part | Sender Recovery | Transaction Lookup | Receipts | Account History | Storage History |
|-----------------|-----------------|--------------------|----------|-----------------|-----------------|
@ -161,7 +295,7 @@ The following tables describe the requirements for prune parts, per RPC method:
| `net_peerCount` | ✅ | ✅ | ✅ | ✅ | ✅ |
| `net_version` | ✅ | ✅ | ✅ | ✅ | ✅ |
### `trace` namespace
#### `trace` namespace
| RPC / Part | Sender Recovery | Transaction Lookup | Receipts | Account History | Storage History |
|---------------------------------|-----------------|--------------------|----------|-----------------|-----------------|
@ -174,7 +308,7 @@ The following tables describe the requirements for prune parts, per RPC method:
| `trace_replayTransaction` | ✅ | ❌ | ✅ | ❌ | ❌ |
| `trace_transaction` | ✅ | ❌ | ✅ | ❌ | ❌ |
### `txpool` namespace
#### `txpool` namespace
| RPC / Part | Sender Recovery | Transaction Lookup | Receipts | Account History | Storage History |
|----------------------|-----------------|--------------------|----------|-----------------|-----------------|