-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix the preimage display at height=0 #187
Conversation
src/Stoa.ts
Outdated
// Genesis block height | ||
if (target_height == new Height(0n)) | ||
{ | ||
preimage_distance = 0; | ||
result_preimage_hash = row.random_seed; | ||
} | ||
else | ||
{ | ||
preimage_distance = NaN; | ||
result_preimage_hash = Hash.NULL; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it special-casing the genesis block ? Any enrollment contains the preimage at distance 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. I'm testing it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it
Why is the code for |
I didn't want to use the cloned code either, |
Alright, it would be good to refactor it. |
Related to #189 |
Is it normal that there is no data when API 'GET /validators/' is called with a height value 0? |
I just applied the comment above, so it should work. |
b753dbc
to
2f059ef
Compare
It works well. |
2d0d0c0
to
c9f64aa
Compare
The enrollmentis of the Genesis block starts with zero avail_height.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked that the pre-image becomes random-seed when the distance is zero in each cycle.
LGTM
At height=0, the distance = 0 and the
preimage
is displayed asrandomHash
The enrollments of the Genesis block starts with zero avail_height.
Fixed #167