Skip to content

chore(gossipsub): Check whether published partials are stale#6458

Open
dknopik wants to merge 3 commits into
libp2p:masterfrom
dknopik:stale-partials
Open

chore(gossipsub): Check whether published partials are stale#6458
dknopik wants to merge 3 commits into
libp2p:masterfrom
dknopik:stale-partials

Conversation

@dknopik
Copy link
Copy Markdown
Collaborator

@dknopik dknopik commented May 27, 2026

Description

Application-side race conditions might cause calls to publish_partial to arrive in an unintended order. Currently, gossipsub silently accepts partial and overwrites the previously cached value - causing stale data to be replied on incoming requests.

This PR uses Metadata::update to compare the cached with the newly published value, and only proceeds with the publish if there is any fresh data.

AI Assistance Disclosure

Tools used (required — write none if no AI was used): Claude wrote the test
Attestation (required):

  • I have read every line of this diff, understand what it does, and can explain it in review.

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@jxs jxs changed the title feat(gossipsub): Check whether published partials are stale chore(gossipsub): Check whether published partials are stale May 27, 2026
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