fix: increment sequence when accepting new manifests - #6059
Conversation
|
|
||
| // Something has changed. Keep track of it. | ||
| seq_++; | ||
|
|
There was a problem hiding this comment.
From: Xahau/xahaud#631
OverlayImpl::getManifestsMessage() caches manifest messages and only rebuilds
them when ManifestCache::sequence() changes. When accepting a new manifest,
the function returned early without incrementing seq_, causing the cache to
never invalidate. This meant peers were exchanging stale lists.
Now seq_++ is called for both new manifests and updates, ensuring the overlay
layer detects changes and sends complete validator lists to connecting peers.
I think this has been masked all these years by validator list (e.g. https://vl.ripple.com/) usage which bootstraps manifests
There was a problem hiding this comment.
The change looks correct to me.
One small request: can we extend Manifest_test to cover the regression where ManifestCache::sequence() wasn’t incremented when accepting a new manifest, and verify it stays unchanged on stale?
With that test in place, I’m happy to approve.
diff --git a/src/test/app/Manifest_test.cpp b/src/test/app/Manifest_test.cpp
index 09054658c9..5276f188c6 100644
--- a/src/test/app/Manifest_test.cpp
+++ b/src/test/app/Manifest_test.cpp
@@ -997,11 +997,16 @@ public:
// applyManifest should accept new manifests with
// higher sequence numbers
+ auto const seq0 = cache.sequence();
BEAST_EXPECT(
cache.applyManifest(clone(s_a0)) ==
ManifestDisposition::accepted);
+ BEAST_EXPECT(cache.sequence() > seq0);
+
+ auto const seq1 = cache.sequence();
BEAST_EXPECT(
cache.applyManifest(clone(s_a0)) == ManifestDisposition::stale);
+ BEAST_EXPECT(cache.sequence() == seq1);
|
Hey, was quite hectic last December, and I missed this Let me sort that out for you |
7280122 to
8eb76e0
Compare
The function was returning early without incrementing seq_++. OverlayImpl uses this sequence to identify/invalidate a cached TMManifests message which is exchanged with peers on connection. Depending on network size, startup sequencing, and topology, this could cause syncing issues.
8eb76e0 to
15d5c91
Compare
|
lgtm! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6059 +/- ##
=======================================
Coverage 79.9% 79.9%
=======================================
Files 840 840
Lines 65548 65549 +1
Branches 7270 7262 -8
=======================================
+ Hits 52344 52357 +13
+ Misses 13204 13192 -12
🚀 New features to boost your workflow:
|
…manifests-2025-11-20
The `ManifestCache::applyManifest` function was returning early without incrementing `seq_`. `OverlayImpl `uses this sequence to identify/invalidate a cached `TMManifests` message, which is exchanged with peers on connection. Depending on network size, startup sequencing, and topology, this can cause syncing issues. This change therefore increments `seq_` when a new manifest is accepted.
The function was returning early without incrementing seq_++. OverlayImpl uses this sequence to identify/invalidate a cached TMManifests message which is exchanged with peers on connection. Depending on network size, startup sequencing, and topology, this could cause syncing issues.