rocklabs-io / omnic

Omnic protocol repo
25 stars 7 forks source link

Add merkle root aggregation step #14

Closed ccyanxyz closed 2 years ago

ccyanxyz commented 2 years ago

Fetch merkle roots from multiple rpc providers and aggregate the result.

Assume n RPC providers, aggregation rule:

  1. if n <= 2, requests to both providers have to success and the results has to be exact match, otherwise abort and start a new query round
  2. if n > 2, at least n/2 requests to all providers success, and the exact matched results number should > n/2

@Myse1f

ccyanxyz commented 2 years ago

And canister upgrade related methods. Now we store Vec u8 instead of H256 so should be easier. @Myse1f

Myse1f commented 2 years ago

if n > 2, at least n/2 requests to all providers success, and the exact matched results number should > n/2

i think there's an edge case, which is the correct and wrong result are even splited.

let's say we queried from 10 rpc provides. 5 return the A result and the other 5 return B result. In this case, we don't know which result is correct.

Myse1f commented 2 years ago

Oh, Nvm. Iin this case, we just fail this round. Cuz the we need >n/2.