Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal alternate metadata type support #365

Merged
merged 4 commits into from
Mar 9, 2022

Conversation

hannahhoward
Copy link
Collaborator

Goals

Avoid a future upgrade to metadata types by supporting simple handling in the client

Implementation

  • Uncomment remaining types on metadata
  • Add simple handling in the client for DuplicateNotSent and DuplicateDAGSkipped -- while these two things very different things than Present/Missing:
    • DuplicateDAGSkipped can essentially be treated with the new ReconciledLoader like a Missing -- just switch to a local loading only mode till you exit this branch.
    • DuplicateNotSent can be treated exactly like Present with no block contained in the message, with one caveat: it treats the block as a duplicate even if it is contained in the message. There are certain scenarios (using ExtensionDeDupByKey for example) where this may be useful information that helps us avoid holding a received block in memory longer than needed. (I am still open to the idea though that we should merge this w/o DuplicateNotSent and not add this until there's a super clear use case why we actually need this an not just imply it via the presence of a block in the message)
  • By only doing this super minimal client implementation:
    • We avoid downgrading compatibility issues with the v1 protocol till its deprecated
    • We can implement a server version and possibly upgrade the client in the future (for a client that also skips duplicate DAGs), but continue to talk to old clients with no change.

@hannahhoward hannahhoward requested a review from rvagg March 8, 2022 23:18
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that extensible reconciledloader test suite is pretty neat, good that it can be so easily adapted to test these

re not including DuplicateNotSent - I think that's your call, it's not clear to me that it's going to be essential, maybe it'll be helpful, or maybe by the next time we can ship a breaking change we want to remove it.

requestmanager/reconciledloader/reconciledloader_test.go Outdated Show resolved Hide resolved
graphsync.go Outdated Show resolved Hide resolved
@willscott
Copy link
Collaborator

@rvagg you should feel free to merge with you comment changes if you want to build off of this in the next couple weeks

@hannahhoward hannahhoward merged commit c5ec428 into main Mar 9, 2022
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.

3 participants