Skip to content

feat(core): schedule auth and content-auth enforcement on audius-mainnet-beta - #572

Open
rickyrombo wants to merge 2 commits into
mainfrom
mjp-mainnet-beta-upgrade-schedule
Open

feat(core): schedule auth and content-auth enforcement on audius-mainnet-beta#572
rickyrombo wants to merge 2 commits into
mainfrom
mjp-mainnet-beta-upgrade-schedule

Conversation

@rickyrombo

Copy link
Copy Markdown
Contributor

Why

pkg/core/config/upgrades.go keys activation heights by chain ID and has no entry for audius-mainnet-beta. An unknown chain resolves to an empty schedule, so the rollover build in #553 would run the new chain with no signer enforcement (#450) and no track-cid authorization (#477), and mediorum would never attest a cid. The whole point of activating at the genesis rollover — the replay seeds core_auth_* and a core_auth_cids claim for every migrated track, so enforcement is safe from block 1 — was left unwired.

Follow-on to the genesis migration; merge before the step 3 build in the runbook. Inert on main: nothing changes until prod.json names the new chain.

What

Schedule. audius-mainnet-beta gets AuthEnforcementHeight: 1 and ContentAuthEnforcementHeight: 1. Both, because the content-auth check runs inside validateManageEntityAuth — scheduling content auth alone would silently enforce nothing. Height 1 rather than a later height so no live block is ever produced under the relaxed rules and there is no pre-enforcement window for unverified state to accumulate. audius-mainnet-alpha-beta stays unscheduled, with a comment saying why it must.

Mediorum follows the chain, not the environment. IsContentAuthEnabled(env) was a per-environment list with prod off. Flipping it on would have broken uploads: the same prod build serves the old chain until the rollover, attestations are refused at the mempool before a chain's gate (content attestations are not accepted before content auth is active), and transcode completion fails on attestation error. So the decision moves to config.ContentAuthScheduled(env), which reads the embedded genesis for the environment and asks the schedule for that chain ID. On main prod resolves to audius-mainnet-alpha-beta → off; on #553's branch it resolves to audius-mainnet-beta → on. No separate flag flip, and the two sides cannot disagree.

Side effect worth knowing: stage was in the old list, but audius-testnet-alpha has no gate scheduled, so stage mediorum has been attesting into a chain that refuses attestations. This turns stage off, matching core. If stage should have content auth, it gets a schedule entry, not a list entry.

Verification

  • go test ./pkg/core/config/ ./pkg/common/ green; new TestContentAuthScheduledFollowsEmbeddedGenesis pins mediorum's answer to the schedule for every environment's genesis.
  • Mediorum upload/preview auth suites green. TestUploadFile, TestUploadPlacement*, TestValidateTusUploadPassesWhenDiskHasRoom fail identically on main (environment-dependent multi-node tests).
  • Not yet done, and should be before the bootstrap: re-run the genesis replay verification (runbook Appendix C) on a build that carries both this and build(core): point the prod build at audius-mainnet-beta — *DO NOT MERGE* #553, so the migration replay is exercised with both gates active. Devnet already runs both at height 1, but no integration test replays a genesis-writer artifact.

🤖 Generated with Claude Code

…net-beta

The new chain has no entry in the upgrade schedule, so #553's build would run
it with no signer enforcement and no track-cid authorization, and mediorum
would never attest. Schedule both at height 1: the genesis replay projects auth
state and a cid claim for every migrated track, so nothing that exists is made
unwritable, and no live block is ever produced under the relaxed rules.

Mediorum's attest/require-userId decision moves from the environment name to
the chain named in the embedded genesis. The prod build serves
audius-mainnet-alpha-beta until the rollover and audius-mainnet-beta after, and
attestations are refused before a chain's gate, so keying on "prod" would fail
every audio upload on whichever chain lacked the gate. Keying on the genesis
makes the switch flip with the genesis swap and nothing else. It also stops
stage attesting on audius-testnet-alpha, which has no gate scheduled.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…thScheduled

genesis.Read defaults unknown names to devnet, which turned content auth on
for the mediorum test network (Env "test") and rejected its unattributed
uploads. Unnamed environments get no gate, as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rickyrombo

Copy link
Copy Markdown
Contributor Author

Verification against the 2026-08-25 artifact, run directly on the T7's sealed serve copy (core_genesis_0825_serve) and the replayed ETL (etl_genesis_0825), no node needed:

Check Count
Current, non-deleted tracks 1,479,455
With a track_cid 1,478,895
track_cid / orig_file_cid / preview_cid with no claim for the owner 0 / 0 / 0
Owners with no core_auth_users row 0

So enforcement at height 1 makes nothing that exists unwritable. The 560 tracks with no track_cid at all are a separate, pre-existing repair question (37 recoverable via audio_upload_id).

End-to-end coverage of the gated path is in the integration test PR that follows this one.

rickyrombo added a commit that referenced this pull request Sep 9, 2026
… enforcement at step 10

Review fixes. The placeholder substitution had mangled
OPENAUDIO_DELEGATE_PRIVATE_KEY in Appendix J; restored. Step 17 had bundled a
pre-bootstrap prerequisite (#572) with a post-cutover cleanup (#232) under an
"after 15" label; #572 now lives in step 3 with a rebase instruction, and step
17 is #232 alone. The enforcement checks move to the first migrated node in
step 10 and name the real submission path and the real skew symptom (a commit
timeout, not the pre-gate error text). Appendix C gains the claim-coverage
check. Step 11 records, as unresolved, that the flusher stalls on the first
post-snapshot track create under content auth.

Co-Authored-By: Claude Fable 5.1 <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