From c8b04a78c7eaf2d3ba9e27444588dd4ecba5e94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Duchesneau?= Date: Wed, 14 Jun 2023 05:55:24 -0400 Subject: [PATCH] don't fail ingestor on net_version changed from zero (#4692) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stéphane Duchesneau --- store/postgres/src/block_store.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/store/postgres/src/block_store.rs b/store/postgres/src/block_store.rs index 7345428ae12..f63084048f2 100644 --- a/store/postgres/src/block_store.rs +++ b/store/postgres/src/block_store.rs @@ -7,7 +7,7 @@ use std::{ use graph::{ blockchain::ChainIdentifier, components::store::BlockStore as BlockStoreTrait, - prelude::{error, BlockNumber, BlockPtr, Logger, ENV_VARS}, + prelude::{error, warn, BlockNumber, BlockPtr, Logger, ENV_VARS}, }; use graph::{constraint_violation, prelude::CheapClone}; use graph::{ @@ -241,13 +241,21 @@ impl BlockStore { return false; } if chain.net_version != ident.net_version { - error!(logger, + if chain.net_version == "0" { + warn!(logger, + "the net version for chain {} has changed from 0 to {} since the last time we ran, ignoring difference because 0 means UNSET and firehose does not provide it", + chain.name, + ident.net_version, + ) + } else { + error!(logger, "the net version for chain {} has changed from {} to {} since the last time we ran", chain.name, chain.net_version, ident.net_version ); - return false; + return false; + } } if chain.genesis_block != ident.genesis_block_hash.hash_hex() { error!(logger,