Skip to content

[Feat] Introduce a persistent validator cache#3887

Merged
vicsn merged 3 commits intoProvableHQ:stagingfrom
ljedrz:feat/validator_peer_cache
Sep 26, 2025
Merged

[Feat] Introduce a persistent validator cache#3887
vicsn merged 3 commits intoProvableHQ:stagingfrom
ljedrz:feat/validator_peer_cache

Conversation

@ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Sep 25, 2025

This PR introduces a persistent validator cache, similarly to #3820.

As a drive-by, there is also a reduction of Arcs within the Gateway, which will reduce the number of atomic operations on each clone and drop by 7. This also makes it harder to misuse the new PeerPoolHandling trait by making separating the peer pool from the Gateway impossible (CC #3879).

Note: the associated issue states that

the same validator can't have two ip addresses

I'm assuming this means that we can't have two connected Gateway Peers that have the same Aleo address. This, however, would be a more general change, as it would also affect the way the peer lists should be handled.

I've tested it locally on new validators and after a restart - both cached_router_peers and cached_gateway_peers files are created and processed, and the addresses are the ones I expected. Manually altering them confirmed that the cache would work for other (non-dev) addresses too.

Closes #3869.

@ljedrz ljedrz requested a review from vicsn September 25, 2025 12:11
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
@ljedrz ljedrz force-pushed the feat/validator_peer_cache branch from 5587172 to de6456e Compare September 25, 2025 12:37
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
@vicsn
Copy link
Collaborator

vicsn commented Sep 26, 2025

Can you confirm the tests you ran in the PR deacription

@ljedrz
Copy link
Collaborator Author

ljedrz commented Sep 26, 2025

@vicsn done; I applied more or less the same treatment as with the Router peer cache.

@vicsn vicsn merged commit 83805f6 into ProvableHQ:staging Sep 26, 2025
5 checks passed
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.

[Feature] Ensure gateway can persist peer cache

2 participants