This change proposes adding a new validation to validator heartbeat transactions to ensure they are not older than the heartbeat interval + grace period. This change will help ensure that 1) validators who are significantly behind the blockchain (i.e. still syncing) do not submit PoC proposals or gateway reactivations and 2) PoC public keys stored in the ledger do not outlive the private keys stored locally by the validator (and thus causing invalid PoCs).
Currently, heartbeats are validated 1) to make sure they are not ahead of the consensus group validating the transaction and 2) to make sure they are not too soon after the previous heartbeat for that validator. The proposed change in this PR adds another check to make sure that the transaction height is not too old, using the heartbeat interval + grace period as the maximum age. While the miner includes a check to not submit a heartbeat if still synching, this is not currently enforced on chain.
This is likely an edge case, as most validator heartbeats are added to the chain within 2-3 blocks (see below for stats). However, during times of heavily load or in the case of an improperly functioning validator, the difference between the heartbeat transaction height and the height at which it is absorbed, may be significant. The table below shows the count of heartbeat transactions grouped by the difference between the chain height and the heartbeat transaction height in blocks for the last 100000 heartbeats.
This change proposes adding a new validation to validator heartbeat transactions to ensure they are not older than the heartbeat interval + grace period. This change will help ensure that 1) validators who are significantly behind the blockchain (i.e. still syncing) do not submit PoC proposals or gateway reactivations and 2) PoC public keys stored in the ledger do not outlive the private keys stored locally by the validator (and thus causing invalid PoCs).
Currently, heartbeats are validated 1) to make sure they are not ahead of the consensus group validating the transaction and 2) to make sure they are not too soon after the previous heartbeat for that validator. The proposed change in this PR adds another check to make sure that the transaction height is not too old, using the heartbeat interval + grace period as the maximum age. While the miner includes a check to not submit a heartbeat if still synching, this is not currently enforced on chain.
This is likely an edge case, as most validator heartbeats are added to the chain within 2-3 blocks (see below for stats). However, during times of heavily load or in the case of an improperly functioning validator, the difference between the heartbeat transaction height and the height at which it is absorbed, may be significant. The table below shows the count of heartbeat transactions grouped by the difference between the chain height and the heartbeat transaction height in blocks for the last 100000 heartbeats.