Conversation
Consul was used purely as a plain KV store (no locks/sessions/watches), so swap it for Redis, which already runs for the bloom filter. This drops one external service and the hashicorp/consul/api dependency. - add RedisStore implementing infra.KVStore (SET/GET, SCAN-based List, pipelined BatchSet, JSON codec); keep Badger as the embedded backend - remove the Consul-specific GetWithOptions from the KVStore interface, which also unpins consul/api from pkg/infra and the test mocks - thread the shared redis client into kvstore.NewFromConfig - repoint kv-migrate (Badger<->Redis) and relax wallet-kv-load's backend - drop the consul service from docker-compose and the config template Catchup ranges still go through the generic KV store; the HASH+Lua catchupstore is a separate follow-up.
When the KV store has no persisted latest block (fresh start), GetLatestBlock returns 0 and the catchup worker created a range spanning block 1 to the chain head — millions of sub-ranges from genesis. A zero latest means no indexed position: the regular worker starts at chain head and queues real gaps into the store, so only create a catchup range when latest > 0.
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.
Stacked on #109.
Stack: #109 → this PR → fix/catchup-redis-hash