# xdc-replay — XDC GP5 Bit-for-Bit Validation Harness

Part of Phase 1 in the Opus 4.7 re-validation plan (go-ethereum #406).

## Purpose
Compare GP5 block processing against a v2.6.8 archive node over the V2 switch window to detect consensus divergences.

## Usage

```bash
# Build
go build ./cmd/xdc-replay

# Single block comparison
./xdc-replay --network apothem --block 56828700 --archive http://archive-node:8545

# Range comparison
./xdc-replay --network apothem --from 56828250 --to 56831400 --archive http://archive-node:8545

# CI mode (embedded fixture)
./xdc-replay --ci --fixture apothem-switch-window
```

## Output Formats

- `--format md` (default): Human-readable markdown
- `--format json`: Machine-readable for CI

## Architecture

```
main.go        — CLI entrypoint
replay.go      — Core replay loop (TODO)
comparator.go  — Diff engine (TODO)
archive.go     — v2.6.8 archive RPC client (partial)
fixtures/      — Embedded test data (TODO)
ci_test.go     — CI golden fixture test (TODO)
```

## Definition of Done (Phase 1)

- [ ] `make test-replay` passes with embedded fixture
- [ ] Running against current `xdc-network` HEAD produces DIFFS
- [ ] CI workflow runs on PRs
- [ ] Documentation complete

## Current Status

**Scaffolding complete** — Archive client and CLI structure in place.
**Next**: Implement ephemeral GP5 chain import for block comparison.
