Skip to content

Genesis migration: bootstrap a new chain from historical Audius data#152

Open
rickyrombo wants to merge 4 commits into
mainfrom
genesis/migration
Open

Genesis migration: bootstrap a new chain from historical Audius data#152
rickyrombo wants to merge 4 commits into
mainfrom
genesis/migration

Conversation

@rickyrombo
Copy link
Copy Markdown
Contributor

Summary

  • Fix: Replace reflect.DeepEqual with proto.Equal for rollup report comparison in the auditor
  • Add prod-v2 genesis chain: Embeds prod-v2.json and dev-v2.json genesis configs. Adds OPENAUDIO_GENESIS env var to select the genesis independently of OPENAUDIO_ENV. Introduces a genesis migration authority — an address in genesis app_state whose ManageEntity transactions bypass ownership checks during migration. Tracks state in a new core_genesis_state table.
  • Add OPENAUDIO_GENESIS_MIGRATION mode: Reduces TimeoutCommit from 400ms to 10ms on a single-validator bootstrap chain, enabling ~100 blocks/second for fast entity ingestion.
  • Add genesis-replay tool: Replays all historical Audius entities (users, tracks, playlists, follows, saves, reposts, plays) from a discovery-provider postgres DB to a bootstrap Core chain via synthetic ManageEntity and TrackPlay transactions. Achieves ~1800 tx/s using direct h2c gRPC with 500 concurrent submissions.

Test plan

  • go build ./... passes
  • make test-unit passes
  • For integration: cd cmd/genesis-replay && make up && make test-integration
  • Verify OPENAUDIO_GENESIS=prod-v2 boots a node against the prod-v2 genesis
  • Verify OPENAUDIO_GENESIS_MIGRATION=true reduces block time on a single-validator devnet

🤖 Generated with Claude Code

rickyrombo and others added 4 commits March 20, 2026 11:00
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Embeds prod-v2.json and dev-v2.json genesis configurations. Adds
OPENAUDIO_GENESIS env var to select the genesis independently of
OPENAUDIO_ENV, allowing dev infrastructure to run against prod-v2
chain. Introduces genesis migration authority: an address set in
genesis app_state whose ManageEntity transactions bypass ownership
checks during migration. Tracks migration state in core_genesis_state
table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reduces TimeoutCommit from 400ms to 10ms when OPENAUDIO_GENESIS_MIGRATION=true,
enabling ~100 blocks/second on a single-validator chain for faster entity ingestion
during genesis replay.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… data

Replays all historical Audius entities (users, tracks, playlists, follows,
saves, reposts, plays) from a discovery-provider postgres DB to a bootstrap
Core chain via synthetic ManageEntity and TrackPlay transactions. Includes:

- run: concurrent batch replay with h2c gRPC support and mempool-full retries
- verify: streaming merge comparison of two DBs for production-scale validation
- keygen: generate a genesis migration keypair
- docker-compose stack with postgres, openaudio node, and discovery provider
- integration test gated behind the 'integration' build tag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant