Closed pdp2121 closed 4 months ago
Is chain calculation based on ledger index alone?
Is chain calculation based on ledger index alone?
For the most part, yes, if you look here: https://github.com/ripple/validator-history-service/blob/main/src/connection-manager/chains.ts#L193-L245
Meanwhile, networks
uses recent ledger_hash
from ledger
stream, which is the desired behavior as these ledgers have been closed.
High Level Overview of Change
Currently the
validators/{networks}
call still uses chain matching. This led to test validators get pulled to main when there's a test validator validates on main accidentally, and vice versa.for example: if after a leakage, a test validator has chain
main
and networkstest
, all of the mainnet validators will show up onvalidators/test
, which is incorrect.We should just use
networks
field forvalidators/{networks}
itself to mitigate this effect, and also,networks
is updated more frequently usingledger_hash
, which makes it more accurate compared to chain calculation.In the future, we should revise chain calculation and agreement score calculation since there's some minor issues there (will create a ticket for it). The inclusion of
network-id
on the validation stream would also be a permanent solution, but it is still WIP.Type of Change
Test Plan
Leakage should be fixed in staging