Open gusin13 opened 1 month ago
Fixed the query in babylon-contract https://github.com/babylonlabs-io/babylon-contract/pull/71
Hey @gusin13, the idea of SyncFinalityProviderStatus
is to mark it as registered if the FP exists on chain
Should we use a query that verifies that the FP exists on the consumer chain?
@RafilxTenfen yes correct, we can first check if the FP exists on the consumer chain and then query VP.
Bug Description
SyncFinalityProviderStatus
incorrectly updating the status of Finality Providers (FPs) that don't actually exist on the consumer chain.https://github.com/babylonlabs-io/finality-provider/blob/627a8d0b64817f34789069abb5f34d6d3258afeb/finality-provider/service/app.go#L256
Current Behavior
SyncFinalityProviderStatus
queries voting power for all locally stored FPs without checking their existence on the chain.QueryFinalityProviderVotingPower
return a response (with zero power) even for non-existent FPs.SyncFinalityProviderStatus
to update statuses of FPs that aren't actually on the chain.Expected Behavior
SyncFinalityProviderStatus
should only update statuses for FPs that actually exist on the consumer chain.Root Cause
SyncFinalityProviderStatus
before querying power.QueryFinalityProviderVotingPower
across consumers.Notes
The Babylon contract (used in babylon-sdk) currently returns a zero power response instead of an error for non-existent FPs:
this causes the SyncFinalityProviderStatus to mark the FP as REGISTERED even if it doesn't exist on the consumer chain
This problem doesn't occur for Babylon finality provider as Babylon grpc query returns err if FP doesn't exist