diff --git a/light-clients/ethereum-light-client/src/client.rs b/light-clients/ethereum-light-client/src/client.rs index 0c6401a26b..b82cae5c28 100644 --- a/light-clients/ethereum-light-client/src/client.rs +++ b/light-clients/ethereum-light-client/src/client.rs @@ -305,17 +305,13 @@ impl IbcClient for EthereumLightClient { // Next sync committee for a consensus height can be set if it is not being set // previously, but it cannot be changed or unset after being set. - match ( + if let (Some(lhs), Some(rhs)) = ( consensus_state.data.next_sync_committee, header.consensus_update.next_sync_committee, ) { - (Some(_), None) => return Err(Error::NextSyncCommitteeCannotBeModified), - (Some(lhs), Some(rhs)) => { - if lhs != rhs.aggregate_pubkey { - return Err(Error::NextSyncCommitteeCannotBeModified); - } + if lhs != rhs.aggregate_pubkey { + return Err(Error::NextSyncCommitteeCannotBeModified); } - _ => {} } // NOTE(aeryz): we don't check the timestamp here since it is calculated based on the diff --git a/voyager/src/chain/evm.rs b/voyager/src/chain/evm.rs index 66fd037413..1c5d11e967 100644 --- a/voyager/src/chain/evm.rs +++ b/voyager/src/chain/evm.rs @@ -1691,6 +1691,8 @@ where let does_not_have_finality_update = last_update_block_number >= req.update_to.revision_height; + tracing::error!(last_update_block_number, req.update_to.revision_height); + let finality_update_msg = if does_not_have_finality_update { // do nothing None diff --git a/voyager/src/main.rs b/voyager/src/main.rs index d46e426f49..2489ec5346 100644 --- a/voyager/src/main.rs +++ b/voyager/src/main.rs @@ -9,7 +9,7 @@ )] // #![deny(clippy::unwrap_used)] -use std::{ffi::OsString, fs::read_to_string, process::ExitCode}; +use std::{error::Error, ffi::OsString, fs::read_to_string, process::ExitCode}; use chain_utils::{evm::Evm, union::Union}; use clap::Parser; @@ -44,6 +44,9 @@ async fn main() -> ExitCode { Ok(()) => ExitCode::SUCCESS, Err(err) => { eprintln!("Error: {err}"); + if let Some(source) = err.source() { + eprintln!("Caused by: {source}"); + } ExitCode::FAILURE } } @@ -232,21 +235,23 @@ mod tests { .unwrap() .into_deserialize::() { + let record = record.unwrap(); let json = - serde_json::from_str::>(&record.unwrap().data) - .unwrap(); + serde_json::from_str::>(&record.data).unwrap(); let update_from = json.update_from; - let msg = json.msg.client_message.data.consensus_update; + let msg = json.msg.client_message.data; println!( - "update_from: {}\nattested beacon slot: {}\nattested execution block number: {}\nfinalized beacon slot: {}\nfinalized execution block number: {}\n", + "id: {}\nupdate_from: {}\nattested beacon slot: {}\nattested execution block number: {}\nfinalized beacon slot: {}\nfinalized execution block number: {}\nnext_sync_committee: {}\n", + record.id, update_from, - msg.attested_header.beacon.slot, - msg.attested_header.execution.block_number, - msg.finalized_header.beacon.slot, - msg.finalized_header.execution.block_number, + msg.consensus_update.attested_header.beacon.slot, + msg.consensus_update.attested_header.execution.block_number, + msg.consensus_update.finalized_header.beacon.slot, + msg.consensus_update.finalized_header.execution.block_number, + msg.consensus_update.next_sync_committee.is_some(), ); } }