镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

chore: remove the new-chain flusher and queue - #1063

Draft
rickyrombo wants to merge 2 commits into
mainfrom
chore/remove-new-chain-flusher
Draft

rickyrombo wants to merge 2 commits into
mainfrom
chore/remove-new-chain-flusher

Conversation

@rickyrombo

@rickyrombo rickyrombo commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The genesis migration no longer copies writes onto the new chain from the API. A standalone mirror in go-openaudio (openaudio mirror, OpenAudio/go-openaudio#605, #608, #610) now replays the old chain's ManageEntity and Plays transactions onto the new chain in block order. The API flusher is already off in production, so the queue, the flusher and their config are dead.

Removed

  • api/new_chain_flusher.go and api/new_chain_flusher_test.go.
  • Construction and startup of the flusher in api/server.go.
  • The only insert into new_chain_queue: the fire-and-forget enqueueForNewChain call after a confirmed relay in api/relay.go. The relay still submits to the chain and returns the same response.
  • The new_chain_queue table. Migration 0243_drop_new_chain_queue.sql drops it. Its objects are removed from sql/01_schema.sql, and its model is removed from api/dbv1/models.go. I edited both by hand so a full regeneration's unrelated drift stays out of this PR.
  • NewChainID and its per-environment defaults. The flusher was the only code that stamped it (fix(api): stamp the new chain ID on flushed transactions #1059).
  • Config fields and env vars: newChainUrl, newChainId, newChainQueueEnabled, newChainFlushEnabled, newChainFlushFromBlock, newChainFlushToBlock, newChainInsecureSkipVerify.

Kept

Deploy notes

  • The drop is irreversible and deletes any queue rows still in the table. Export them first if you want them for audit.
  • Migrations run before the new pods roll out. An old pod with newChainQueueEnabled=true would log a warning on each relay until it is replaced. Its inserts were fire-and-forget, so relays still succeed.
  • After the rollout, delete the seven env vars above from the deploy configs. Nothing reads them anymore.

Tests

  • go build ./... passes.
  • Fresh docker compose up -d --wait from the edited dump: go test -count=1 -cover ./... passes in 28 packages. In api, only TestFeedScheduledReleases fails. It fails the same way on origin/main without this change.
  • Applied migrations 0232, 0242 and 0243 to a scratch database. The table is created and then dropped, and a second run of 0243 is a no-op.

🤖 Generated with Claude Code

rickyrombo and others added 2 commits October 24, 2026 13:39
The genesis migration no longer copies writes onto the new chain from the
API; a standalone mirror in go-openaudio replays the old chain's blocks
onto the new chain instead, and the flusher is already off in production.

- Delete NewChainFlusher and its tests.
- Stop enqueuing confirmed relay transactions into new_chain_queue.
- Drop the newChainUrl, newChainQueueEnabled, newChainFlushEnabled,
  newChainFlushFromBlock, newChainFlushToBlock and
  newChainInsecureSkipVerify config.

The new_chain_queue table and NewChainID config are left in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing reads or writes new_chain_queue since the flusher and relay
enqueue were removed, and NewChainID was only stamped by the flusher.

- Add migration 0243 to drop the table.
- Remove its objects from the schema dump and its generated model.
- Remove NewChainID, its per-environment defaults and newChainId.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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