temp: Raise log levels for debuggin

This commit is contained in:
Doyle 2020-08-20 10:01:00 +10:00 committed by Jason Rhinelander
parent 6cf53600e1
commit 81afcdd1a6
2 changed files with 25 additions and 25 deletions

View File

@ -1297,7 +1297,7 @@ namespace service_nodes
{
if (!pulse::get_round_timings(m_blockchain, height, timings))
{
MERROR("Failed to query the block data for Pulse timings to validate incoming block at height " << height);
LOG_PRINT_L0("Failed to query the block data for Pulse timings to validate incoming block at height " << height);
return false;
}
}
@ -1319,26 +1319,26 @@ namespace service_nodes
{
if (is_pulse_block(block))
{
LOG_PRINT_L1("Pulse block received but only miner blocks are permitted\n" << dump_pulse_block_data(block, pulse_quorum.get()));
LOG_PRINT_L0("Pulse block received but only miner blocks are permitted\n" << dump_pulse_block_data(block, pulse_quorum.get()));
return false;
}
if (block.pulse.round != 0)
{
MERROR("Miner block given but unexpectedly set round " << block.pulse.round << " on height " << height);
LOG_PRINT_L0("Miner block given but unexpectedly set round " << block.pulse.round << " on height " << height);
return false;
}
if (block.pulse.validator_bitset != 0)
{
std::bitset<8 * sizeof(block.pulse.validator_bitset)> const bitset = block.pulse.validator_bitset;
MERROR("Miner block given but unexpectedly set validator bitset " << bitset << " on height " << height);
LOG_PRINT_L0("Miner block given but unexpectedly set validator bitset " << bitset << " on height " << height);
return false;
}
if (block.signatures.size())
{
MERROR("Miner block given but unexpectedly has " << block.signatures.size() << " signatures on height " << height);
LOG_PRINT_L0("Miner block given but unexpectedly has " << block.signatures.size() << " signatures on height " << height);
return false;
}
}
@ -1346,38 +1346,38 @@ namespace service_nodes
{
if (!is_pulse_block(block))
{
LOG_PRINT_L1("Miner block received but only pulse blocks are permitted\n" << dump_pulse_block_data(block, pulse_quorum.get()));
LOG_PRINT_L0("Miner block received but only pulse blocks are permitted\n" << dump_pulse_block_data(block, pulse_quorum.get()));
return false;
}
if (!pulse_quorum)
{
LOG_PRINT_L1("Pulse block received but no Pulse quorum was available for this block\n" << dump_pulse_block_data(block, pulse_quorum.get()));
LOG_PRINT_L0("Pulse block received but no Pulse quorum was available for this block\n" << dump_pulse_block_data(block, pulse_quorum.get()));
return false;
}
if (block.pulse.validator_bitset == 0)
{
MERROR("Pulse block given but unexpected empty validator bitset on height " << height);
LOG_PRINT_L0("Pulse block given but unexpected empty validator bitset on height " << height);
return false;
}
if (block.signatures.size() != service_nodes::PULSE_BLOCK_REQUIRED_SIGNATURES)
{
MERROR("Pulseblock given but unexpectedly has the wrong number (" << block.signatures.size() << ") of signatures on height " << height);
LOG_PRINT_L0("Pulseblock given but unexpectedly has the wrong number (" << block.signatures.size() << ") of signatures on height " << height);
return false;
}
if (block.nonce != 0)
{
LOG_PRINT_L1("Pulse block specified a nonce when quorum block generation is available, nonce: " << block.nonce);
LOG_PRINT_L0("Pulse block specified a nonce when quorum block generation is available, nonce: " << block.nonce);
return false;
}
if (block.pulse.validator_bitset >= (1 << PULSE_QUORUM_NUM_VALIDATORS))
{
auto mask = std::bitset<sizeof(pulse_validator_bit_mask()) * 8>(pulse_validator_bit_mask());
LOG_PRINT_L1("Pulse block specifies validator bitset out of bounds. Expected the bit mask " << mask << "\n" << dump_pulse_block_data(block, pulse_quorum.get()));
LOG_PRINT_L0("Pulse block specifies validator bitset out of bounds. Expected the bit mask " << mask << "\n" << dump_pulse_block_data(block, pulse_quorum.get()));
return false;
}
@ -1388,7 +1388,7 @@ namespace service_nodes
cryptonote::get_block_hash(block),
block.signatures, block))
{
LOG_PRINT_L1("Pulse signature verification failed: " << dump_pulse_block_data(block, pulse_quorum.get()));
LOG_PRINT_L0("Pulse signature verification failed: " << dump_pulse_block_data(block, pulse_quorum.get()));
return false;
}
}
@ -1398,13 +1398,13 @@ namespace service_nodes
std::shared_ptr<const quorum> quorum = get_quorum(quorum_type::checkpointing, checkpoint->height);
if (!quorum)
{
LOG_PRINT_L1("Failed to get testing quorum checkpoint for block: " << cryptonote::get_block_hash(block));
LOG_PRINT_L0("Failed to get testing quorum checkpoint for block: " << cryptonote::get_block_hash(block));
return false;
}
if (!service_nodes::verify_checkpoint(block.major_version, *checkpoint, *quorum))
{
LOG_PRINT_L1("Service node checkpoint failed verification for block: " << cryptonote::get_block_hash(block));
LOG_PRINT_L0("Service node checkpoint failed verification for block: " << cryptonote::get_block_hash(block));
return false;
}
}

