Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
log the public key of the validator claiming blocks too frequently
Browse files Browse the repository at this point in the history
Signed-off-by: Benoit Razet <benoit.razet@pokitdok.com>
  • Loading branch information
Benoit Razet committed Apr 20, 2018
1 parent 8946d7b commit 7b40f34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions core/sawtooth_poet/poet_consensus/poet_block_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,11 @@ def initialize_block(self, block_header):
block_cache=self._block_cache,
poet_enclave_module=poet_enclave_module):
LOGGER.info(
'Reject building on block %s: Validator is claiming blocks '
'Reject building on block %s: '
'Validator (signing public key: %s) is claiming blocks '
'too frequently.',
block_header.previous_block_id[:8])
block_header.previous_block_id[:8],
block_header.signer_public_key)
return False

# At this point, we know that if we are able to claim the block we are
Expand Down
2 changes: 1 addition & 1 deletion core/tests/test_consensus/test_poet_block_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def test_z_policy(
# function fails for the reason we expect.

(message, *_), _ = mock_logger.info.call_args
self.assertTrue('Validator is claiming blocks too '
self.assertTrue('is claiming blocks too '
'frequently' in message)

@mock.patch('sawtooth_poet.poet_consensus.poet_block_publisher.'
Expand Down

0 comments on commit 7b40f34

Please sign in to comment.