-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add role designation history #2007
Add role designation history #2007
Conversation
Why do you want to verify old messages in the present, if they was verified already in the past? |
Not all messages signed by designated nodes saved in block, so these messages will not be sync with blockchain snapshot. |
Wait for #1988 we need to store the history in different keys. |
Hmm... What if we're to include state root hash in the block header? |
Only considering state root, if we put it into header, we do not need this. |
If there are two designate transactions in one block, can only get the last one? |
What do you mean the last one? |
The last transaction's history. |
Yes. Because designate transaction decide who are the nodes as specific role of next block. The last designate tx in same block will cover the previous. |
Tested OK.
|
Follow neo-project/neo#2007. Fix getDesignatedByRole price along the way.
Follow neo-project/neo#2007. Fix getDesignatedByRole price along the way.
* record historical designation * fix ut * sort * Remove sort * use different key * fix some * Store it as BiEndian * avoid in same block * Optimize * use findrange * optimize index get * Erik's feedback * Fix UT * fix empty sequence * optimize height * fix ut * index * fix ut Co-authored-by: Luchuan <luchuan@ngd.neo.org> Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: Erik Zhang <erik@neo.org>
* record historical designation * fix ut * sort * Remove sort * use different key * fix some * Store it as BiEndian * avoid in same block * Optimize * use findrange * optimize index get * Erik's feedback * Fix UT * fix empty sequence * optimize height * fix ut * index * fix ut Co-authored-by: Luchuan <luchuan@ngd.neo.org> Co-authored-by: Shargon <shargon@gmail.com> Co-authored-by: Erik Zhang <erik@neo.org>
I make this pr to let
DesignateContract
record historical role designation. So users can verify old messages.Changes:
DesignateContract
add height and nodes when callDesignateAsRole
GetDesignatedByRoleAndIndex
to return designated nodes at specificindex
@erikzhang @shargon @Tommo-L Please have a look.