Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FA migration] When coinstore is deleted we miss the FA activities #691

Merged
merged 5 commits into from
Jan 23, 2025

Conversation

bowenyang007
Copy link
Collaborator

@bowenyang007 bowenyang007 commented Jan 22, 2025

This is a temporary solution until we have a better event that has both the event address and the coin type so that we can map withdraw / deposit events to the proper coin type.

Caveat, if there are multiple coinstore deletions in the same account, in the same transaction, we will get this wrong.

Backfill

When first v2 only apt was created.
Testnet: 2598047902
Mainnet: 1669115601

Testing

May need to add an integration test for this

Before we were missing apt withdraw
image

Now we have it!
image

@bowenyang007 bowenyang007 requested review from rtso and yuunlimm January 22, 2025 19:43
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 69.44444% with 11 lines in your changes missing coverage. Please review.

Project coverage is 48.8%. Comparing base (d68d37e) to head (6719a88).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ors/parquet_fungible_asset_activities_processor.rs 0.0% 8 Missing ⚠️
...e_asset_models/raw_v2_fungible_asset_activities.rs 57.1% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #691     +/-   ##
=======================================
- Coverage   49.6%   48.8%   -0.8%     
=======================================
  Files        252     252             
  Lines      28660   28667      +7     
=======================================
- Hits       14223   14002    -221     
- Misses     14437   14665    +228     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// When coinstore is deleted we have no way of getting the mapping but hoping that there is
// only 1 coinstore deletion by owner address. This is a mapping between owner address and deleted coin type
// This is not ideal as we're assuming that there is only 1 coinstore deletion by owner address, this should be
// replaced by an event (although we still need to keep this mapping because blockchain)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CoinStoreDeletion will replace CoinEventHandleDeletion and include CoinStore aptos-labs/aptos-core#15730

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I'm not using the events now so will just wait for that event to be on testnet and add the patch.

Base automatically changed from fix_storage_id to main January 22, 2025 21:51
@bowenyang007 bowenyang007 force-pushed the fix_coinstore_deletion branch from 948719b to caebca5 Compare January 22, 2025 23:42
@bowenyang007 bowenyang007 force-pushed the fix_coinstore_deletion branch from caebca5 to 7c0a8fe Compare January 23, 2025 23:23
@bowenyang007 bowenyang007 force-pushed the fix_coinstore_deletion branch from 1cfaa42 to 9b483cf Compare January 23, 2025 23:36
@bowenyang007 bowenyang007 enabled auto-merge (squash) January 23, 2025 23:37
@bowenyang007 bowenyang007 merged commit 0764e6f into main Jan 23, 2025
11 checks passed
@bowenyang007 bowenyang007 deleted the fix_coinstore_deletion branch January 23, 2025 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants