mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 17:01:02 +00:00
grandpa: log everything under afg target (#4443)
This commit is contained in:
committed by
Robert Habermeier
parent
8f1b5b840d
commit
1fc3060feb
@@ -258,7 +258,7 @@ where
|
|||||||
// check if the given best block is in the same branch as the block that signaled the change.
|
// check if the given best block is in the same branch as the block that signaled the change.
|
||||||
if is_descendent_of(&change.canon_hash, &best_hash)? {
|
if is_descendent_of(&change.canon_hash, &best_hash)? {
|
||||||
// apply this change: make the set canonical
|
// apply this change: make the set canonical
|
||||||
info!(target: "finality", "Applying authority set change forced at block #{:?}",
|
info!(target: "afg", "Applying authority set change forced at block #{:?}",
|
||||||
change.canon_height);
|
change.canon_height);
|
||||||
telemetry!(CONSENSUS_INFO; "afg.applying_forced_authority_set_change";
|
telemetry!(CONSENSUS_INFO; "afg.applying_forced_authority_set_change";
|
||||||
"block" => ?change.canon_height
|
"block" => ?change.canon_height
|
||||||
@@ -324,7 +324,7 @@ where
|
|||||||
self.pending_forced_changes.clear();
|
self.pending_forced_changes.clear();
|
||||||
|
|
||||||
if let Some(change) = change {
|
if let Some(change) = change {
|
||||||
info!(target: "finality", "Applying authority set change scheduled at block #{:?}",
|
info!(target: "afg", "Applying authority set change scheduled at block #{:?}",
|
||||||
change.canon_height);
|
change.canon_height);
|
||||||
telemetry!(CONSENSUS_INFO; "afg.applying_scheduled_authority_set_change";
|
telemetry!(CONSENSUS_INFO; "afg.applying_scheduled_authority_set_change";
|
||||||
"block" => ?change.canon_height
|
"block" => ?change.canon_height
|
||||||
|
|||||||
@@ -1010,8 +1010,8 @@ pub(crate) fn finalize_block<B, Block: BlockT<Hash=H256>, E, RA>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if let Err(e) = write_result {
|
if let Err(e) = write_result {
|
||||||
warn!(target: "finality", "Failed to write updated consensus changes to disk. Bailing.");
|
warn!(target: "afg", "Failed to write updated consensus changes to disk. Bailing.");
|
||||||
warn!(target: "finality", "Node is in a potentially inconsistent state.");
|
warn!(target: "afg", "Node is in a potentially inconsistent state.");
|
||||||
|
|
||||||
return Err(e.into());
|
return Err(e.into());
|
||||||
}
|
}
|
||||||
@@ -1063,7 +1063,7 @@ pub(crate) fn finalize_block<B, Block: BlockT<Hash=H256>, E, RA>(
|
|||||||
// ideally some handle to a synchronization oracle would be used
|
// ideally some handle to a synchronization oracle would be used
|
||||||
// to avoid unconditionally notifying.
|
// to avoid unconditionally notifying.
|
||||||
client.apply_finality(import_op, BlockId::Hash(hash), justification, true).map_err(|e| {
|
client.apply_finality(import_op, BlockId::Hash(hash), justification, true).map_err(|e| {
|
||||||
warn!(target: "finality", "Error applying finality to block {:?}: {:?}", (hash, number), e);
|
warn!(target: "afg", "Error applying finality to block {:?}: {:?}", (hash, number), e);
|
||||||
e
|
e
|
||||||
})?;
|
})?;
|
||||||
telemetry!(CONSENSUS_INFO; "afg.finalized_blocks_up_to";
|
telemetry!(CONSENSUS_INFO; "afg.finalized_blocks_up_to";
|
||||||
@@ -1103,8 +1103,8 @@ pub(crate) fn finalize_block<B, Block: BlockT<Hash=H256>, E, RA>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if let Err(e) = write_result {
|
if let Err(e) = write_result {
|
||||||
warn!(target: "finality", "Failed to write updated authority set to disk. Bailing.");
|
warn!(target: "afg", "Failed to write updated authority set to disk. Bailing.");
|
||||||
warn!(target: "finality", "Node is in a potentially inconsistent state.");
|
warn!(target: "afg", "Node is in a potentially inconsistent state.");
|
||||||
|
|
||||||
return Err(e.into());
|
return Err(e.into());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ impl<B, Block> sc_network::FinalityProofProvider<Block> for FinalityProofProvide
|
|||||||
) -> Result<Option<Vec<u8>>, ClientError> {
|
) -> Result<Option<Vec<u8>>, ClientError> {
|
||||||
let request: FinalityProofRequest<Block::Hash> = Decode::decode(&mut &request[..])
|
let request: FinalityProofRequest<Block::Hash> = Decode::decode(&mut &request[..])
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
warn!(target: "finality", "Unable to decode finality proof request: {}", e.what());
|
warn!(target: "afg", "Unable to decode finality proof request: {}", e.what());
|
||||||
ClientError::Backend(format!("Invalid finality proof request"))
|
ClientError::Backend(format!("Invalid finality proof request"))
|
||||||
})?;
|
})?;
|
||||||
match request {
|
match request {
|
||||||
@@ -269,7 +269,7 @@ pub(crate) fn prove_finality<Block: BlockT<Hash=H256>, B: BlockchainBackend<Bloc
|
|||||||
let info = blockchain.info();
|
let info = blockchain.info();
|
||||||
if info.finalized_number <= begin_number {
|
if info.finalized_number <= begin_number {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Requested finality proof for descendant of #{} while we only have finalized #{}. Returning empty proof.",
|
"Requested finality proof for descendant of #{} while we only have finalized #{}. Returning empty proof.",
|
||||||
begin_number,
|
begin_number,
|
||||||
info.finalized_number,
|
info.finalized_number,
|
||||||
@@ -344,7 +344,7 @@ pub(crate) fn prove_finality<Block: BlockT<Hash=H256>, B: BlockchainBackend<Bloc
|
|||||||
);
|
);
|
||||||
if justification_check_result.is_err() {
|
if justification_check_result.is_err() {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Can not provide finality proof with requested set id #{}\
|
"Can not provide finality proof with requested set id #{}\
|
||||||
(possible forced change?). Returning empty proof.",
|
(possible forced change?). Returning empty proof.",
|
||||||
authorities_set_id,
|
authorities_set_id,
|
||||||
@@ -387,7 +387,7 @@ pub(crate) fn prove_finality<Block: BlockT<Hash=H256>, B: BlockchainBackend<Bloc
|
|||||||
|
|
||||||
if finality_proof.is_empty() {
|
if finality_proof.is_empty() {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"No justifications found when making finality proof for {}. Returning empty proof.",
|
"No justifications found when making finality proof for {}. Returning empty proof.",
|
||||||
end,
|
end,
|
||||||
);
|
);
|
||||||
@@ -395,7 +395,7 @@ pub(crate) fn prove_finality<Block: BlockT<Hash=H256>, B: BlockchainBackend<Bloc
|
|||||||
Ok(None)
|
Ok(None)
|
||||||
} else {
|
} else {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Built finality proof for {} of {} fragments. Last fragment for {}.",
|
"Built finality proof for {} of {} fragments. Last fragment for {}.",
|
||||||
end,
|
end,
|
||||||
finality_proof.len(),
|
finality_proof.len(),
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ impl<B, E, Block: BlockT<Hash=H256>, RA, SC> BlockImport<Block>
|
|||||||
Some(justification) => {
|
Some(justification) => {
|
||||||
self.import_justification(hash, number, justification, needs_justification).unwrap_or_else(|err| {
|
self.import_justification(hash, number, justification, needs_justification).unwrap_or_else(|err| {
|
||||||
if needs_justification || enacts_consensus_change {
|
if needs_justification || enacts_consensus_change {
|
||||||
debug!(target: "finality", "Imported block #{} that enacts authority set change with \
|
debug!(target: "afg", "Imported block #{} that enacts authority set change with \
|
||||||
invalid justification: {:?}, requesting justification from peers.", number, err);
|
invalid justification: {:?}, requesting justification from peers.", number, err);
|
||||||
imported_aux.bad_justification = true;
|
imported_aux.bad_justification = true;
|
||||||
imported_aux.needs_justification = true;
|
imported_aux.needs_justification = true;
|
||||||
@@ -482,7 +482,7 @@ impl<B, E, Block: BlockT<Hash=H256>, RA, SC> BlockImport<Block>
|
|||||||
None => {
|
None => {
|
||||||
if needs_justification {
|
if needs_justification {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Imported unjustified block #{} that enacts authority set change, waiting for finality for enactment.",
|
"Imported unjustified block #{} that enacts authority set change, waiting for finality for enactment.",
|
||||||
number,
|
number,
|
||||||
);
|
);
|
||||||
@@ -573,7 +573,7 @@ where
|
|||||||
|
|
||||||
match result {
|
match result {
|
||||||
Err(CommandOrError::VoterCommand(command)) => {
|
Err(CommandOrError::VoterCommand(command)) => {
|
||||||
info!(target: "finality", "Imported justification for block #{} that triggers \
|
info!(target: "afg", "Imported justification for block #{} that triggers \
|
||||||
command {}, signaling voter.", number, command);
|
command {}, signaling voter.", number, command);
|
||||||
|
|
||||||
// send the command to the voter
|
// send the command to the voter
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ fn do_import_block<B, C, Block: BlockT<Hash=H256>, J>(
|
|||||||
match justification {
|
match justification {
|
||||||
Some(justification) => {
|
Some(justification) => {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Imported block {}{}. Importing justification.",
|
"Imported block {}{}. Importing justification.",
|
||||||
if enacts_consensus_change { " which enacts consensus changes" } else { "" },
|
if enacts_consensus_change { " which enacts consensus changes" } else { "" },
|
||||||
hash,
|
hash,
|
||||||
@@ -273,7 +273,7 @@ fn do_import_block<B, C, Block: BlockT<Hash=H256>, J>(
|
|||||||
},
|
},
|
||||||
None if enacts_consensus_change => {
|
None if enacts_consensus_change => {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Imported block {} which enacts consensus changes. Requesting finality proof.",
|
"Imported block {} which enacts consensus changes. Requesting finality proof.",
|
||||||
hash,
|
hash,
|
||||||
);
|
);
|
||||||
@@ -393,7 +393,7 @@ fn do_import_justification<B, C, Block: BlockT<Hash=H256>, J>(
|
|||||||
let justification = match justification {
|
let justification = match justification {
|
||||||
Err(ClientError::BadJustification(_)) => {
|
Err(ClientError::BadJustification(_)) => {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Justification for {} is not valid within current authorities set. Requesting finality proof.",
|
"Justification for {} is not valid within current authorities set. Requesting finality proof.",
|
||||||
hash,
|
hash,
|
||||||
);
|
);
|
||||||
@@ -404,7 +404,7 @@ fn do_import_justification<B, C, Block: BlockT<Hash=H256>, J>(
|
|||||||
},
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Justification for {} is not valid. Bailing.",
|
"Justification for {} is not valid. Bailing.",
|
||||||
hash,
|
hash,
|
||||||
);
|
);
|
||||||
@@ -413,7 +413,7 @@ fn do_import_justification<B, C, Block: BlockT<Hash=H256>, J>(
|
|||||||
},
|
},
|
||||||
Ok(justification) => {
|
Ok(justification) => {
|
||||||
trace!(
|
trace!(
|
||||||
target: "finality",
|
target: "afg",
|
||||||
"Justification for {} is valid. Finalizing the block.",
|
"Justification for {} is valid. Finalizing the block.",
|
||||||
hash,
|
hash,
|
||||||
);
|
);
|
||||||
@@ -444,7 +444,7 @@ fn do_finalize_block<B, C, Block: BlockT<Hash=H256>>(
|
|||||||
{
|
{
|
||||||
// finalize the block
|
// finalize the block
|
||||||
client.finalize_block(BlockId::Hash(hash), Some(justification), true).map_err(|e| {
|
client.finalize_block(BlockId::Hash(hash), Some(justification), true).map_err(|e| {
|
||||||
warn!(target: "finality", "Error applying finality to block {:?}: {:?}", (hash, number), e);
|
warn!(target: "afg", "Error applying finality to block {:?}: {:?}", (hash, number), e);
|
||||||
ConsensusError::ClientImport(e.to_string())
|
ConsensusError::ClientImport(e.to_string())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
@@ -532,8 +532,8 @@ fn require_insert_aux<T: Encode, A: AuxStore>(
|
|||||||
|
|
||||||
/// Display inconsistency warning.
|
/// Display inconsistency warning.
|
||||||
fn on_post_finalization_error(error: ClientError, value_type: &str) -> ConsensusError {
|
fn on_post_finalization_error(error: ClientError, value_type: &str) -> ConsensusError {
|
||||||
warn!(target: "finality", "Failed to write updated {} to disk. Bailing.", value_type);
|
warn!(target: "afg", "Failed to write updated {} to disk. Bailing.", value_type);
|
||||||
warn!(target: "finality", "Node is in a potentially inconsistent state.");
|
warn!(target: "afg", "Node is in a potentially inconsistent state.");
|
||||||
ConsensusError::ClientImport(error.to_string())
|
ConsensusError::ClientImport(error.to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user