Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Used hash onion parameters count & 'height' not updated if imported from another node and block height is less than 'height' #8369

Closed
Tracked by #7226
Incede opened this issue Apr 17, 2023 · 0 comments · Fixed by #8429
Assignees
Milestone

Comments

@Incede
Copy link
Contributor

Incede commented Apr 17, 2023

Expected behavior

When using endpoint setHashOnionUsage to import used hash onion parameters from another node, the new node should either :

  1. throw if the parameters are not valid for eg. current block height is less than the height of the last used hash onion
  2. update the last used hash onion correctly after successfully importing the parameters and then generating a block using the respective next hash onion in the series

Actual behavior

If the current block height of the new node is less than the height of the last used hash onion set by setHashOnionUsage the parameters height & count returned by endpoint getHashOnionUsage remain the same after multiple rounds until the block height reaches or surpasses the height of the last used hash onion even though the validator keeps forging blocks and receiving rewards by using the remaining hash onion in the series.

Steps to reproduce

  1. Run node1 for multiple rounds with valid seed reveal data for atleast 1 validator.
  2. Import hash onion data using endpoint getHashOnionSeeds and used hash onion data using endpoint getHashOnionUsage from node1 for the particular validator
  3. Start node2 from scratch.
  4. Set seed, count & distance for the same validator from the imported hash onion data using endpoint setHashOnion
  5. Set height & count (used) for the same validator from the import used hash onion data using endpoint setHashOnionUsage
  6. Observe the hash onion usage of the particular validator as it forges blocks from beginning and until after the block height of the node surpasses the height of the last used hash onion initially set.

Which version(s) does this affect? (Environment, OS, etc...)

development

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants