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
if tx.unsigned.to != Some(LOCK_FUNDS_ADDRESS.into()) {
frame_support::debug::error!(
frame_support::debug::trace!(
target: "runtime",
"Failed to parse fund locks transaction. Invalid peer recipient: {:?}",
tx.unsigned.to,
@@ -94,7 +94,7 @@ impl MaybeLockFundsTransaction for EthTransaction {
match tx.unsigned.payload.len() {
32 => recipient_raw.as_fixed_bytes_mut().copy_from_slice(&tx.unsigned.payload),
len => {
frame_support::debug::error!(
frame_support::debug::trace!(
target: "runtime",
"Failed to parse fund locks transaction. Invalid recipient length: {}",
len,
@@ -106,7 +106,7 @@ impl MaybeLockFundsTransaction for EthTransaction {
let amount = tx.unsigned.value.low_u128();
if tx.unsigned.value != amount.into() {
frame_support::debug::error!(
frame_support::debug::trace!(
target: "runtime",
"Failed to parse fund locks transaction. Invalid amount: {}",
tx.unsigned.value,
+7 -2
View File
@@ -404,9 +404,12 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> {
}
/// 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 {
if make_header_incomplete {
self.header_synced(&new_incomplete_header);
}
move_header_descendants::<P>(
&mut [&mut self.ready, &mut self.submitted],
&mut self.incomplete,
@@ -415,6 +418,7 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> {
&new_incomplete_header,
);
if make_header_incomplete {
log::debug!(
target: "bridge",
"Scheduling completion data retrieval for header: {:?}",
@@ -424,6 +428,7 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> {
self.incomplete_headers.insert(new_incomplete_header, None);
}
}
}
/// When incomplete headers ids are receved from target node.
pub fn incomplete_headers_response(&mut self, ids: HashSet<HeaderIdOf<P>>) {
@@ -434,7 +439,7 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> {
.filter(|id| !self.incomplete_headers.contains_key(id) && !self.completion_data.contains_key(id))
.cloned()
.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
// 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);
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
// want to pause until our submitted headers will be accepted