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
DesignateContractrecord historical role designation. So users can verify old messages.Changes:
DesignateContractadd height and nodes when callDesignateAsRoleGetDesignatedByRoleAndIndexto return designated nodes at specificindex@erikzhang @shargon @Tommo-L Please have a look.