near / near-indexer-events

7 stars 1 forks source link

wrap.near reports inconsistent events #10

Closed telezhnaya closed 2 years ago

telezhnaya commented 2 years ago
ERROR indexer_events: CoinEvent { event_index: BigDecimal("16340447181380000000000000000080000"), receipt_id: "EahNmkevAXEjXeQfP6sxxi6c53KE1pZpwzNWoXnDWDeS", block_timestamp: BigDecimal("1634044718138359472"), contract_account_id: "wrap.near", affected_account_id: "akinola_62.near", involved_account_id: None, delta_amount: BigDecimal("1000000000000000000000000"), absolute_amount: BigDecimal("1000000000000000000000000"), cause: "MINT", status: "SUCCESS", event_memo: None }
Error: Balance is wrong for account akinola_62.near, contract wrap.near: expected 998750000000000000000000, actual 1000000000000000000000000. Block 50003689 8aQ85a8A6ZBPq9ynPR5h8QTH4uBYJ6t5CcRegPJJyz4J
telezhnaya commented 2 years ago

https://explorer.near.org/transactions/AAcncdoxDGaoM8TMMRSVuMLfrRvvmAMtU3mDbtB9L6JJ#EahNmkevAXEjXeQfP6sxxi6c53KE1pZpwzNWoXnDWDeS

telezhnaya commented 2 years ago

sql for re-setting the values after the fix

update contracts set inconsistency_found_at_block_height = null, inconsistency_found_at_timestamp = null
where contract_account_id = 'wrap.near';
telezhnaya commented 2 years ago

We used deposit: we can't do that, we need to parse logs We can't also just parse logs, sometimes they are empty for one functions and there are multiple logs in the other https://explorer.near.org/transactions/2uESrYfb4WKpNhFHwMQz1Rq2j71qL8yVD8SF7d7gLsAG#HGaEm8e8SWxFTUGftLqCwGbrpEXtBUpN7XC8PFxL2EQa

telezhnaya commented 2 years ago

Fixed by https://github.com/near/near-indexer-events/commit/5973f4cc89ebfa30da7de2923befa9f7f6d1ccc6