ethereum / sharding

Sharding manager contract, and related software and tests
480 stars 105 forks source link

Added fast sync utils and bumped dependencies version #19

Closed hwwhww closed 6 years ago

hwwhww commented 7 years ago

Description

Please see #18. This PR added some fast sync utils. In simulation, the transaction flow would be:

  1. The requester calls collator.get_deep_collation_hash(chain, shard_id, depth) to get the collation hash of pivot point collation from validator manager. The requester sends a GetShardData message.
  2. The receiver received the GetShardData message and then calls collator.mk_fast_sync_state(chain, shard_id, collation_hash) to get the corresponding state and send ShardData message to the requester. (The data compression part will be implemented in pyethapp)
  3. The requester received the ShardData message and then calls collator.verify_fast_sync_data(chain, shard_id, received_state, received_collation_header, depth=100) to verify the data is correct. If yes, the requester calls ShardChain.set_head(self, state, collation) to set the head collation and head state.

How to test

pytest sharding/tests/test_collator.py sharding/tests/test_shard_chain.py

Cute Animal Picture

flying kitty