casper-network / condor-info

Casper 2.0 technical outreach
Apache License 2.0
3 stars 2 forks source link

[Condor-Release]: EraEndV2.rewards type definition in the schema does not match actual response #95

Closed davidatwhiletrue closed 1 month ago

davidatwhiletrue commented 1 month ago

Category

Integration Issue

Your email address

-

Project Name(Optional)

MAKE

Casper Network

Devnet

Priority

Low

Node Functionality

JSON RPC

Description

The RPC schema defines EraEndV2.rewards property as

            "rewards": {
              "description": "The rewards distributed to the validators.",
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/U512"
                }
              }
            },

However, the actual response from the node is a BTreeMap<PublicKey, Vec<U512>>:

image

Date Issue Began(optional)

25/07/2024

Attachments (optional)

No response

cspramit commented 1 month ago

@melpadden if you reproduce this please update here - we will take a look

jacek-casper commented 1 month ago

@davidatwhiletrue I think this response does align with the schema, this type:

"rewards": {
  "description": "The rewards distributed to the validators.",
  "type": "object",
  "additionalProperties": {
    "type": "array",
    "items": {
      "$ref": "#/components/schemas/U512"
    }
  }
},

corresponds to an object of arrays of U512, I double checked it in a swagger editor and it seems to align with that:

Screenshot 2024-08-05 at 18 52 37
davidatwhiletrue commented 1 month ago

hey @jacek-casper . You're right. I didn't realize the array of U512 is inside the additionalProperties and not describing the content of the rewards object. This issue can be closed. Thanks.