passportxyz / passport

Passport allows users to prove their identity through a secure, decentralized UI
Other
943 stars 451 forks source link

Create Moralis / onchain Passport 'fall back option' #1755

Closed Jkd-eth closed 11 months ago

Jkd-eth commented 11 months ago

Depends on: https://github.com/gitcoinco/passport/issues/1764. (see also my comment below: https://github.com/gitcoinco/passport/issues/1755#issuecomment-1755047046 )

User Story:

As a Passport user I want to be able to push Passport onchain So that I can unlock the benefits of having an onchain Passport

Acceptance Criteria

GIVEN the Morali API is unavailable WHEN a user goes to push their Passport onchain THEN we should use the previously updated value from Moralis

GIVEN a user is trying to bring his passport on-chain WHEN the Morali API is unavailable THEN we should trigger a pager duty notifiation

If the API is down we should use the last received Eth value (cached) rather than stop the users from being able to mint their passport(s).

Fire off an alert if the API is down (maybe just 1 every 5min interval) so that we can contact Moralis and look at bringing the price Oracle back online

Product & Design Links:

#### Tech Details: - Store the value persistently in Redis. - Let @lucianHymer know if you have any questions around the PagerDuty alarm. #### Open Questions: #### Notes/Assumptions:
nutrina commented 11 months ago

For whoever picks this ticket up:

nutrina commented 11 months ago

Best way would be to store the ETH value in the DB (so it is persisted). Before we do this however, we should make sure we have the IAM in the same region and VPC as the scorer (for direct access).

nutrina commented 11 months ago

It seems that should be able to use Redis with durability (persistence of data between restarts): https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/RedisAOF.html

For this use-case this should be just as good as writing to the DB, but without the overhead of creating a table for it, maybe also an API, etc ...

So I suggest to wait for the IAM to be migrated to the same VPC as the redis cluster (this ticket: https://github.com/gitcoinco/passport/issues/1764 ), and once we have that, we integrate redis in the IAM, which will also make it possible to enable autoscaling.

aminah-io commented 11 months ago

This ticket is closed with the merging of: https://github.com/gitcoinco/passport/issues/1755 -- therefore blocked until its completion