[Node Operator Question] Deployment of full node with partial state retention over last 5000000 blocks #902
Replies: 2 comments 5 replies
-
|
You have to launch the node using a full archival snapshot if your node is recently launched If you use snap sync or full node snapshot, snapshot doesn't have required past blocks |
Beta Was this translation helpful? Give feedback.
-
|
so i think the issue you are facing is quite common, and it’s actually not a bug, more like a design thing in ethereum nodes. if you want to use debug_traceBlockByNumber for blocks older than the last8192, then you need to run an archive node, not a full node. even if you set --history.state=5000000, the node will still only keep state for the last few thousand blocks, because the protocol does not allow full historical state on full nodes. you must use --gcmode=archive for archive nodes to get full historical state. this way you can trace any block, but it needs a lot more storage. if you only need recent blocks, full node is fine. sorry for the trouble, but this is how it works. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Are you running the most up to date node software?
Did you check the documentation?
Did you check for duplicate questions?
Issue Description
Due to storage limitations, I’d like to run a full node that retains only the most recent 5,000,000 blocks of historical state. According to the documentation, this should be achievable by setting the flags
--history.state=5000000and/or--history.transactions=5000000, together with--state.scheme=path. I’ve deployed a local full node using these parameters.My goal is to use the Web3 method
debug_traceBlockByNumberon blocks within this 5,000,000-block window to extract internal transactions. However, while it works correctly for the most recent 128 blocks, attempting to trace older blocks results in the following error:I’m wondering if I’ve misunderstood how these flags work. Is it possible to configure a node to retain partial historical state for recent blocks, enabling tracing with
debug_traceBlockByNumber, without having to run a full archive node?Steps to Reproduce
Deploy a local full node, using the following config:
Then try to query the RPC with the Web3 method
debug_traceBlockByNumberfor a block older than the 128 most recent blocks (but part of the 5000000 most recent blocks):Which component is affected?
Expected vs. Actual Behavior
I expect to receive the trace execution of the queried block, containing the internal transactions. Instead I got:
{ "jsonrpc":"2.0", "id":1, "error":{ "code":-32000, "message":"historical state is not available" } }Environment Details
The node is running in a Ubuntu 24.04 LTS VM.
The Ethereum L1 node is an archive node deployed locally on the same machine using Erigon and Prysm, using a 2TB NVMe as storage.
Protocol Information
Node Logs
No logs relative to
--historyflags.Only relevant log is:
State scheme set by user scheme=pathTroubleshooting Attempts
No response
Additional Information
No response
Feedback
No response
Beta Was this translation helpful? Give feedback.
All reactions