Skip to content

Commit

Permalink
don't fail ingestor on net_version changed from zero (#4692)
Browse files Browse the repository at this point in the history
Co-authored-by: Stéphane Duchesneau <stephane.duchesneau@streamingfast.io>
  • Loading branch information
sduchesneau and sduchesneau authored Jun 14, 2023
1 parent 39094b1 commit c8b04a7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions store/postgres/src/block_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c8b04a7

Please sign in to comment.