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

Initialize genesis shard state based on root block height #80

Merged
merged 8 commits into from Sep 13, 2018
Merged

Conversation

qcgg
Copy link
Contributor

@qcgg qcgg commented Sep 12, 2018

#60

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.

@qcgg qcgg force-pushed the shard branch 3 times, most recently from fded46c to 380b18e Compare September 13, 2018 04:16
@qcgg qcgg requested a review from a team September 13, 2018 21:52
@qcgg qcgg self-assigned this Sep 13, 2018
@qcgg qcgg merged commit 4a8198c into master Sep 13, 2018
@qcdll
Copy link
Contributor

qcdll commented Sep 14, 2018

LGTM, just skimmed over
general question: when a shard is locked, does it still have to be handled by a slave? though it seems the slave doesn't have to do anything

@qcgg
Copy link
Contributor Author

qcgg commented Sep 14, 2018

shard is only created and handled by slave when the root block reaches the required height in GENESIS. Until then the slave doesn't do anything with the shard.

@ninjaahhh ninjaahhh deleted the shard branch September 14, 2018 20:24
Belgarion pushed a commit to Belgarion/pyquarkchain_cuda that referenced this pull request Sep 8, 2020
)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants