Skip to content

Commit

Permalink
Remove errors from log (paritytech#294)
Browse files Browse the repository at this point in the history
* changed log level from error to trace

* incomplete during submit != synced
  • Loading branch information
svyatonik authored and serban300 committed Apr 9, 2024
1 parent a7385b9 commit 41cdc85
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
6 changes: 3 additions & 3 deletions bridges/bin/node/runtime/src/exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
23 changes: 14 additions & 9 deletions bridges/relays/ethereum/src/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
self.header_synced(&new_incomplete_header);
if make_header_incomplete {
self.header_synced(&new_incomplete_header);
}

move_header_descendants::<P>(
&mut [&mut self.ready, &mut self.submitted],
&mut self.incomplete,
Expand All @@ -415,13 +418,15 @@ impl<P: HeadersSyncPipeline> QueuedHeaders<P> {
&new_incomplete_header,
);

log::debug!(
target: "bridge",
"Scheduling completion data retrieval for header: {:?}",
new_incomplete_header,
);
if make_header_incomplete {
log::debug!(
target: "bridge",
"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);
}
}
}

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/ethereum/src/sync_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41cdc85

Please sign in to comment.