Files
proxmox/docs/archive/QBFT_ETHASH_FIX.md

83 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

# QBFT Consensus Fix: Removing ethash from Genesis
**Date**: 2025-12-20
**Root Cause**: Genesis file had both `ethash: {}` and `qbft: {...}`, causing Besu to default to ethash (proof-of-work) instead of QBFT
## Problem
Besu was not recognizing validators and blocks were not being produced because:
- Genesis config had both `ethash: {}` and `qbft: {...}`
- Besu defaulted to ethash (proof-of-work) consensus instead of QBFT
- This caused validators to not be recognized (empty validator set)
- No blocks could be produced (ethash requires mining, which isn't configured)
## Solution
Removed `ethash: {}` from the genesis.json config section, keeping only `qbft: {...}`.
### Before:
```json
{
"config": {
"clique": null,
"ethash": {},
"qbft": {
"blockperiodseconds": 2,
"epochlength": 30000,
"requesttimeoutseconds": 10
}
}
}
```
### After:
```json
{
"config": {
"clique": null,
"qbft": {
"blockperiodseconds": 2,
"epochlength": 30000,
"requesttimeoutseconds": 10
}
}
}
```
## Results
After deploying the fixed genesis.json:
- ✅ Validators are now recognized: `qbft_getValidatorsByBlockNumber` returns 5 validators
- ✅ QBFT consensus is active (validators list populated)
- ✅ Services are running correctly
Blocks should now start being produced with a 2-second block period.
## Action Taken
1. Removed `ethash: {}` from `smom-dbis-138-proxmox/config/genesis.json`
2. Deployed updated genesis.json to all nodes (VMIDs 1000-1004, 1500-1503, 2500-2502)
3. Cleared all databases (to reinitialize with correct genesis)
4. Restarted all Besu services
## Verification
```bash
# Validators are now recognized
$ curl -X POST --data '{"jsonrpc":"2.0","method":"qbft_getValidatorsByBlockNumber","params":["latest"],"id":1}' http://localhost:8545
{
"result": [
"0x11563e26a70ed3605b80a03081be52aca9e0f141",
"0x1c25c54bf177ecf9365445706d8b9209e8f1c39b",
"0x22f37f6faaa353e652a0840f485e71a7e5a89373",
"0x573ff6d00d2bdc0d9c0c08615dc052db75f82574",
"0xc4c1aeeb5ab86c6179fc98220b51844b74935446"
]
}
```
## Lesson Learned
For QBFT consensus networks, the genesis file should **only** have the `qbft` config, not both `ethash` and `qbft`. Having both causes Besu to default to ethash, which is incompatible with QBFT validator-based consensus.