View File

@ -247,13 +247,13 @@ namespace service_nodes
{
if (signatures.size() < service_nodes::CHECKPOINT_MIN_VOTES)
{
LOG_PRINT_L1("Checkpoint has insufficient signatures to be considered at height: " << height);
LOG_PRINT_L0("Checkpoint has insufficient signatures to be considered at height: " << height);
return false;
}
if (signatures.size() > service_nodes::CHECKPOINT_QUORUM_SIZE)
{
LOG_PRINT_L1("Checkpoint has too many signatures to be considered at height: " << height);
LOG_PRINT_L0("Checkpoint has too many signatures to be considered at height: " << height);
return false;
}
@ -265,7 +265,7 @@ namespace service_nodes
{
if (signatures.size() != PULSE_BLOCK_REQUIRED_SIGNATURES)
{
LOG_PRINT_L1("Pulse block has " << signatures.size() << " signatures but requires " << PULSE_BLOCK_REQUIRED_SIGNATURES);
LOG_PRINT_L0("Pulse block has " << signatures.size() << " signatures but requires " << PULSE_BLOCK_REQUIRED_SIGNATURES);
return false;
}
@ -276,13 +276,13 @@ namespace service_nodes
{
auto mask = std::bitset<sizeof(pulse_validator_bit_mask()) * 8>(pulse_validator_bit_mask());
auto other = std::bitset<sizeof(pulse_validator_bit_mask()) * 8>(block.pulse.validator_bitset);
LOG_PRINT_L1("Pulse block specifies validator participation bits out of bounds. Expected the bit mask: " << mask << ", block: " << other);
LOG_PRINT_L0("Pulse block specifies validator participation bits out of bounds. Expected the bit mask: " << mask << ", block: " << other);
return false;
}
}
catch (const std::bad_any_cast &e)
{
LOG_PRINT_L1("Internal Error: Wrong type passed in any object, expected block.");
LOG_PRINT_L0("Internal Error: Wrong type passed in any object, expected block.");
return false;
}
}
@ -299,7 +299,7 @@ namespace service_nodes
if (curr >= next)
{
LOG_PRINT_L1("Voters in signatures are not given in ascending order, failed verification at height: " << height);
LOG_PRINT_L0("Voters in signatures are not given in ascending order, failed verification at height: " << height);
return false;
}
}
@ -315,13 +315,13 @@ namespace service_nodes
uint16_t bit = 1 << quorum_signature.voter_index;
if ((block.pulse.validator_bitset & bit) == 0)
{
LOG_PRINT_L1("Received pulse signature from validator " << static_cast<int>(quorum_signature.voter_index) << " that is not participating in round " << static_cast<int>(block.pulse.round));
LOG_PRINT_L0("Received pulse signature from validator " << static_cast<int>(quorum_signature.voter_index) << " that is not participating in round " << static_cast<int>(block.pulse.round));
return false;
}
}
catch (const std::bad_any_cast &e)
{
LOG_PRINT_L1("Internal Error: Wrong type passed in any object, expected block.");
LOG_PRINT_L0("Internal Error: Wrong type passed in any object, expected block.");
return false;
}
}
@ -329,19 +329,19 @@ namespace service_nodes
crypto::public_key const &key = quorum.validators[quorum_signature.voter_index];
if (quorum_signature.voter_index >= unique_vote_set.size())
{
MERROR("Internal Error: Voter Index indexes out of bounds of the vote set, index: " << quorum_signature.voter_index << "vote set size: " << unique_vote_set.size());
LOG_PRINT_L0("Internal Error: Voter Index indexes out of bounds of the vote set, index: " << quorum_signature.voter_index << "vote set size: " << unique_vote_set.size());
return false;
}
if (unique_vote_set[quorum_signature.voter_index]++)
{
LOG_PRINT_L1("Voter: " << epee::string_tools::pod_to_hex(key) << ", quorum index is duplicated: " << quorum_signature.voter_index << ", failed verification at height: " << height);
LOG_PRINT_L0("Voter: " << epee::string_tools::pod_to_hex(key) << ", quorum index is duplicated: " << quorum_signature.voter_index << ", failed verification at height: " << height);
return false;
}
if (!crypto::check_signature(hash, key, quorum_signature.signature))
{
LOG_PRINT_L1("Incorrect signature for vote, failed verification at height: " << height << " for voter: " << key << "\n" << quorum);
LOG_PRINT_L0("Incorrect signature for vote, failed verification at height: " << height << " for voter: " << key << "\n" << quorum);
return false;
}
}