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

Genesis blocks restructure and new shard creation #60

Closed
qcgg opened this issue Aug 30, 2018 · 0 comments
Closed

Genesis blocks restructure and new shard creation #60

qcgg opened this issue Aug 30, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@qcgg
Copy link
Contributor

qcgg commented Aug 30, 2018

Proposal to simplify the genesis block structure which will also facilitate the creation of new shard in future

This comment describes the dependencies among the genesis blocks where each chain has two genesis blocks.

# Structure of genesis blocks
#
# +--+ +--+
# |m0|<----|m1|
# +--+ +--+--+
# ^ | ^
# | | |
# +--+<-+ +--+
# |r0|<----|r1|
# +--+ +--+
#
# where m0 is the first block in each shard, m1 is the second block in each shard, and
# r0 is the first root block, which confirms m0, r1 is the second root block, which confirms m1
# This make sures that all hash pointers of m1 and r1 points to previous valid blocks.

This is a bit over complicated and can be simplified as follows.

The genesis state starts with a genesis root block R0. Genesis block on each shard then use R0 as hash_prev_root_block. This should be sufficient to guarantee that every clients have the same genesis state.

The genesis blocks on each shard shall be imported from a genesis file specifying the initial shard state. Each shard can specify the height at which the genesis block should be created and allow reserved shards to be used in future any time.

Initially we can have 32 shards with half creating genesis blocks at root block height 0 (R0) and half reserved for future. To start using a reserved shard we just need to push out a genesis file for that shard with target root block height set in the future. Clients picking up the new genesis file will create the genesis block at the target root height. Clients unaware of the new shard will be on a hard fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant