bitcat365 / oasisscan-backend

oasisscan.com backend
3 stars 4 forks source link

move account fixing to event service #3

Closed pro-wh closed 20 hours ago

pro-wh commented 2 years ago

Oasis scan already has a mechanism to fix up accounts when it sees a transaction. This PR moves that logic from the transaction scanning service to the event scanning service. Oasis events cover a broader range of account updates, including fees paid to validators and certain paratime interactions.

In future work, we can expand this to take note of what events affect which delegations and debonding delegations, and we'll be able to eliminate the validator service's use of stakingGenesis

Overview of the approach in this PR:

  1. As we scan a block's events, generate a set of addresses that will need to be updated
  2. Load the accounts for those addresses from the API and save an updated copy of them

Step 2 is currently done in a loop, but it might be nice to parallelize it.

pro-wh commented 2 years ago

I haven't tested these changes yet. I'll need to set up some databases and things

pro-wh commented 2 years ago

added more changes to process delegation and debonding delegation events too

pro-wh commented 2 years ago

added more changes:

romever commented 20 hours ago

I'm so sorry it took so long to reply you.Currently, the oasisscan project has been redeveloped using golang.The account page currently uses the information directly from the oasis node to make sure the accuracy of the information.

pro-wh commented 18 hours ago

ah yeah no worries, as long as the idea is conveyed. thanks for getting back to this