Skip to content

refactor(kvstore): replace Consul backend with Redis - #110

Open
vietddude wants to merge 2 commits into
perf/solana-getblock-jsonfrom
refactor/kvstore-redis
Open

vietddude wants to merge 2 commits into
perf/solana-getblock-jsonfrom
refactor/kvstore-redis

Conversation

@vietddude

Copy link
Copy Markdown
Collaborator

Stacked on #109.

  • refactor(kvstore): replace Consul backend with Redis (removes hashicorp/consul dependency)
  • fix(catchup): don't backfill from genesis on a fresh start — a zero stored latest means no indexed position, so only queue a catchup range when latest > 0

Stack: #109 → this PR → fix/catchup-redis-hash

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.
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