Skip to content

Enable all grandchild of the best block to become a best proposal block #1813

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

Merged
merged 1 commit into from
Oct 15, 2019

Conversation

majecty
Copy link
Contributor

@majecty majecty commented Oct 14, 2019

Before this commit, only the child of the best block and the child of the best proposal block could be a new best proposal block. A block that is a grandchild of the best block but not the child of the best proposal block should be able to become a best proposal block.

After this commit, CodeChain checks whether a new block is the best block's child or grandchild.

Before this commit, only the child of the best block and the child of
the best proposal block could be a new best proposal block. A block
that is a grandchild of the best block but not the child of the best
proposal block should be able to become a best proposal block.

After this commit, CodeChain checks whether a new block is the best
block's child or grandchild.
@majecty majecty added bug Something isn't working consensus labels Oct 14, 2019
@foriequal0
Copy link
Contributor

It seems to be very ad-hoc. Is there any chance to receive grand-grand children?

@majecty
Copy link
Contributor Author

majecty commented Oct 14, 2019

@foriequal0
No. only the child of the best block and grandchild of the best block could be received.
If a valid block is imported, its parent block became a new best block.

Here is an example.

  1. Block A is the best block.
  2. Block B is a proposal block and B is a child of A.
  3. A block C, which is a child of B, is imported(At that time A is the best block).
  4. Since C has precommits of B, B became the new best block.

@majecty majecty merged commit e9bc48e into CodeChain-io:master Oct 15, 2019
@majecty majecty deleted the f/grandchild branch October 15, 2019 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants