fix(relay): serialize NIP-IA snapshot timestamps - #3849
Conversation
Co-authored-by: Aaron K. Clark (CryptoJones) <cryptojones@owasp.org> Signed-off-by: Aaron K. Clark (CryptoJones) <cryptojones@owasp.org>
|
makes sense for #3848. maybe assert the wall-clock catch-up path in the test name so future readers know why sleep is there |
|
serializing nip-ia snapshot timestamps is a good fix for #3848. a tiny test with two same-second updates would lock it in. |
Chessing234
left a comment
There was a problem hiding this comment.
this is the right fix for #3848 — same-second replaceable ties keeping the lowest id was eating intermediate nip-ia snapshots. the unit tests for strictly increasing timestamps are exactly what i'd want. one ask: if six archives land in one wall-clock second, created_at jumps into the future by up to 5s; confirm clients tolerate created_at > now on relay-signed snapshots (most do) so you don't trade lost updates for 'future event' filters.
Co-authored-by: Aaron K. Clark (CryptoJones) <cryptojones@owasp.org> Signed-off-by: Aaron K. Clark (CryptoJones) <cryptojones@owasp.org>
|
Hi @Chessing234 — addressed your feedback from this thread. I renamed the test covering the wall-clock catch-up path from |
…hot-collision Co-authored-by: Aaron K. Clark (CryptoJones) <cryptojones@owasp.org> Signed-off-by: Aaron K. Clark (CryptoJones) <cryptojones@owasp.org>
|
@Chessing234 Thanks for flagging the future-timestamp case. The updated head
The update also closes a concurrency gap found during follow-up review: if two publishers calculate the same replacement timestamp, the loser now logs the collision, re-reads both the canonical archive rows and latest snapshot, and retries rather than silently dropping or republishing stale tags. Local validation on the refreshed branch: Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/ |
Co-authored-by: Aaron K. Clark (CryptoJones) <cryptojones@owasp.org> Signed-off-by: Aaron K. Clark (CryptoJones) <cryptojones@owasp.org>
66df23a to
46465fe
Compare
|
Follow-up: final head Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/ |
Summary
kind:13535snapshot timestamps strictly monotonicFixes #3848.
Verification
cargo fmt --all -- --checkcargo clippy -p buzz-relay --all-targets -- -D warningscargo test -p buzz-relay— 794 passed, including both new regression tests; 10 unrelated environment-dependent failures because the local Postgres instance lacks rolebuzz, plus one mesh demo timeoutProudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/