Closed SpicyLemon closed 2 months ago
Here's a shell function for converting a number to a 32-bit int:
$ to_int32 () { if [[ "$1" -le '2147483647' && "$1" -ge '-2147483648' ]]; then printf '%s\n' "$1"; return 0; fi; local v; v=$(( $1 & 4294967295 )); if [[ "$v" -gt '2147483647' ]]; then v="-$(( ( v ^ 4294967295 ) + 1 ))"; fi; printf '%s\n' "$v"; }
Example uses:
$ to_int32 -4976622813127
1244282937
$ to_int32 5719164737899
-1731700373
I'm not sure how much I trust it since I'm pretty rusty with bit math, but it's correct for all the ones I've tried so far. I wouldn't be surprised if I made it harder than it needed to be though.
Summary of Bug
On the block page, (e.g. 18318664), the "Proposer Priority" values do not match what the
provenanced q comet-validator-set
has for each validator.Steps to Reproduce
That pbvalcons14z3qgnjh3d2gexl33gzrcrk70y9cscllksn89r is TreeStaker.
If you look at the block page, it'll show that TreeStaker's "Proposer Priority" for that block was
1244282937
(instead of-4976622813127
).Then, since
1244282937
is still within the bounds of 32-bit int, that's the result of casting-4976622813127
into a 32-bit integer. That1244282937
is what explorer lists as Treestakers proposer priority for that block.If it were larger (it'll never be smaller because the sign-bit is now zero), we would want to xor it with
4294967295
, add one, then put a negative sign on it.E.g.
Those
5719164737899
and-1731700373
are Treestaker's proposer priority for block 18318663 (actual and display respectively).For Admin Use