Skip to content

[V108-specific] Sum-invariant Adjust #check-lint-warning

Multipartite requested to merge Multi/invariant-adjust into develop

[V108-specific]

Intended to resolve the off-by-one provider bond sums and
thor12qwtrq4njj2s29gq56jun43dvxalejaksptqqn
bond provider amount issues described in !2792 (closed) 'Query all node bonds and all provider bonds'
(in turn in response to #1484 (closed) 'query all node accounts').

This draws from #1404/!2521 (closed) (August 2022) 'Invariant block reward' in that rounded fractions of an amount can add to less or more than the intended amount.
|
For block rewards, the approach was to subtract rounded pool rewards from the total system income to arrive at the bond reward.
Here, the approach is to subtract non-operator provider bonds from the without-fee total bond to get the without-fee operator bond.
|
A hypothetical edge case is when the without-fee operator bond is 0, in which case the off-by-one possibility from summing rounded fractions still exists
(but I believe to be no worse than the current state).

For .tqqn, my current impression is that this should also resolve the .tqqn bond amount (display) discrepancy,
in that a bond sum of 0 will not cause GetSafeShare to keep the node operator's without-fee bond at 0
(for which reason the sole provider's bond has been treated as only the fee, not the full node bond).

Update:
Block 8500000 querier result for thor12qwtrq4njj2s29gq56jun43dvxalejaksptqqn attached, from current code (v1.105.0)
( https://thornode-v1.ninerealms.com/thorchain/node/thor12qwtrq4njj2s29gq56jun43dvxalejaksptqqn?height=8500000 )
and from this MR.
2023-02-20__v1.105.0__current-code_thor12qwtrq4njj2s29gq56jun43dvxalejaksptqqn.json
2023-02-20__2794_thor12qwtrq4njj2s29gq56jun43dvxalejaksptqqn.json

Further update: Thanks to Ursa, thornode-v0 now works without panicking!
#1486 and !2796 (closed) now made.

Edited by Multipartite

Merge request reports

Loading