Skip to content

refactor(core): remove the legacy reward wire-compat layer - #232

Open
rickyrombo wants to merge 1 commit into
mainfrom
mjp-remove-legacy-reward-types
Open

refactor(core): remove the legacy reward wire-compat layer#232
rickyrombo wants to merge 1 commit into
mainfrom
mjp-remove-legacy-reward-types

Conversation

@rickyrombo

@rickyrombo rickyrombo commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Reworked on top of main (September 2026). The original branch was based on the closed reward-pools endpoints branch and its migration number collided with 00034_reward_pools.sql.

Removes the launchpad-era CreateReward / DeleteReward wire-compat layer. It exists so a node block-syncing audius-mainnet-alpha-beta from genesis can decode and apply the pre-pool reward bytes committed there. audius-mainnet-beta was written by genesis-writer from table state (#504) and carries only pool-shaped RewardPool / RewardBody transactions, so on the new chain the layer is dead code.

Sequencing: merge after runbook step 15, once every node has moved. It is not dead on the old chain — any node still block-syncing there needs it — and main ships to the old chain as :stable until the rollover.

What's removed

Removal Why
LegacyRewardMessage / LegacyCreateReward / LegacyDeleteReward protos Wire shape does not exist on the new chain. Tags 4–6 / 2–3 on CreateReward / DeleteReward stay reserved.
pkg/common/legacy_reward_signing.go Only recovered signers from legacy bytes.
pkg/core/server/rewards_legacy.go + test The decode-and-apply path.
tryParseLegacyReward branches in isValidRewardTransaction / finalizeRewards Body == nil is a plain error at both validation and finalize.
GetLaunchpadRMByAuthority query Replay-time only.
launchpad_authority_rm from the state-sync dump allowlist Table is gone.

Schema

00039_drop_launchpad_authority_rm.sql drops the table. 00034 is not edited — it has already been applied on every chain's database, and its backfill ran once. The Down recreates the table empty so 00034's Down still finds it; the 72 mapping rows are not restored because no binary that runs this schema can read them.

Verification

  • go build ./... clean; make regen-proto regen-core-sql output committed.
  • go test ./pkg/core/server/ ./pkg/common/ ./pkg/rewards/... green; go test -c ./pkg/integration_tests/ compiles.
  • After the rollover: devnet bring-up and the reward-pool rotation integration test against this branch.

🤖 Generated with Claude Code

@rickyrombo
rickyrombo force-pushed the mjp-remove-legacy-reward-types branch from d2357cc to 5280ec0 Compare May 7, 2026 01:45
@rickyrombo
rickyrombo force-pushed the mjp-reward-pools-endpoints branch from 3cf1a9a to 8c4c696 Compare May 7, 2026 02:55
@rickyrombo
rickyrombo force-pushed the mjp-remove-legacy-reward-types branch from 5280ec0 to 03d9e91 Compare May 7, 2026 02:57
@rickyrombo
rickyrombo force-pushed the mjp-reward-pools-endpoints branch from 8c4c696 to 2188197 Compare May 7, 2026 05:50
@rickyrombo
rickyrombo force-pushed the mjp-remove-legacy-reward-types branch from 03d9e91 to 5420982 Compare May 8, 2026 00:31
@rickyrombo
rickyrombo force-pushed the mjp-reward-pools-endpoints branch from 2188197 to 2645ab1 Compare May 8, 2026 01:12
The pre-pool LegacyRewardMessage decode path, the sha256 legacy signing
scheme, GetLaunchpadRMByAuthority and the launchpad_authority_rm table exist
only to replay audius-mainnet-alpha-beta's historical reward bytes at
block-sync time. audius-mainnet-beta was written by genesis-writer from table
state and carries only pool-shaped reward transactions, so on it the layer is
dead code. Reward messages without a body are now a plain error at both
validation and finalize.

Migration 00039 drops the table; 00034 is left as applied. The state-sync dump
allowlist no longer names it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rickyrombo
rickyrombo force-pushed the mjp-remove-legacy-reward-types branch from d57928f to d4d44de Compare September 9, 2026 03:55
@rickyrombo rickyrombo changed the title Remove legacy reward wire-compat layer (post-restart cleanup) refactor(core): remove the legacy reward wire-compat layer Sep 9, 2026
@rickyrombo
rickyrombo changed the base branch from mjp-reward-pools-endpoints to main September 9, 2026 03:55
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