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

Shard Manager for watching multiple shards #196

Closed
hwwhww opened this issue Dec 5, 2017 · 2 comments
Closed

Shard Manager for watching multiple shards #196

hwwhww opened this issue Dec 5, 2017 · 2 comments
Labels

Comments

@hwwhww
Copy link
Contributor

hwwhww commented Dec 5, 2017

  • Enable regular stateless client to watch multiple shards at the same time.
  • Once the validators detect that the they are sampled as the collator, they have to add the shard_id the watching list, and then validators have to run the stateless fast sync to sync the shard. The config looks like:
    {
        validator_address: "0x..." OR null,
        watching: [list of shard ids],
        ...
    }
    
  • shard_id is similar to the concept of network_id, we use shard_id to identify different p2p networks.
@hwwhww hwwhww added the eth2.0 label Dec 5, 2017
@pipermerriam pipermerriam mentioned this issue Dec 5, 2017
15 tasks
@pipermerriam pipermerriam changed the title STUB: Shard Manager for watching multiple shards Shard Manager for watching multiple shards Dec 6, 2017
@pipermerriam
Copy link
Member

pipermerriam commented Dec 6, 2017

@hwwhww is this something that will live in the networking layer?

@hwwhww
Copy link
Contributor Author

hwwhww commented Dec 7, 2017

I hope the implementation would be mostly in transport layer and session layer.

  1. Port mapping
    • Map different network_ids/shard_ids to different ports
  2. Keep the same Node Discovery Protocol
  3. Suggestions
    • The early step may be trying to connect to two non-sharding private networks concurrently. So we don’t need to update Wire Protocol at first.
    • Use different databases for different networks.
  4. Update Wire Protocol for sharding
    • Option 1: Reuse the Status Message of Ethereum Wire Protocol (Transport Layer)
      • Status [+0x00: P, protocolVersion: P, networkId: P, td: P, bestHash: B_32, genesisHash: B_32] Inform a peer of its current ethereum state. This message should be sent after the initial handshake and prior to any ethereum related messages
        • protocolVersion: TBD
        • networkId: prefix 10 + shard_id
        • td: total score (number) of the best chain. Integer, as found in collation header.
        • bestHash: the hash of the best (i.e. highest score) known collation.
        • genesisHash: 32 bytes of 0x00
    • Option 2: Write new Sharding-only Status Message
  5. I suppose ShardManager includes or triggers:
    1. Calling function in VMC utils (maybe use event filter) to detect whether they are sampled as the collator
    2. Maintaining watching list
    3. Modules like PeerManager in pydevp2p
      • connect / disconnect p2p network
    4. Modules like Synchronizer in pyethapp
      • handle (1) stateless fast sync or (2) full sync task
  6. Dependency
    • Shard client needs to run a full node
      • Need to implement the equivalent of evm.p2p.peer.LESPeer for full node
      • Need command line interface

@hwwhww hwwhww added the Stage 2 label Jan 8, 2018
@hwwhww hwwhww removed the Stage 2 label Mar 27, 2018
@hwwhww hwwhww closed this as completed Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants