Skip to content

Conversation

codemaestro64
Copy link

What was wrong?

Issue #768
There was no dedicated libp2p-record module in py-libp2p, making it difficult to implement interoperable record handling, signing, and envelope support consistent with the Go and JS implementations.

How was it fixed?

A new libp2p-record module is being introduced.
So far, the following work has been completed:

  • Implemented generic Record abstraction
    • Protobuf-based serialization/deserialization
    • Compatible with go-libp2p record schema
  • Implemented Envelope support
    • Created Envelope class for signing and wrapping records
    • Added serialization/deserialization logic
  • Added Protobuf message definitions for Record and Envelope
  • Wrote initial unit tests for roundtrip serialization/deserialization of Record and Envelope

To-Do

  • Implement generic Record abstraction
  • Add protobuf-based serialization/deserialization for Record
  • Implement Envelope abstraction (signing + wrapping of records)
  • Add protobuf message definitions for Record and Envelope
  • Write initial unit tests for Record and Envelope round-trip serialization
  • Implement Validator interface
  • Implement Selector interface
  • Add validator/selector registry
  • Integrate record validation and selection into DHT
  • Add crypto verification for signatures
  • Expand test coverage with negative/edge cases
  • Add interop tests with go-libp2p/js-libp2p
  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

closes #768

@acul71
Copy link
Contributor

acul71 commented Sep 15, 2025

Hi @seetadev . If there are not others PRs about this I can start reviewing/help let me know.

@seetadev
Copy link
Contributor

@acul71 : Definitely, Luca. I will write to you in detail today.

@lla-dane will be working on this PR soon. @sumanjeet0012 is working on kad-dht refactor required in this PR.

@lla-dane
Copy link
Contributor

Hi @acul71, @codemaestro64, @seetadev — Since #890 also focuses on adding the libp2p-record module, could you clarify whether the work would be continued here or in #890?

@codemaestro64
Copy link
Author

Hi @acul71, @codemaestro64, @seetadev — Since #890 also focuses on adding the libp2p-record module, could you clarify whether the work would be continued here or in #890?

Hello @lla-dane, I believe this PR establishes a solid foundation for effectively addressing the linked issue and aligning with the Golang and JavaScript implementations. Subject to approval from @acul71 and @seetadev, I’d recommend building on this work moving forward.

@seetadev
Copy link
Contributor

@codemaestro64 : Thank you so much for your initiative. Appreciate it.

Since the issue was earlier assigned to @lla-dane, I checked with him today. He expressed confidence on your initial efforts and gave a go-ahead to the above PR.

This is an important initiative and requires key changes in kad-dht too. @sumanjeet0012 is currently undertaking the effort to refactor kad-dht module in a separate PR. @lla-dane and @sumanjeet0012 will help you arrive at a good conclusion on this effort. Please let us know if you are stuck at any point. Would like to have this module during this month. We will get it tested by py-libp2p developers at Eth-Delhi.

CCing @acul71 and @pacrob too. We will keep the other PR by @lla-dane open till we get this PR production ready for py-libp2p.

@seetadev
Copy link
Contributor

seetadev commented Sep 15, 2025

@codemaestro64 : Re-ran the CI/CD pipeline. A good number of test cases are failing. Please collaborate with @lla-dane and @sumanjeet0012 to get them fixed.

@codemaestro64
Copy link
Author

@codemaestro64 : Thank you so much for your initiative. Appreciate it.

Since the issue was earlier assigned to @lla-dane, I checked with him today. He expressed confidence on your initial efforts and gave a go-ahead to the above PR.

This is an important initiative and requires key changes in kad-dht too. @sumanjeet0012 is currently undertaking the effort to refactor kad-dht module in a separate PR. @lla-dane and @sumanjeet0012 will help you arrive at a good conclusion on this effort. Please let us know if you are stuck at any point. Would like to have this module during this month. We will get it tested by py-libp2p developers at Eth-Delhi.

CCing @acul71 and @pacrob too. We will keep the other PR by @lla-dane open till we get this PR production ready for py-libp2p.

Alright. Thank you.

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.

Add support for libp2p-record in py-libp2p
4 participants