-
Notifications
You must be signed in to change notification settings - Fork 1k
graphman config check providers #5517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d259620
to
40fcc35
Compare
6a771c7
to
8773434
Compare
store/postgres/src/chain_store.rs
Outdated
fn set_chain_identifier(&self, ident: &ChainIdentifier) -> Result<(), Error> { | ||
use primary::chains as c; | ||
use public::ethereum_networks as n; | ||
|
||
let mut conn = self.pool.get()?; | ||
diesel::update(n::table.filter(n::name.eq(&self.chain))) | ||
.set(( | ||
n::genesis_block_hash.eq(ident.genesis_block_hash.hash_hex()), | ||
n::net_version.eq(&ident.net_version), | ||
)) | ||
.execute(&mut conn)?; | ||
conn.transaction(|conn| { | ||
diesel::update(n::table.filter(n::name.eq(&self.chain))) | ||
.set(( | ||
n::genesis_block_hash.eq(ident.genesis_block_hash.hash_hex()), | ||
n::net_version.eq(&ident.net_version), | ||
)) | ||
.execute(conn)?; | ||
|
||
diesel::update(c::table.filter(c::name.eq(&self.chain))) | ||
.set(( | ||
c::genesis_block_hash.eq(ident.genesis_block_hash.hash_hex()), | ||
c::net_version.eq(&ident.net_version), | ||
)) | ||
.execute(conn) | ||
})?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit confused about the location of these tables. Isn't the chains
table on the primary
shard and ethereum_network
on the shard of the block cache for the chain is, so in this transaction we are only updating the block cache shard right?
Don't we need to update in primary also?
node/src/manager/commands/config.rs
Outdated
println!("Checking providers"); | ||
for (chain_id, ids) in networks.all_chain_identifiers().await.into_iter() { | ||
let (_oks, errs): (Vec<_>, Vec<_>) = ids | ||
.into_iter() | ||
.map(|(provider, id)| { | ||
id.map_err(IdentValidatorError::from) | ||
.and_then(|id| store.check_ident(chain_id, &id).map(|_| (provider, id))) | ||
}) | ||
.partition_result(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick: Felt like this bit could be made a bit more readable, feel free to leave as it is if there's time constraint
node/src/network_setup.rs
Outdated
// let mut adapters: Vec<dyn NetIdentifiable> = | ||
// self.rpc_provider_manager.get_all_unverified(chain_id); | ||
// adapters.extend(self.firehose_provider_manager.get_all_unverified(chain_id)); | ||
// adapters.extend( | ||
// self.substreams_provider_manager | ||
// .get_all_unverified(chain_id), | ||
// ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove these comments?
83fc45f
to
e9d37bc
Compare
e9d37bc
to
2c5d375
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Uh oh!
There was an error while loading. Please reload this page.