Skip to content

supernode/p2p: cache validator lookups to cut handshake gRPC reads#177

Merged
mateeullahmalik merged 1 commit intomasterfrom
p2p-cache
Sep 18, 2025
Merged

supernode/p2p: cache validator lookups to cut handshake gRPC reads#177
mateeullahmalik merged 1 commit intomasterfrom
p2p-cache

Conversation

@mateeullahmalik
Copy link
Collaborator

  • Add 1h TTL cache (Ristretto + singleflight) in validator.go for:
    • Auth.AccountInfoByAddress
    • SuperNode.GetSupernodeBySupernodeAddress
  • Impact on p2p handshakes:
    • Before: ~2 Lumera gRPC reads per connection (one per side) on every handshake.
    • After: ≤1 read per side per identity per hour; subsequent handshakes are cache hits; concurrent misses collapsed to 1.
  • Scope: pkg/lumera/validator.go only.
  • Risk: up to 1h staleness (acceptable for identity/supernode registry).

@mateeullahmalik mateeullahmalik merged commit 9c7e965 into master Sep 18, 2025
7 checks passed
@mateeullahmalik mateeullahmalik deleted the p2p-cache branch September 18, 2025 15:22
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.

2 participants