Giveth / giveth-dapps-v2

This project is the aggregation of GIVeconomy and Giveth.io DApps in a single repo
https://staging.giveth.io
GNU General Public License v3.0
54 stars 32 forks source link

GIVpower is acting strange #4326

Open divine-comedian opened 5 days ago

divine-comedian commented 5 days ago

We've had several user reports of GIVpower acting strange.

Some projects not changing rank at the beginning of a new round, when the estimate has show for several rounds that the project's rank would increase. Several projects have their estimated rank the same as many other projects.

image.png image.png

Some projects or specific boosting have their amount shows as NaN

image.png

@RamRamez Did some investigation and here are his findings:

This is the first time I'm working on Givpower, the logic is complicated and I'm reading the codes trying to understand.

Different tables are involved in calculating givpower rank:

power_snapshot
power_round
power_balance_snapshot
power_boosting_snapshot
project_power_view
last_snapshot_project_power_view
user_project_power_view
project_user_instant_power_view

etc...

The problem in staging is the totalPower field is zero for all projects in project_power_view table.

project_power_view table is a materialized view calculating totalPower by having power_balance_snapshot, power_boosting_snapshot and power_snapshot tables.

The current power round is 44197 but we don't have this roundNumber in power_snapshot table. The newest round in power_snapshot table is 35864 and we don't have any data for rounds after that.

Also other tables like power_balance_snapshot and power_boosting_snapshot have data until 35864 round, and there's no data for rounds after that.

We should investigate further, find out what's wrong with GIVpower and execute the required fixes to bring it back to normal.

cc: @laurenluz

aminlatifi commented 4 days ago

The problem was a wrong power boosting record from a user who never have had a positive givpower balance 0xa198b3e3028882122d6365a2290906074aad3431

I removed his boosting record and the state would be fine after the cronjob is executed again.

aminlatifi commented 4 days ago

https://github.com/Giveth/impact-graph/issues/1655

aminlatifi commented 4 days ago

@RamRamez staging issue must be fixed now. The issue was database name was changed from staging -> staging2 and the db cron job was not updated to point to that db.

RamRamez commented 4 days ago

@aminlatifi the totalPower in projectPowerView is still zero for all projects on staging and givPower is not shown on UI.

Maybe we should refresh all views manually?

https://staging.giveth.io/project/a-delicious-help?tab=givpower

aminlatifi commented 4 days ago

@aminlatifi the totalPower in projectPowerView is still zero for all projects on staging and givPower is not shown on UI.

Maybe we should refresh all views manually?

https://staging.giveth.io/project/a-delicious-help?tab=givpower

It's fixed now. It need some time

RamRamez commented 4 days ago

@aminlatifi totalPower is still zero for all projects. Also UI not showing the GIVPower.

mohammadranjbarz commented 3 days ago

@aminlatifi totalPower is still zero for all projects. Also UI not showing the GIVPower.

Screenshot 1403-04-06 at 10 45 20 in the morning

@RamRamez Are you sure? It's ok for my project

aminlatifi commented 3 days ago

Staging balance aggregator has issue in querying subgraph


Fetch id 0xdaea66adc97833781139373df5b3bced3fdda5b1-100 - subgraph url https://api.studio.thegraph.com/query/76292/giveconomy-staging-gnosischain/version/latest - last update time 1719241855 - skip 0 - take 500 |  
-- | --
  |   | [Nest] 1  - 06/26/2024, 8:50:34 AM   DEBUG [FetchAgent] |  
  |   | [Nest] 1  - 06/26/2024, 8:50:34 AM   DEBUG [FetchAgent] Fetching id 0xdaea66adc97833781139373df5b3bced3fdda5b1-100 |  
  |   | [Nest] 1  - 06/26/2024, 8:50:25 AM   ERROR [FetchAgent] AxiosError: Request failed with status code 410 |  
  |   | [Nest] 1  - 06/26/2024, 8:50:25 AM   ERROR [FetchAgent] Error on fetch id 0x632ac305ed88817480d12155a7f1244cc182c298-420 -

@mhmdksh can you look at this?

RamRamez commented 3 days ago

@aminlatifi totalPower is still zero for all projects. Also UI not showing the GIVPower.

Screenshot 1403-04-06 at 10 45 20 in the morning @RamRamez Are you sure? It's ok for my project

@mohammadranjbarz GIVPower not showing is on staging only

aminlatifi commented 3 days ago

@aminlatifi totalPower is still zero for all projects. Also UI not showing the GIVPower.

Screenshot 1403-04-06 at 10 45 20 in the morning @RamRamez Are you sure? It's ok for my project

@mohammadranjbarz GIVPower not showing is on staging only

It's fixed now.

RamRamez commented 3 days ago

@aminlatifi Thanks, it's ok now

maryjaf commented 3 days ago

Some projects not changing rank at the beginning of a new round, when the estimate has show for several rounds that the project's rank would increase. Several projects have their estimated rank the same as many other projects.

The rank of this project changed to 19

https://giveth.io/project/diamante-luz-center-for-regenerative-living-0?tab=givpower

image