keep-network / keep-core

The smart contracts and reference client behind the Keep network
https://keep.network
MIT License
118 stars 73 forks source link

RFC 12 Implementation: Reduce heartbeat probability to 6.25% #3759

Closed lukasz-zimnoch closed 8 months ago

lukasz-zimnoch commented 8 months ago

Refs: https://github.com/keep-network/tbtc-v2/issues/737

The currently used probability of 12.5% means that a completely idle wallet will perform a heartbeat every 4 coordination windows on average (or 8 in the worst case) so, every 3600 blocks (~12 hours assuming a coordination every 900 blocks and 12 seconds per Ethereum block).

User acceptance tests executed on our Sepolia testnet (10 live wallets) show that such a value often leads to simultaneous heartbeats for several wallets at the same time. This, in turn, can cause increased resource consumption for individual nodes and harm some signing processes. Although nothing bad happens if those are just heartbeats, this may be problematic for redemptions and deposit sweeps. To lower the risk of signing failures, we are lowering the heartbeat probability to 6.25%.

The probability of 6.25% means that a completely idle wallet will perform a heartbeat every 8 coordination windows on average (or 16 in the worst case) so, every 7200 blocks (~24 hours assuming a coordination every 900 blocks and 12 seconds per Ethereum block).