Skip to content

Holding rewards query optimisations #2286

Ben requested to merge feat/bigquery-holding-rews-2286 into master

Ticket(s) / Related Merge Requests

Summary of Changes

Implement BigQuery holding rewards calculations.

Testing Considerations

To be tested via CLI.

# Calculate
php cli.php rewards calculate

# Time and count results for ALL holders regardless of if they are registered on site
php cli.php BigQuery getHolders

# Time and count results for all holders who ARE registered on-site.
php cli.php BigQuery getHolders --onlyRegistered=true

# Verbose flag can be used on either of the `BigQuery getHolders` commands to output the rows
php cli.php BigQuery getHolders --onlyRegistered=true --verbose=true

Note, when deploying it needs the helm map with key and project_id populated for BigQuery, and we also need to be using production config for blockchain, so that we use mainnet, WITH ALCHEMY.

Deployment Considerations

Needs to be deployed to runners, should be monitored closely for timing in prod, and to ensure the addresses we're calculating for are coming back correct. Note this is behind feature flag engine-2966-holding-rewards, which is currently ON.

Would be good to dry run the calculations and check how many users were paid out to ensure none have been missed. We can check how many rows are iterated over using the commands above - the rewards manager should use the same amount of rows as returned from the below command - as this does the mapping and checks to whether the address is registered on-site. See other commands above in testing steps for additional commands to help check things are working correctly.

php cli.php BigQuery getHolders --onlyRegistered=true --verbose=true

Needs also:

Regression Scope

Affects reward calculations.

Platform Affected (web, mobile, etc)

Engine-side change.

Developer Testing Completed

Manual and specs.

Screenshots / Screen Recording

Calculate

image

All holders

image

Only registered holders

image

Only registered holders verbose

image

Does this impact

  • Localization
  • Dark/light mode
  • Guest mode

Definition of Done Checklist

  • The Acceptance Criteria has been met
  • Code is tested: Testing includes unit/spec, E2E/automated and manual testing
  • Merge requests description has been filled out
Edited by Ben

Merge request reports