# XDC State Root Divergence — Accepted Permanent Divergence

## Issue #230

**Status:** Accepted divergence — no code fix required

## Root Cause

GP5 (based on Geth 1.17+) uses `uint256` for balance encoding in the state trie.
XDC v2.6.8 uses legacy `big.Int` for balance encoding.

This causes deterministic state root divergence between GP5 and v2.6.8 nodes.

## Mitigation

GP5 already implements comprehensive state root bypass mechanisms:

- `core/xdc_state_root_cache.go` — caches and validates state roots from v2.6.8 nodes
- `core/block_validator.go` — logs and bypasses state root mismatches for XDC chains
- `core/blockchain.go` — accepts path-based state even when root diverges
- Environment variable `XDC_BYPASS_STATE_ROOT` can force bypass

## Implication

GP5 operates as a "follower client" for XDC chains. It does not attempt to
reproduce v2.6.8 state roots deterministically. Instead, it trusts the state
root from the canonical chain and validates execution independently.

This is a deliberate architectural choice to leverage Geth 1.17 performance
improvements while maintaining consensus compatibility through state root bypass.
