refactor: remove all zelAppSpecifications legacy references#1717
Open
MorningLightMountain713 wants to merge 5 commits into
Open
refactor: remove all zelAppSpecifications legacy references#1717MorningLightMountain713 wants to merge 5 commits into
MorningLightMountain713 wants to merge 5 commits into
Conversation
All records in zelappsmessages use appSpecifications exclusively — verified on live node (57k records, 0 with zelAppSpecifications). The field was normalized at ingestion time for years, so the fallbacks and duplicate queries/indexes were dead code. - Remove || zelAppSpecifications fallbacks across 7 files - Remove duplicate $or query in appQueryService - Remove duplicate zelAppSpecifications.name query blocks in advancedWorkflows and messageVerifier - Remove 3 empty zelAppSpecifications.* indexes from explorerService - Remove legacy field propagation in appHashSyncService Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Nodes running since before Feb 2021 may still have records in zelappsmessages with the old zelAppSpecifications field name. This migration renames them on startup and drops the legacy indexes. Idempotent — matches zero docs once migrated. Safe to remove once the fleet has been fully upgraded. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… sync The migration was inside the scannedBlockHeight === 0 block which only runs on first sync. Existing nodes would never hit it. Move to run once per process lifetime using a module-level flag, right after isInInitiationOfBP is set. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cabecinha84
requested changes
Apr 20, 2026
Member
Cabecinha84
left a comment
There was a problem hiding this comment.
Minor observations (non-blocking)
- Fresh install edge case: col.indexes() behavior on a never-created collection is driver/version dependent. In practice the collection is almost
always pre-existing by this point in initiateBlockProcessor, but a defensive try/catch around migrateZelAppSpecifications (or an early
listCollections check) would make fresh-node boots bulletproof. - Peer wire compatibility: the PR assumes every node on the network now emits appSpecifications. messageStore.storeAppTemporaryMessage will now
reject any inbound message with only zelAppSpecifications. The author's justification ("since Feb 2021") is reasonable, but worth an explicit
confirmation that no gossip path still carries the legacy field. - Cleanup note in PR body is good — flag and migration function can be deleted in a follow-up once the fleet is upgraded.
Recommendation
Ack. Optionally ask the author to wrap the migration call in a try/catch with a log line so a malformed fresh-sync DB can't stall block-processor
init.
Prevent migration failure from stalling block processor init on fresh nodes or malformed DBs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
Fixed. Wrapped in try / catch |
Add setZelAppSpecsMigrationDone setter and mock updateMany/indexes on collection fakes so the migration doesn't cause unexpected log.error calls in existing tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zelAppSpecificationsfallbacks, duplicate queries, and dead indexes across 9 fileszelAppSpecifications→appSpecificationsinzelappsmessagesand drops legacy indexes — safe for nodes that have been running since before Feb 2021 without a resynczelappsmessages, 0 withzelAppSpecifications— all records useappSpecificationsexclusivelyCleanup
Once all nodes on the network have been upgraded to this version,
migrateZelAppSpecificationsand thezelAppSpecsMigrationDoneflag inexplorerService.jscan be removed.Testing
zelAppSpecificationsrecords and drops legacy indexes on boot🤖 Generated with Claude Code