This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Block time calculation gets warped with high stakes #7781
Milestone
Comments
@CriesofCarrots Could you take a look at this to see if this behavior is indeed a bug? |
@ryoqun , at a glance, this does appear to be a bug! I'll write a failing test to expose it. |
Merged
This was referenced Aug 1, 2022
This was referenced Aug 2, 2022
This was referenced Aug 22, 2022
This was referenced Aug 24, 2022
Open
Open
Open
Open
This was referenced May 14, 2024
Open
Open
Open
Open
This was referenced May 22, 2024
This was referenced May 22, 2024
This was referenced Oct 12, 2024
This was referenced Oct 14, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Problem
solana get-block-time XXX
can return warped value:under the configuration of:
Proposed Solution
My rough guess was
timestamp (around 30 bits these days) * stake (~ 44 bits)
could have been overflowed. Oddity is that rust's checked integer operation didn't complain...under this hacky patch:
background
I've tested large stakes hoping something odd for the bank hash mismatch #7736; And I've found this instead as part of the investigation. This block time calculation doesn't happen on chain (is it ok, btw?) and the vote timestamps in ledger themselves are fine.
The text was updated successfully, but these errors were encountered: