-
Notifications
You must be signed in to change notification settings - Fork 387
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
Cosmos grpc fallbackprovider #3139
Conversation
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3139 +/- ##
=======================================
Coverage 67.65% 67.65%
=======================================
Files 99 99
Lines 1014 1014
Branches 106 106
=======================================
Hits 686 686
Misses 284 284
Partials 44 44
|
…ation layer instead
fc876ff
to
22cbb09
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.
lgtm! only thing I think we should definitely change is the GCP secret stuff
…to dan/cosmos-fallbackprovider
### Description Implements grpc fallback provider logic for cosmos - initially tried implementing the fallback provider deprioritization logic at middleware level like in the EVM. The difference between ethers and cosmrs is that in the latter, middleware can only live at the transport layer (`tower` crate level). - based on this github [issue](hyperium/tonic#733), that actually doesn't look possible, because the http::Request type isn't `Clone` so it can't be submitted to multiple providers - ended up implementing the fallback provider at the application layer, by keeping an array of grpc channels - There is now a `call` method in `hyperlane_core::FallbackProvider` which I'm actually really happy with. This method handles the fallbackprovider-specific logic by taking in an async closure, running it on each provider, and iterating providers if the closure call fails. In `grpc.rs` you can see how this is slightly verbose but I think it's quite manageable. The only part that bugs me is having to duplicate `Pin::from(Box::from(future))`, but that's need afaict because the regular closure returns an anonymous type - adds `grpcUrls` and `customGrpcUrls` config items - tests the cosmos fallback provider e2e ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> ### Related issues - Fixes: hyperlane-xyz/issues#998 ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests -->
Description
Implements grpc fallback provider logic for cosmos
tower
crate level).Clone
so it can't be submitted to multiple providerscall
method inhyperlane_core::FallbackProvider
which I'm actually really happy with. This method handles the fallbackprovider-specific logic by taking in an async closure, running it on each provider, and iterating providers if the closure call fails. Ingrpc.rs
you can see how this is slightly verbose but I think it's quite manageable. The only part that bugs me is having to duplicatePin::from(Box::from(future))
, but that's need afaict because the regular closure returns an anonymous typegrpcUrls
andcustomGrpcUrls
config itemsDrive-by changes
Related issues
Backward compatibility
Testing