Skip to content
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

Fix panic on first startup when mixing firehose and rpc #4680

Merged

Conversation

leoyvens
Copy link
Collaborator

@leoyvens leoyvens commented Jun 7, 2023

This code was a bit convoluted because we used a Vec<ChainIdentifier>, only to later validate in the store that the vec contained exactly one identifier, which make sense since we don't want conflicting identifiers for a same network. So the data structure is changed to BTreeMap<String, ChainIdentifier>, which naturally allows for de-duplicating the identifier between RPC and firehose providers, and also makes it easy to prefer the RPC identifier.

Fixes #4655.

@leoyvens leoyvens requested a review from neysofu June 7, 2023 13:49
node/src/main.rs Outdated
@@ -305,17 +305,22 @@ async fn main() {
// `blockchain_map`.
let mut blockchain_map = BlockchainMap::new();

// Unwraps: `connect_ethereum_networks` and `connect_firehose_networks` only fail if if
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "if if"

@leoyvens leoyvens force-pushed the leo/fix-first-startup-when-mixing-firehose-and-rpc branch from 32da7f0 to 9161255 Compare June 7, 2023 14:25
@leoyvens leoyvens merged commit 01f36a1 into master Jun 7, 2023
@leoyvens leoyvens deleted the leo/fix-first-startup-when-mixing-firehose-and-rpc branch June 7, 2023 14:43
nabioz pushed a commit to portals-fi/graph-node that referenced this pull request Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Panic on startup
2 participants