Currently, XRouter Go parses service nodes' responses using mostcommonreply in order to provide a basic form of “consensus” to users.
Example:
While this is useful, mostcommonreply conceals aspects material to the security of an XRouter proof. For example, it does not reveal the following:
- how strong the majority view is
- whether divergent views are all identical (e.g. in the case of a fork)
- whether divergent views are diverse (e.g. malicious or misconfigured snodes)
Intended behaviour:
For each response, return the following:
For divergentReplies, XRouter should do roughly the following
- hash the response
- check whether every hash is identical
- if at least 1 hash is nonidentical, then count the number of unique hashes
- if the count =1 then there are no divergent views. Return
0.
- if the count =2 then there is one view that diverges from the majority. Return
1.
- Append to
divergentReplies the actual number of hashes counted per unique response, and the responses themselves.
The divergentReplies response could be something like this
"divergentReplies":"15",
"mostCommonReplyCount":"12",
"mostCommonReply":[insert actual response here],
"divergentReply1Count":"2",
"divergentReply1":[insert actual response here],
"divergentReply2Count":"1",
"divergentReply2":[insert actual response here]
}```
Currently, XRouter Go parses service nodes' responses using mostcommonreply in order to provide a basic form of “consensus” to users.
Example:
go-xrouter/xrouter/xrouter.go
Line 352 in 0a3fdd4
While this is useful, mostcommonreply conceals aspects material to the security of an XRouter proof. For example, it does not reveal the following:
Intended behaviour:
For each response, return the following:
mostCommonReplyas currently implementedmajorityStrength- the strength of the majority view (percentage)divergentRepliesthe number of nonidentical divergent views (note: this not the number of service nodes that respond with divergent views)For
divergentReplies, XRouter should do roughly the following0.1.divergentRepliesthe actual number of hashes counted per unique response, and the responses themselves.The
divergentRepliesresponse could be something like this