Skip to content

Conform 'mostCommonReply` to standard schema #47

@synechist

Description

@synechist

After discussion with the developer building the TypeScript version of XRouter, we have agreed on a standard schema for 'mostCommonReply`:

  1. mostCommonReply is renamed to the consensus object.
  2. Go-XRouter output shall be in JSON as per the following example:
{
    "consensus":{
        "majorityStrength": "57%",
        "mostCommonReplyCount": 4,
        "mostCommonReply": ["reply"],
        "divergentReplyCount": 3,
        "divergentReplies": [
            {"count": 2, "reply": ["reply"]},
            {"count": 1, "reply": ["reply"]}
        ]
    },
    "queryCount":"Failed to find enough peers supporting xrGetBlockCount for xr::BLOCK whose fees fall within the limits set in your config file. You requested responses from 12 nodes, but only got 7. Please try to connect to more peers before retrying the request."
}

Parameters

Parameter Type Description
consensus object XRouter's "consensus" response
majorityStrength string The proportion, as a percentage, of mostCommonReplyCount relative to the sum of mostCommonReplyCount and divergentReplyCount
mostCommonReply array The reply object in snodeReply most commonly returned by service nodes
divergentReplyCount int The number of replies nonidentical with mostCommonReply
divergentReplies array An arrayed list of replies that diverge from mostCommonReply
count int the number of service nodes that responded with the divergentReply in question
reply array the reply object in snodeReply returned by the service node(s) in question
queryCount string Message used to flag when the number of service nodes that XRouter could find to response to a query is low than the number specified in queryCount

Flow diagram (draft)

21-09-30 XRouter consensus flow diagram v 1 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions