What is “Unclean Shutdown”
An “unclean shutdown” in Geth (Go Ethereum) occurs when the Ethereum node does not close gracefully. This means Geth did not properly finish its processes, including writing necessary data to disk, updating the database state, or performing cleanup tasks.
Data loss from an unclean shutdown in Geth primarily affects the blockchain database and associated structures.
Here’s a detailed breakdown of the specific types of data that can be lost or corrupted:
Chain Data
- Blocks: Recently downloaded or mined blocks that were not fully written to disk.
- Headers: Block headers required for validating block chains and syncing.
- Receipts: Transaction receipts for blocks, essential for logs and state validation.
- Uncommitted Transactions: Pending transactions in blocks that were being processed.
Transaction Pool
- Pending Transactions: Locally broadcasted or received transactions waiting to be mined.
- Queued Transactions: Transactions that were deferred for later processing due to nonce gaps or other dependencies.
State Data
- Account States: Balances, nonces, and storage state of Ethereum accounts, particularly recent updates.
- State Trie: Partially committed or in-progress updates to the Ethereum state trie, leading to inconsistency.
Snapshot Data (if snapshot syncing is enabled)
- Pruned State: Incomplete or corrupted snapshot data, making it unusable for efficient state access.
- Partial Rebuilds: Snapshots mid-rebuild may be lost, requiring a full rebuild.
Ancient Data (if stored separately)
- Canonical Chain History: Historical block data stored in the ancient database.