Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Add end block state transition #105

Merged
merged 17 commits into from
Jan 15, 2021
Merged

Add end block state transition #105

merged 17 commits into from
Jan 15, 2021

Conversation

adlerjohn
Copy link
Member

@adlerjohn adlerjohn commented Jan 3, 2021

Represent the validator queue as a singly linked list. This allows us to collect the top MAX_VALIDATORS validators in linear time to the MAX_VALIDATORS, independent of the number of queued validators. Each modification to the validator queue can be done in logarithmic time w.r.t. the number of queued validators if a local tree data structure is used to store the queue (which clients are expected to actually do). In other words, the linked list representation is primarily for light clients/fraud proofs.

Add an end block state implicit transition to make use of the queue to collect the top MAX_VALIDATORS trivially by walking through the linked list.

Also refactored the layout of delegations in the state tree just to make things a bit simpler. Instead of storing the delegation data with each account, store it in a dedicated delegations subtree.

@adlerjohn adlerjohn added documentation Improvements or additions to documentation enhancement New feature or request consensus labels Jan 3, 2021
@adlerjohn adlerjohn self-assigned this Jan 3, 2021
@adlerjohn adlerjohn linked an issue Jan 3, 2021 that may be closed by this pull request
@adlerjohn adlerjohn marked this pull request as ready for review January 12, 2021 18:32
@adlerjohn
Copy link
Member Author

Note: markdown-link-check is failing with this link https://www.secg.org/sec1-v2.pdf which is a bit unstable for me (sometimes fails to load) but isn't dead.

@adlerjohn adlerjohn requested review from liamsi and musalbas January 12, 2021 18:35
@adlerjohn adlerjohn requested a review from liamsi January 13, 2021 16:19
specs/consensus.md Outdated Show resolved Hide resolved
@adlerjohn adlerjohn requested a review from liamsi January 14, 2021 18:21
@adlerjohn adlerjohn requested a review from liamsi January 15, 2021 15:24
specs/consensus.md Show resolved Hide resolved
specs/consensus.md Show resolved Hide resolved
@adlerjohn adlerjohn merged commit cd66b26 into master Jan 15, 2021
@adlerjohn adlerjohn deleted the adlerjohn-end_block branch January 15, 2021 18:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
consensus documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add special state transition for end of block
3 participants