Please see #18.
This PR added some fast sync utils. In simulation, the transaction flow would be:
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.
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)
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.
Description
Please see #18. This PR added some fast sync utils. In simulation, the transaction flow would be:
collator.get_deep_collation_hash(chain, shard_id, depth)
to get the collation hash of pivot point collation from validator manager. The requester sends aGetShardData
message.GetShardData
message and then callscollator.mk_fast_sync_state(chain, shard_id, collation_hash)
to get the corresponding state and sendShardData
message to the requester. (The data compression part will be implemented in pyethapp)ShardData
message and then callscollator.verify_fast_sync_data(chain, shard_id, received_state, received_collation_header, depth=100)
to verify the data is correct. If yes, the requester callsShardChain.set_head(self, state, collation)
to set the head collation and head state.How to test
Cute Animal Picture