Remove errors from log (#294)

* changed log level from error to trace

* incomplete during submit != synced
This commit is contained in:
Svyatoslav Nikolsky
2020-08-19 13:32:54 +03:00
committed by Bastian Köcher
parent b2c3238501
commit 1823923a79
3 changed files with 18 additions and 13 deletions
+3 -3
View File
@@ -81,7 +81,7 @@ impl MaybeLockFundsTransaction for EthTransaction {
// we only accept transactions sending funds directly to the pre-configured address // we only accept transactions sending funds directly to the pre-configured address
if tx.unsigned.to != Some(LOCK_FUNDS_ADDRESS.into()) { if tx.unsigned.to != Some(LOCK_FUNDS_ADDRESS.into()) {
frame_support::debug::error!( frame_support::debug::trace!(
target: "runtime", target: "runtime",
"Failed to parse fund locks transaction. Invalid peer recipient: {:?}", "Failed to parse fund locks transaction. Invalid peer recipient: {:?}",
tx.unsigned.to, tx.unsigned.to,
@@ -94,7 +94,7 @@ impl MaybeLockFundsTransaction for EthTransaction {
match tx.unsigned.payload.len() { match tx.unsigned.payload.len() {
32 => recipient_raw.as_fixed_bytes_mut().copy_from_slice(&tx.unsigned.payload), 32 => recipient_raw.as_fixed_bytes_mut().copy_from_slice(&tx.unsigned.payload),
len => { len => {
frame_support::debug::error!( frame_support::debug::trace!(
target: "runtime", target: "runtime",
"Failed to parse fund locks transaction. Invalid recipient length: {}", "Failed to parse fund locks transaction. Invalid recipient length: {}",
len, len,
@@ -106,7 +106,7 @@ impl MaybeLockFundsTransaction for EthTransaction {
let amount = tx.unsigned.value.low_u128(); let amount = tx.unsigned.value.low_u128();
if tx.unsigned.value != amount.into() { if tx.unsigned.value != amount.into() {
frame_support::debug::error!( frame_support::debug::trace!(
target: "runtime", target: "runtime",
"Failed to parse fund locks transaction. Invalid amount: {}", "Failed to parse fund locks transaction. Invalid amount: {}",
tx.unsigned.value, tx.unsigned.value,
+14 -9
View File
@@ -404,9 +404,12 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> {
} }
/// Marks given headers incomplete. /// Marks given headers incomplete.
pub fn add_incomplete_headers(&mut self, new_incomplete_headers: Vec<HeaderIdOf<P>>) { pub fn add_incomplete_headers(&mut self, make_header_incomplete: bool, new_incomplete_headers: Vec<HeaderIdOf<P>>) {
for new_incomplete_header in new_incomplete_headers { for new_incomplete_header in new_incomplete_headers {
self.header_synced(&new_incomplete_header); if make_header_incomplete {
self.header_synced(&new_incomplete_header);
}
move_header_descendants::<P>( move_header_descendants::<P>(
&mut [&mut self.ready, &mut self.submitted], &mut [&mut self.ready, &mut self.submitted],
&mut self.incomplete, &mut self.incomplete,
@@ -415,13 +418,15 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> {
&new_incomplete_header, &new_incomplete_header,
); );
log::debug!( if make_header_incomplete {
target: "bridge", log::debug!(
"Scheduling completion data retrieval for header: {:?}", target: "bridge",
new_incomplete_header, "Scheduling completion data retrieval for header: {:?}",
); new_incomplete_header,
);
self.incomplete_headers.insert(new_incomplete_header, None); self.incomplete_headers.insert(new_incomplete_header, None);
}
} }
} }
@@ -434,7 +439,7 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> {
.filter(|id| !self.incomplete_headers.contains_key(id) && !self.completion_data.contains_key(id)) .filter(|id| !self.incomplete_headers.contains_key(id) && !self.completion_data.contains_key(id))
.cloned() .cloned()
.collect::<Vec<_>>(); .collect::<Vec<_>>();
self.add_incomplete_headers(new_incomplete_headers); self.add_incomplete_headers(true, new_incomplete_headers);
// for all headers that were incompleted previously, but now are completed, we move // for all headers that were incompleted previously, but now are completed, we move
// all descendants from incomplete to ready // all descendants from incomplete to ready
+1 -1
View File
@@ -334,7 +334,7 @@ pub fn run<P: HeadersSyncPipeline, TC: TargetClient<P>>(
log::debug!(target: "bridge", "Header submit result: {}", submitted_headers_str); log::debug!(target: "bridge", "Header submit result: {}", submitted_headers_str);
sync.headers_mut().headers_submitted(submitted_headers.submitted); sync.headers_mut().headers_submitted(submitted_headers.submitted);
sync.headers_mut().add_incomplete_headers(submitted_headers.incomplete); sync.headers_mut().add_incomplete_headers(false, submitted_headers.incomplete);
// when there's no fatal error, but node has rejected all our headers we may // when there's no fatal error, but node has rejected all our headers we may
// want to pause until our submitted headers will be accepted // want to pause until our submitted headers will be accepted