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

metrics: HTTP status codes and inconsistent responses #126

Closed rvanasa closed 9 months ago

rvanasa commented 9 months ago

Adds the following metrics:

Another notable change (not represented in the diff of this PR) is that I adjusted the implementation of MultiCallResult::all_ok() in the forked ckETH codebase to return all results in the case of an error. Otherwise, an RPC service could bypass the agreement / consistency logic by returning an error for an otherwise successful RPC request.

THLO commented 9 months ago

an RPC service could bypass consensus

What do you mean by that? Every response to an HTTPS outcall goes through consensus, so there is no way to "bypass consensus".

rvanasa commented 9 months ago

What do you mean by that?

Oh right, sorry for the ambiguity; I was using "consensus" to refer to the agreement logic between RPC providers.

In ckETH, if two responses are successful while one returns an error, this is considered a "consistent error" (rather than three "inconsistent results"). We need to change this for EVM RPC because a compromised third-party RPC service could bypass the agreement logic by responding with an error for an otherwise successful request.