Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion augurScan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ENV NODE_ENV=production
COPY --from=dependencies /workspace/node_modules ./node_modules
COPY augurScan/package.json augurScan/bun.lock ./
COPY augurScan/config ./augurScan/config
COPY augurScan/migrations ./augurScan/migrations
COPY augurScan/schema.sql ./augurScan/schema.sql
COPY --from=browser-build /workspace/augurScan/public ./augurScan/public
COPY augurScan/src ./augurScan/src
COPY shared/ts/ethereum.ts ./shared/ts/ethereum.ts
Expand Down
15 changes: 10 additions & 5 deletions augurScan/PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The scanner owns its application, configuration, and database inputs under `/aug

## Delivered architecture

The shipped stack is Bun and TypeScript, the repository's `micro-eth-signer`-based adapter for JSON-RPC and ABI primitives, PostgreSQL for persistence, a Bun-native HTTP/SSE server, and a dependency-free HTML/CSS/JavaScript browser UI. Dependency versions and container images are pinned. `compose.yaml` starts the app and its persistent database; the app runs idempotent migrations before it serves traffic.
The shipped stack is Bun and TypeScript, the repository's `micro-eth-signer`-based adapter for JSON-RPC and ABI primitives, PostgreSQL for persistence, a Bun-native HTTP/SSE server, and a dependency-free HTML/CSS/JavaScript browser UI. Dependency versions and container images are pinned. `compose.yaml` starts the app and its persistent database; the app initializes the complete schema in an empty database before it serves traffic and rejects incompatible databases instead of upgrading them.

Configuration is checked in under `config/`:

Expand All @@ -24,7 +24,7 @@ Each block transaction commits atomically with its receipt, top-level protocol a

Logs and top-level calls involving protocol activity sources select receipts for indexing and dynamic discovery. Shared WETH, REP, Multicall3, and proxy-deployer contracts never select unrelated receipts, but their known logs are retained when either activity-source path selected the receipt. Registration events add pools, share tokens, price coordinators, truth auctions, escalation games, and child reputation tokens. A fixed-point receipt pass retains initializer logs that occur before their registration log. Unknown or malformed events keep their topics, data, and decode error.

Token display rules are keyed by contract kind, event/function, and argument. Semantic `atto*` fields, the OpenOracle ETH sentinel, and known REP/share/WETH kinds use fixed 18-decimal protocol units. Arbitrary token values use canonical metadata read at an indexed block and fall back to exact base units only when that metadata is unavailable. Failed metadata reads retry with bounded block backoff and follow canonical reorg state.
Token display rules are keyed by contract kind, event/function, and argument. Semantic `atto*` fields, the OpenOracle ETH sentinel, and known REP/share/WETH kinds use fixed 18-decimal protocol units; configured USDC uses a fixed 6-decimal unit. Arbitrary token values use canonical metadata read at an indexed block and fall back to exact base units only when that metadata is unavailable. Failed metadata reads retry with bounded block backoff and follow canonical reorg state.

Before extending a chain, the indexer verifies parent hashes. A mismatch searches the configured 64-block window for a common ancestor, marks old branch evidence noncanonical, invalidates its derived state, and replays the replacement branch. If no retained ancestor matches, canonical state is rebuilt from the configured start boundary. Orphaned blocks, actions, receipts, and logs remain queryable as debugging evidence.

Expand All @@ -39,19 +39,24 @@ The browser provides:
- deep-linked evidence with contract provenance, complete receipt, related logs, decoded action/event schemas, exact raw values, copy controls, and explorer links;
- searchable pool, question, vault, and universe catalogs with automatic loading, live commit refresh, error recovery, and responsive graph/detail layouts;
- a single-network rich list ranked by ETH or SepoliaETH, WETH, or sent transactions, with bounded per-token REP balances, pool/vault participation, and explicit pending or partial balance state.
- an Operations destination with freshness, report, escalation, auction, tagged pool/vault risk, fork/migration, price-provenance, semantic-change, and direct entity-detail views;
- canonical domain projections and unified timelines for reports, games, auctions, AMM activity, forks, and migrations;
- bounded canonical tagged-block reads for current pool, vault, escalation, and auction values, with retained read failures and stale-on-reorg semantics;
- stable keyset pagination; full-window exact AMM volume and fee summaries; and explicitly bounded price-impact, TWAP-coverage, and candlestick observations;
- pool-level OpenOracle coordinator history plus REP/WETH, REP/native-ETH, REP/USDC, and liquidity histories.

## Delivery and validation

The implementation is delivered in these completed slices:

1. Isolated configuration, ABI snapshot, Docker packaging, migrations, and health endpoints.
1. Isolated configuration, ABI snapshot, Docker packaging, fresh-database schema initialization, and health endpoints.
2. Resumable multi-network indexing, polling, advisory leases, RPC recovery, reorg retention, dynamic discovery, exact decoding, and SSE commit notices.
3. Log/action APIs and responsive activity/evidence UI.
4. Event-replayed system catalogs and historical charts.
5. Unit coverage for configuration, lifecycle recovery, metadata/decoding, and projections, plus a PostgreSQL integration scenario for migrations, leases, restart, discovery, receipt evidence, API canonicality, and reorg replacement.
5. Unit coverage for configuration, lifecycle recovery, metadata/decoding, and projections, plus a PostgreSQL integration scenario for schema initialization, leases, restart, discovery, receipt evidence, API canonicality, and reorg replacement.

Acceptance requires an empty-volume Compose start to expose the UI and begin each configured network independently; exact head progress and failures must remain visible; restart must resume without duplicate canonical occurrences; a reorg must retain the orphan and serve its replacement; and decoded amounts must always expose both a correctly scaled display value and exact raw evidence.

## Deferred scope

Provider-specific internal-call tracing, automatic re-decoding after an ABI snapshot change, arbitrary historical state-at-block queries, very large deployment load testing, and automated backup/restore drills remain future work. A production operator must still choose archival-capable RPC providers, verified deployment start blocks, credentials, resource limits, backup schedules, and external access controls.
Provider-specific internal-call tracing, automatic re-decoding after an ABI snapshot change, arbitrary user-selected historical state-at-block queries, normalized cross-venue liquidity, manipulation-resistant TWAP claims, very large deployment load testing, and automated backup/restore drills remain future work. A production operator must still choose archival-capable RPC providers, verified deployment start blocks, credentials, resource limits, backup schedules, and external access controls.
Loading