-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
Milestone
Description
Prerequisites
Background
- In the prerequisite issue 1522 updated API data models are suggested.
- A potential scalability issue is identified on issue 1522 for how a new middleware for loading referral leaderboards into memory should work. Based on the spec in 1522, there can be any number of referral program cycles to continuously keep refreshing leaderboards for.
- A utility function for
calcReferralProgramStatus(and associated status enum) has been introduced intopackages/ens-referrals/src/status.ts.
Goals / Suggested action items
- Update the data model for the "v1" implementation of referrer leaderboard pagination APIs so that it includes the "Referral Program Status" for the requested leaderboard based on the
rulesof the requested leaderboard and theaccurateAsOftimestamp that will be returned in the response (which should be the value fornowpassed intocalcReferralProgramStatusto generate the correct status value).- Note: These status values will be important for UI-related enhancements that are planned on ENSAwards. Depending on the status, the ENSAwards UI will implement dynamic UIs.
- Update the middleware that loads referral leaderboards into memory for each "Referral Program Cycle".
- Introduce a constant
Durationvalue named something such asASSUMED_CHAIN_REORG_SAFE_DURATIONand set it to something like 10 minutes in seconds. This value will help us in the case that there is a chain reorg with unfortunate timing. - Introduce a utility function named something such as
assumeCachedLeaderboardImmutable. This function should return a boolean identifying if we should assume a cached leaderboard is immutable and therefore there's no need to keep rebuilding it over and over again. This function should return true if and only if the "Referral Program Status" for the related referral program cycle had a status ofClosedas ofASSUMED_CHAIN_REORG_SAFE_DURATIONago. - The logic in this middleware should be updated to make use of
assumeCachedLeaderboardImmutableto decide if it should make a refresh of a leaderboard that has already been cached.
- Introduce a constant
- Update the data model for the "v1" implementation of the new "Referrer Detail" API described in issue 1522.
- For each referral program cycle returned in the response, include a field representing the "Referral Program Status" for that cycle based on the
rulesof the associated leaderboard and theaccurateAsOftimestamp that will be returned in the response (which should be the value fornowpassed intocalcReferralProgramStatusto generate the correct status value). - Note: These status values will be important for UI-related enhancements that are planned on ENSAwards. Depending on the status, the ENSAwards UI will implement dynamic UIs.
- For each referral program cycle returned in the response, include a field representing the "Referral Program Status" for that cycle based on the
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo