Don't use 1-block initial proof delay on testnet/devnet

This routinely causes issues because we often register many at once of
devnet/testnet when testing: if the registration brings too may online
at once you can end up in a situation where pulse just activated, but
there are not enough nodes sending proofs for there to be a reachable
pulse quorum because of this delay.
This commit is contained in:
Jason Rhinelander 2022-04-19 20:15:06 -03:00
parent f360775cfe
commit c04788e820
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
1 changed files with 4 additions and 2 deletions

View File

@ -2259,8 +2259,10 @@ namespace cryptonote
{
std::vector<service_nodes::service_node_pubkey_info> const states = get_service_node_list_state({ m_service_keys.pub });
// wait one block before starting uptime proofs.
if (!states.empty() && (states[0].info->registration_height + 1) < get_current_blockchain_height())
// wait one block before starting uptime proofs (but not on testnet/devnet, where we sometimes
// have mass registrations/deregistrations where the waiting causes problems).
uint64_t delay_blocks = m_nettype == MAINNET ? 1 : 0;
if (!states.empty() && (states[0].info->registration_height + delay_blocks) < get_current_blockchain_height())
{
m_check_uptime_proof_interval.do_call([this]() {
// This timer is not perfectly precise and can leak seconds slightly, so send the uptime