Check zero contract root.

This commit is contained in:
Peilun Li 2024-10-11 19:14:32 +08:00
parent bc3a64ea80
commit bbba73efb8

View File

@ -519,9 +519,13 @@ impl LogSyncManager {
.call()
.await
{
Ok(contract_root) => match self.store.get_context() {
Ok(contract_root_bytes) => {
let contract_root = H256::from_slice(&contract_root_bytes);
// contract_root is zero for tx submitted before upgrading.
if !contract_root.is_zero() {
match self.store.get_context() {
Ok((local_root, _)) => {
if H256::from_slice(&contract_root) != local_root {
if contract_root != local_root {
error!(
?contract_root,
?local_root,
@ -533,7 +537,9 @@ impl LogSyncManager {
Err(e) => {
warn!(?e, "fail to read the local flow root");
}
},
}
}
}
Err(e) => {
warn!(?e, "fail to read the on-chain flow root");
}