qizhou
December 13, 2019, 9:53pm
8
plotozhu:
On creating new block, Block Proposer of shard X should verify cross-shard transactions via Root of beacon/root chain. What would happen if cross-shard transactions are not received on this time?
The main problem is how to guarantee that cross-shard transactions always arrives before corresponding beacon chain’s block in network layer?
The BP of the destination shard may not include the root block that contains the cross-shard transaction receipt if it doesn’t observe the root block or the cross-shard transaction receipts are not ready (e.g. downloaded from the source shard):
At target shard j, upon observing a new root block and creating a new shard block, the BP of shard j create a pre-block unprocessed receipt queue by electing to include the root block or not in the shard block and :
If a root block is not included, the pre-block unprocessed receipt queue of the new block equals to the post-block unprocessed receipt queue of the previous block
If a root block is included, the pre-block unprocessed receipt queue of the block is constructed by appending all receipts included to the post-block unprocessed receipt queue of the previous block. Again, the construction can be on-demand and asynchronously according to A1.
As a result, even the root chain/beacon arrives to a BP before the cross-shard transactions receipts, the BP could choose not to process the cross-shard transactions receipts at the cost of losing cross-shard tx fee or full block reward:
Guaranteed and ordered delivery via incentives
According to A2 and A3, as long as the receipt queue is deterministically ordered, the delivery is also ordered. To ensure guaranteed delivery, i.e., to encourage a BP of a shard to include the latest root block (and thus forcibly process the receipt queue), we could have
(Incentive from cross-shard receipt tx fee). If the BP doesn’t include the root block while the unprocessed receipt queue is empty, it will waste its cross-shard gas limit and the corresponding tx fee;
(Incentive from block reward). In the case tx fee is small, we could further incentivize the BP as follows: if a BP includes a new root block, it will collect a full block reward rather than a partial block reward.