internet-computer-protocol / evm-rpc-canister

Interact with EVM blockchains from the Internet Computer.
https://internetcomputer.org/docs/current/developer-docs/multi-chain/ethereum/evm-rpc/overview
Apache License 2.0
63 stars 13 forks source link

feat: Choose a consensus strategy #286

Closed gregorydemay closed 3 weeks ago

gregorydemay commented 4 weeks ago

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).