Shares and Uncles have been swapped in JSON API #5

Closed
opened 2023-07-30 16:56:11 +00:00 by snex · 1 comment

Seems like the "uncle_of" field has disappeared, which is causing the confusion.

Seems like the "uncle_of" field has disappeared, which is causing the confusion.
Owner

(The above issue was handled via IRC, posting here for posterity)

This was introduced on 42d570a167 (and became effective after 010a2a0d03). Like other fields marked omitempty these are not included in the result if the type is Zero. You can see the list https://git.gammaspectra.live/P2Pool/p2pool-observer/src/branch/master/cmd/index/side_block.go#L30-L80 and for example, other fields like uncles or mined_main_at_height followed this behavior.

if uncle_of is not present in the SideBlock output this is not an Uncle share. This is equivalent as assuming a non-existent field is its native Zero value.

Additionally recently I have been trying to deprecate a few sections of the API to be able to mark that as 1.0 and not do changes in a backwards incompatible way, and also add a protobuf option for even better compatibility.

(The above issue was handled via IRC, posting here for posterity) This was introduced on 42d570a16737e8d6f35a3961e93de422724b7084 (and became effective after 010a2a0d031b3edd098e9e5bc02ea12f3562ce56). Like other fields marked `omitempty` these are not included in the result if the _type_ is Zero. You can see the list https://git.gammaspectra.live/P2Pool/p2pool-observer/src/branch/master/cmd/index/side_block.go#L30-L80 and for example, other fields like `uncles` or `mined_main_at_height` followed this behavior. if `uncle_of` is not present in the _SideBlock_ output this is not an Uncle share. This is equivalent as assuming a non-existent field is its native Zero value. Additionally recently I have been trying to deprecate a few sections of the API to be able to mark that as `1.0` and not do changes in a backwards incompatible way, and also add a protobuf option for even better compatibility.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: P2Pool/consensus#5
No description provided.