question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Minimal testnet for sharding

See original GitHub issue

What is wrong?

We need the minimal P2P code to do the following.

  • Maintain connections to peers, probably from a hardcoded list or at least a list of bootnodes.
  • Gossip protocol to pass around new blocks/collations.
  • ???

How can it be fixed

Starting point should probably be

  • p2p.lightchain.LightChain
  • p2p.peer.LESPeer
  • p2p.les

We’ll need to implement Command classes for a minimal subset of commands needed to pass around blocks. Looking at the existing commands we will probably need a set of commands loosely as follows.

  • Status - For initial handshake and connecting to useful peers.
  • Announce - For letting peers know they have a new block.
  • GetXXX and XXX for things like requesting and sending blocks or headers.

Then we’ll need to implement a Protocol class to wrap these commands, similar to LESProtocol.

And then finally, a ShardChain class like LightChain which uses the protocol to join the network, find suitable peers, learn the appropraite chain of blocks that it should sync with and then request the blocks and headers and do whatever is needed with them.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
gsalgadocommented, Mar 6, 2018

I suggested p2p.Server because I envisioned it’d be the main service, responsible for orchestrating all others. It’d accept incoming peer connections but also run the DiscoveryProtocol, tell PeerPool to connect to more nodes when necessary, and pass that pool to other services like LightChain or the new ChainSyncer

1reaction
gsalgadocommented, Mar 6, 2018

I think it might make more sense to have a new service (p2p.Server, maybe?) that creates and runs a PeerPool, then calls await asyncio.start_server() to get new incoming connections and pass them on to the PeerPool after the auth and base-protocol handshakes are complete

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ontology Sharding TestNet Released - Medium
The Ontology Sharding TestNet includes three shards, which can achieve cross-chain interaction. We can see from the table above that the ...
Read more >
Shardeum Blockchain Testnet is Live! Here's How to Claim ...
Sharding breaks the job of validating and confirming a ton of commercial transactions into small and manageable bits, or shards. This helps the ......
Read more >
Ethereum Sharding: An Introduction to Blockchain Sharding
Blockchain sharding is the process of a blockchain being sharded, or split, where each shard stores and processes a portion of the blockchain's...
Read more >
Prysm Sharding Plan - HackMD
The basic idea of sharding in eth2 has to do with broadcasting a shard block over its appropriate shard subnet in p2p, then...
Read more >
Provisioning Sharding for Smart Contracts: A Design for Zilliqa
In a non-sharded architecture, each (full) node in the blockchain network processes and validates every transaction. Typical examples of non- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found