Repository navigation
fix(bloomfilter): load only the address types of the chains being indexed - #133
Merged
Merged
Conversation
…exed Initialize and the bloom sync worker looped over every enum.AllNetworkTypes and queried wallet_addresses for each. A database whose address_type enum lacks one of them (e.g. apt, sui, cosmos, ton, xrp) failed the query, and the indexer exited at startup even when only stellar was indexed. Derive the types from the resolved chains (Chains.NetworkTypes) after validation and use them for both the initial load and the periodic sync.
anhthii
self-requested a review
November 21, 2026 05:32
anhthii
approved these changes
Nov 21, 2026
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
The address bloom filter loaded every
enum.AllNetworkTypesat startup and in the sync worker, queryingwallet_addressesonce per type. On a database whoseaddress_typeenum does not have one of those values (the devcustodyDB lacksapt,sui,cosmos,tonandxrp), the query fails and the indexer exits at startup, even when it only indexesstellar_testnet.Chains.NetworkTypes(names)returns the distinct network types of the resolved chains, in order.WalletAddressBloomFilter.Initialize(ctx, addressTypes)(Redis and in-memory) loads only those types.BloomSyncConfig.NetworkTypesholds the same list, and the sync worker's two loops use it.cmd/indexer/main.goinitializes the bloom filter after chains are resolved and validated, so it knows which types to load.Test plan
TestNetworkTypes_DistinctTypesOfGivenChainsTestAddressBloomFilter_InitializeLoadsOnlyGivenTypesTestBloomSyncWorker_SyncsOnlyConfiguredNetworkTypesgo test -short ./...index --chains stellar_testnetagainst the devcustodyDB: starts and loads onlystellar(it crashed onaptbefore); used for the Stellar memo e2e runs of fystack/apex#871