# QBFT Validator Key Configuration Investigation

**Date**: $(date)  
**Issue**: Validators are connected but not producing blocks - they're looking for sync targets instead

---

## Problem Summary

- ✅ 5 validators connected to network
- ✅ All configuration files correct
- ✅ Validator keys present at `/keys/validators/validator-{N}/`
- ❌ Validators are searching for "sync targets" instead of producing blocks
- ❌ Still at block 0 (genesis)

---

## Critical Finding

**Log Message Pattern**:
```
Unable to find sync target. Currently checking 8 peers for usefulness
```

This suggests that **Besu thinks these nodes need to sync from other nodes**, rather than recognizing them as **validators that should produce blocks**.

---

## Current Configuration

### Validator Config (`config-validator.toml`)
```
miner-enabled=false
miner-coinbase="0x0000000000000000000000000000000000000000"
sync-mode="FULL"
```

### Validator Keys Location
- `/keys/validators/validator-{N}/key.priv` ✅ Present
- `/keys/validators/validator-{N}/address.txt` ✅ Present
- `/keys/validators/validator-{N}/key.pem` ✅ Present

### Genesis Configuration
- QBFT config: `{blockperiodseconds: 2, epochlength: 30000, requesttimeoutseconds: 10}`
- No `validators` array (correct for dynamic validators)
- `extraData` contains 5 validator addresses (RLP-encoded)

---

## Research Findings

### 1. Validator Key Discovery
- Besu may need explicit configuration to find validator keys
- Keys are at `/keys/validators/validator-{N}/` but Besu might not auto-discover them
- Documentation mentions "Each validator node references its key directory in config-validator.toml" but we don't see this in current config

### 2. QBFT Dynamic Validators
- Network uses dynamic validator management (no static validators array in genesis)
- Initial validator set comes from `extraData` field
- Validators still need to know their own key to sign blocks

### 3. Miner Configuration
- `miner-enabled=false` is correct for QBFT (QBFT doesn't use mining)
- But `miner-coinbase` might need to be set to validator address for QBFT to recognize the node as a validator

---

## Possible Solutions to Investigate

### Option 1: Set miner-coinbase to Validator Address
```toml
miner-coinbase="0x<validator-address>"
```
- Each validator would use its own address from `/keys/validators/validator-{N}/address.txt`
- This might tell Besu "I am a validator, produce blocks"

### Option 2: Configure Validator Key Path
- Research if Besu has a `validator-keys-path` or similar config option
- Or if keys need to be in a specific location that Besu checks by default

### Option 3: Verify Key Loading
- Check logs for messages about loading validator keys
- If no key loading messages, Besu may not be finding/using the keys

### Option 4: Check Initial Validator Set
- For dynamic validators, verify that the initial set from extraData is correct
- Ensure all 5 validators are in the initial set

---

## Next Steps

1. ✅ Verify validator addresses match genesis extraData (DONE - all match)
2. ⏳ Check logs for validator key loading messages
3. ⏳ Research if `miner-coinbase` should be set to validator address
4. ⏳ Test setting `miner-coinbase` to each validator's address
5. ⏳ Check if Besu needs explicit validator key path configuration

---

## Key Insight

The fact that validators are looking for "sync targets" instead of producing blocks suggests that **Besu doesn't recognize these nodes as validators**. 

In QBFT, validators should:
- NOT be looking for sync targets
- Be actively participating in consensus
- Proposing blocks based on their turn in the validator rotation

This is likely a **validator key configuration issue** rather than a network connectivity issue.

---

**Last Updated**: $(date)  
**Status**: Investigating validator key configuration for QBFT block production

