# Project Optimization Status

**Last Updated**: 2026-04-13  
**Status**: Active

## Summary

This document tracks the ongoing optimization and cleanup of the smom-dbis-138 project.

## Completed Actions

### ✅ Documentation Cleanup
- **Archived 30+ status reports** from `terraform/phases/phase1/` to `docs/archive/status-reports/phase1/`
- **Removed 4 genesis.json backup files** (moved to archive)
- **Updated active entry points**: High-traffic README and operator docs now point at QBFT/current workflows
- **Created archive structure** with proper organization
- **Archived legacy status-report piles** from the active docs surface:
  - `docs/operations/status-reports/` → `docs/archive/status-reports/operations-legacy/`
  - report-style files from `docs/` → `docs/archive/status-reports/docs-root-legacy/`
  - report-style files from the repository root → `docs/archive/status-reports/repo-root-legacy/`
- **Repointed active indexes and runbooks** to current docs or archive collections
- **Archived trustless bridge milestone stack** from `docs/bridge/trustless/` into `docs/archive/bridge-trustless-milestones/`
- **Added active trustless bridge overview** at `docs/bridge/trustless/README.md`

### ✅ Configuration Consolidation
- **Archived old IBFT2 config structure**: `config/validators/`, `config/sentries/`, `config/rpc/` → `docs/archive/old-configs/ibft2/`
- **Current config structure**: Standardized `config/config-*.toml` files (QBFT-based)
  - `config-validator.toml`
  - `config-rpc-perm.toml`
  - `config-rpc-core.toml`
  - `config-member.toml`
  - `config-rpc-public.toml`

### ✅ Docker Compose Structure
- **Current**: `docker-compose/docker-compose.template.yml` (Option A pattern with profiles)
- **Legacy**: `docker/besu-*/docker-compose.yml` (per-node-type, may still be used for reference)
- **Phase2**: `docker/phase2/docker-compose.*.yml` (regional deployments)

### ✅ Canonical Operator Paths
- **Genesis generation**: `scripts/generate-genesis-proper.sh`
- **Genesis validation**: `scripts/validation/validate-genesis.sh`
- **Compatibility wrapper**: `scripts/generate-genesis.sh` now forwards to the canonical QBFT generator
- **Docker Compose**: `docker-compose/docker-compose.template.yml` is the active template; older per-node compose files remain reference material

## Current Project Structure

### Active Configuration Files
```
config/
├── genesis.json                    # Current QBFT genesis
├── static-nodes.json               # Network peer configuration
├── config-validator.toml           # Validator node config
├── config-rpc-perm.toml            # Permissioned RPC config
├── config-rpc-core.toml           # Core/admin RPC config
├── config-member.toml             # Member node config
├── config-rpc-public.toml         # Public RPC config
└── permissions-*.toml              # Permissioning configs
```

### Docker Compose Files
```
docker-compose/
├── docker-compose.template.yml     # ✅ CURRENT: Option A template
└── env/
    ├── vm1.env                     # VM1 configuration
    ├── vm2.env                     # VM2 configuration
    ├── vm3.env                     # VM3 configuration
    ├── vm4.env                     # VM4 configuration
    └── vm5.env                     # VM5 configuration
```

## Recent Cleanup Actions (2026-04-12)

### Documentation Surface Cleanup
- **Status Reports Archived**:
  - `94` historical files moved to `docs/archive/status-reports/operations-legacy/`
  - `33` report-style docs moved to `docs/archive/status-reports/docs-root-legacy/`
  - `13` report-style root docs moved to `docs/archive/status-reports/repo-root-legacy/`
- **Active status navigation slimmed down**: `docs/operations/status-reports/` now routes through `STATUS_REPORTS_INDEX.md`
- **Deduplication Report**: Archived at `docs/archive/status-reports/docs-root-legacy/CLEANUP_DEDUPLICATION_REPORT.md`

### Script Deduplication
- **Duplicate CCIP Scripts**: Archived 3 duplicate CCIP scripts from `terraform/phases/phase1/scripts/ccip/` to `scripts/archive/duplicate-ccip/`
- **Unified WETH Script**: Created `scripts/deployment/deploy-weth-unified.sh` to consolidate WETH deployment methods

### Script Analysis
- **Total Shell Scripts**: 260
- **Total Lines of Code**: 28,089 lines
- **WETH-related Scripts**: 16 (consolidation in progress)
- **CCIP Scripts**: 16 (duplicates removed)
- **Deployment Scripts**: 82 (review needed)

## Remaining Tasks

### 🔄 In Progress
- [ ] Continue script deduplication (82 deployment scripts to review)
- [ ] Review remaining milestone-style docs that should be archived or explicitly marked historical
- [ ] Keep archive indexes and active links aligned as legacy docs move

### ⏳ Pending
- [ ] Consolidate duplicate genesis generation scripts
- [ ] Review and optimize script organization
- [ ] Prune or archive remaining completion-style bridge and deployment reports outside `docs/archive/`

## Files Requiring IBFT → QBFT Updates

The following files still contain IBFT references:
- `docs/azure/QUOTA_ISSUE_RESOLUTION.md`
- `docs/configuration/CONFIGURATION_FIXES_APPLIED.md`
- `docs/governance/CHANGELOG.md`
- `terraform/phases/phase1/CONTAINERS_AND_SERVICES_REPORT.md`
- `terraform/phases/phase1/HIGH_PRIORITY_TASKS_COMPLETE.md`
- Historical files under `docs/archive/status-reports/` may still contain legacy IBFT-era wording and should stay archived unless refreshed

## Archive Location

All archived files are in `docs/archive/`:
- `status-reports/phase1/` - Historical status reports
- `status-reports/operations-legacy/` - Historical files formerly in `docs/operations/status-reports/`
- `status-reports/docs-root-legacy/` - Historical report-style docs formerly in `docs/`
- `status-reports/repo-root-legacy/` - Historical report-style docs formerly in the repository root
- `old-configs/ibft2/` - Previous IBFT2 configuration structure
- `old-scripts/deprecated/` - Obsolete scripts (to be populated)

## Next Steps

1. Complete script review and deduplication
2. Finish the last active terminology cleanups and historical-status banners
3. Keep archive routing and active index links synchronized
4. Consolidate transitional genesis helpers around the canonical QBFT path
