Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize genesis shard state based on root block height (#80)
SlaveServer will create Shard object upon receiving the root block matching the ROOT_HEIGHT in the shard GENESIS config. The new shard will only start receiving other shards' minor block headers after receiving root block with height (GENESIS.ROOT_HEIGHT + 1) which includes the genesis block header of the new shard and thus will update the block gas limit on the source shard for throttling xshard transactions. When looking up CrossShardTransactionList by minor block hash ignore the minor blocks whose hash_prev_root_block height is <= GENESIS.ROOT_HEIGHT. This is safe because only minor blocks referring to root block height > GENESIS.ROOT_HEIGHT could have xshard transacstions targetting this shard as the block gas limit for throtlling xshard transactions is updated through the root block. When recovering ShardState from db only recover root blocks with height >= GENESIS.ROOT_HEIGHT. * Initialize genesis shard state based on root block height * Support GENESIS.ROOT_HEIGHT > 0 and GENESIS=None * Remove GenesisManager.finalize_config * Fix TransactionGenerator * Only broadcast xshard tx list to initialized shards * Check minor block headers in root block must start from genesis * Add unittest for creating shard at non-zero root height * Remove GenesisManager.finalize_config
- Loading branch information
Showing
16 changed files
with
464 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.