graphman config check providers#5517
Merged
Merged
Conversation
mangas
force-pushed
the
filipe/graphman-config-providers
branch
from
June 28, 2024 13:19
d259620 to
40fcc35
Compare
mangas
marked this pull request as ready for review
June 28, 2024 15:24
mangas
force-pushed
the
filipe/graphman-config-providers
branch
from
July 9, 2024 06:07
6a771c7 to
8773434
Compare
incrypto32
reviewed
Jul 9, 2024
Comment on lines
+2311
to
+2330
| 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) | ||
| })?; |
Member
There was a problem hiding this comment.
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?
incrypto32
reviewed
Jul 9, 2024
Comment on lines
+28
to
+37
| 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(); |
Member
There was a problem hiding this comment.
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
Comment on lines
+151
to
+157
| // 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), | ||
| // ); |
Member
There was a problem hiding this comment.
Should we remove these comments?
mangas
force-pushed
the
filipe/graphman-config-providers
branch
3 times, most recently
from
July 10, 2024 13:42
83fc45f to
e9d37bc
Compare
mangas
force-pushed
the
filipe/graphman-config-providers
branch
from
July 10, 2024 13:44
e9d37bc to
2c5d375
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.