Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Live scores shows scores for dead games because transfer API never updates "pending" status #11454

Closed
JonRay15 opened this issue Jul 15, 2024 · 0 comments · Fixed by #11456
Assignees
Labels
bug fe-request A list of reasonably high value API change requests from front end

Comments

@JonRay15
Copy link

Problem encountered

On the live score API we are generating live scores for historic games.

Observed behaviour

If I run the below on FG I get entries for gameId = f85133f1a8a25bded370e8b21b1d2d201a7998fef89b3666a4c6eb1b39e0b1a7 even though this ended back in epoch 14771.

query liveGameScoresByGame {
  gameTeamScores{
    edges{
      node{
        gameId
        teamId
        epochId
        time
        score
      }
    }
  }
}

The likely root cause of this is the fact that recurring transfers never update their status once the endEpoch arrives. They stay in "Pending" status forever. See below:

{
          "node": {
            "transfer": {
              "id": "c722bde54814c03b23558fc2c10a36b72ce96ecb213c516fa415a0140bf2038d",
              "gameId": "f85133f1a8a25bded370e8b21b1d2d201a7998fef89b3666a4c6eb1b39e0b1a7",
              "from": "69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f",
              "fromAccountType": "ACCOUNT_TYPE_GENERAL",
              "to": "network",
              "toAccountType": "ACCOUNT_TYPE_REWARD_REALISED_RETURN",
              "asset": {
                "id": "be2efb3d90b29cdc8fce509c8f43e08242f54f8bc8bf9a1a086fde3657e52612",
                "symbol": "EUSD"
              },
              "amount": "1500000000",
              "reference": "realised return individualScope",
              "status": "STATUS_PENDING",
              "timestamp": "2024-05-23T17:35:46.954262Z",
              "kind": {
                "startEpoch": 14616,
                "endEpoch": 14771,
                "dispatchStrategy": {
                  "dispatchMetric": "DISPATCH_METRIC_REALISED_RETURN",
                  "dispatchMetricAssetId": "be2efb3d90b29cdc8fce509c8f43e08242f54f8bc8bf9a1a086fde3657e52612",
                  "marketIdsInScope": [
                    "c02cb3ede6d68479368495826562f2f67c47e339b6fbc152c69d5397a6bcb1d7"
                  ],
                  "entityScope": "ENTITY_SCOPE_TEAMS",
                  "individualScope": "INDIVIDUAL_SCOPE_UNSPECIFIED",
                  "teamScope": null,
                  "nTopPerformers": "0.3",
                  "stakingRequirement": "",
                  "capRewardFeeMultiple": null,
                  "notionalTimeWeightedAveragePositionRequirement": "",
                  "windowLength": 24,
                  "transferInterval": 24,
                  "lockPeriod": 0,
                  "distributionStrategy": "DISTRIBUTION_STRATEGY_RANK",
                  "rankTable": [
                    {
                      "startRank": 1,
                      "shareRatio": 50
                    },
                    {
                      "startRank": 2,
                      "shareRatio": 45
                    },
                    {
                      "startRank": 3,
                      "shareRatio": 40
                    },
                    {
                      "startRank": 4,
                      "shareRatio": 35
                    },
                    {
                      "startRank": 5,
                      "shareRatio": 33
                    },
                    {
                      "startRank": 6,
                      "shareRatio": 30
                    },
                    {
                      "startRank": 7,
                      "shareRatio": 29
                    },
                    {
                      "startRank": 8,
                      "shareRatio": 28
                    },
                    {
                      "startRank": 9,
                      "shareRatio": 27
                    },
                    {
                      "startRank": 10,
                      "shareRatio": 26
                    },
                    {
                      "startRank": 11,
                      "shareRatio": 25
                    },
                    {
                      "startRank": 12,
                      "shareRatio": 24
                    },
                    {
                      "startRank": 13,
                      "shareRatio": 23
                    },
                    {
                      "startRank": 14,
                      "shareRatio": 70
                    },
                    {
                      "startRank": 15,
                      "shareRatio": 88
                    },
                    {
                      "startRank": 16,
                      "shareRatio": 50
                    },
                    {
                      "startRank": 17,
                      "shareRatio": 19
                    },
                    {
                      "startRank": 18,
                      "shareRatio": 66
                    },
                    {
                      "startRank": 19,
                      "shareRatio": 17
                    },
                    {
                      "startRank": 20,
                      "shareRatio": 80
                    },
                    {
                      "startRank": 21,
                      "shareRatio": 15
                    },
                    {
                      "startRank": 22,
                      "shareRatio": 14
                    },
                    {
                      "startRank": 23,
                      "shareRatio": 50
                    },
                    {
                      "startRank": 24,
                      "shareRatio": 12
                    },
                    {
                      "startRank": 25,
                      "shareRatio": 11
                    },
                    {
                      "startRank": 26,
                      "shareRatio": 0
                    }
                  ]
                }
              },
              "reason": null
            }
          }
        },

Expected behaviour

When a recurring transfer reaches its end Epoch the status of the transfer should update to "finished" or whatever the appropriate status is ... STATUS_STOPPED or STATUS_DONE seem the most appropriate but I dont know where else these are used.... that is implementation detail for Core.

If this is done the live scores API will behave as expected.

Steps to reproduce

1. Submit `xyz` transaction
2. With this payload
3. Query `abc` API
4. Observe the error

Software version

0.77 preview 10

Failing test

No response

Jenkins run

No response

Configuration used

No response

Relevant log output

No response

@JonRay15 JonRay15 added bug fe-request A list of reasonably high value API change requests from front end labels Jul 15, 2024
@JonRay15 JonRay15 added this to the 🏛️🏛️Colosseo II milestone Jul 15, 2024
@ze97286 ze97286 self-assigned this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fe-request A list of reasonably high value API change requests from front end
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants