[Performance] Use GetMinJoinLast instead of GetMinJoinVersion for NodeAccountPreflightCheck
GetMinJoinLast
was a necessary approach to be able to check constants.ChurnOutForLowVersionBlocks
in !2849 (merged)
'Modify mark-for-churn-out timing',
specifically here.
Please note that when MinJoinLast is not set, GetMinJoinLast
falls back to GetMinJoinVersion
.
The very first next_since_height
was when first set, the first churn block of v1.110.0 .
https://thornode-v1.ninerealms.com/thorchain/version?height=10923276
https://thornode-v1.ninerealms.com/thorchain/version?height=10923277
The first block of v1.110.0 was block 10893314 (2023-05-18),
and block 10923277 (2023-05-20) was two days later.
(A churn block, like a set_version, checks and may update the MinJoinLast because it may change it.)
Now that v1.111.0 has been released, the next_changed_height
has been updated to block 11167205, the block in which next
changed from 1.110.0 to 1.111.0 (when node .ju9g set its version).
https://thornode-v1.ninerealms.com/thorchain/version?height=11167204
https://thornode-v1.ninerealms.com/thorchain/version?height=11167205
Having this reassurance that GetMinJoinLast
behaves as intended, other cases which currently call GetMinJoinVersion
directly can use it instead. Specifically, two cases remaining in manager_validator_current.go
.
One case is called only infrequently, and is in findLowVersionValidators
, called only in a keygen block.
However, the other is in NodeAccountPreflightCheck
, which outside of keygen blocks is also called by the querier's getNodePreflightResult
,
which notably is called once each for every node when checking the /nodes endpoint.
Please note that GetMinJoinVersion
when called does two sorts.
I thus propose that the validator manager be updated to use GetMinJoinLast
instead of GetMinJoinVersion
for these two cases,
especially so that the /nodes endpoint preflight checks can refer to the single saved MinJoinLast version instead of recalculating it for every node displayed (which is effectively all nodes, not only Active nodes).
Specifically: !2940 (merged)
'Use GetMinJoinLast instead of GetMinJoinVersion for /nodes querier-called NodeAccountPreflightCheck (and churn low-version finding)'.