Skip to content

Conversation

SuchitraSwain
Copy link

@SuchitraSwain SuchitraSwain commented Oct 7, 2025

What was wrong?

Issue #881

How was it fixed?

Summary of approach: Implemented a hybrid architecture that combines Ethereum smart contracts with py-libp2p's Kademlia DHT to achieve the best of both worlds.

Architecture Components:

  1. Smart Contract Layer (ethereum_contract.py):
  • Stores lightweight service pointers (service ID, DHT key, peer ID, owner)
  • Provides trust and verifiability through blockchain
  • Minimal gas costs (~200,000 gas vs 500,000+ for full metadata)
  1. DHT Layer (hybrid_discovery_service.py):
  • Stores detailed service metadata (endpoints, capabilities, real-time status)
  • Enables frequent updates without gas costs
  • Provides O(log n) lookup performance
  • Supports real-time service discovery
  1. Hybrid Resolver (hybrid_resolver.py):
  • Combines on-chain verification with off-chain data retrieval
  • Implements intelligent caching to reduce redundant lookups
  • Provides health monitoring and service connection management
  • Handles service discovery by type and individual service resolution
  1. Mock Implementation (mock_ethereum.py):
  • Allows testing and demonstration without real Ethereum setup
  • Simulates gas cost savings and transaction behavior
  • Enables standalone operation for development

To-Do

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

put a cute animal picture link inside the parentheses

@sumanjeet0012
Copy link
Contributor

@SuchitraSwain Please rebase the PR on latest main branch.

LogicalGuy77 and others added 3 commits October 9, 2025 18:18
…p#909)

* fix: correct spelling of 'negotiate_timeout' in multiple files

* added news fragment

* Fix negotiate_timeout parameter and newsfragment file name

---------

Co-authored-by: Manu Sheel Gupta <[email protected]>
- Add 60-minute job timeout to GitHub Actions workflow
- Add 20-minute pytest timeouts to tox.ini for all test environments
- Update Makefile test command with 20-minute timeout
- Prevents tests from hanging indefinitely in CI/CD

Fixes libp2p#977
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.

8 participants