-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: implement threshold strategy #287
Merged
Merged
Conversation
This file contains 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
gregorydemay
commented
Sep 23, 2024
Shouldn't it be "at least the specified threshold number of times"? |
THLO
reviewed
Sep 23, 2024
THLO
reviewed
Sep 23, 2024
rvanasa
approved these changes
Sep 23, 2024
THLO
approved these changes
Sep 23, 2024
gregorydemay
added a commit
that referenced
this pull request
Sep 24, 2024
Introduce a new parameter in `RpcConfig` to let the caller choose between different consensus strategies to aggregate answers from multiple providers. Two strategies are defined, with the possibility of adding more in the future: 1. `Equality`: this is the default and matches the current behaviour, where all responses are expected to be non-error cases and all responses are expected to be equal. 2. `Threshold`: new strategy introduced by this PR, allowing to relax the aforementioned equality strategy to only a subset of the responses. Choosing this strategy may influence the chosen providers to match the specified threshold parameters. The implementation of responses aggregation in this case is done in a separate PR (#287). --------- Co-authored-by: Thomas Locher <[email protected]>
# Conflicts: # Cargo.toml # evm_rpc_types/src/rpc_client/mod.rs # src/rpc_client/mod.rs
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.
Follow-up on #286 to implement the threshold strategy to aggregate responses from multiple providers:
MultiCallResults::reduce
method which takes as parameter aConsensusStrategy
to aggregate the various responses. All existing methods, includingeth_fee_history
, were refactor to use the newreduce
method.ConsensusStrategy::Threshold
, the reduction strategy simply consists of returning the most frequent (non-error) response if it appeared at least the specified threshold number of times.MultiCallResults
to stored ok results and errors separately.