bcnmy / bundler

4337 Typescript Bundler
MIT License
6 stars 0 forks source link

Inconsistent data in mongo db #649

Open tomarsachin2271 opened 2 months ago

tomarsachin2271 commented 2 months ago

Cluster : biconomy-sdk-prod Database: relayer-node-service Collection: useroperations_137

Inconsistency 1

Query Used in Mongo Shell

db.useroperations_137.count({status: "FAILED", success: "true"})

Results

Screenshot 2024-06-11 at 4 56 41 PM

Expected Outcome

There should not be any records where status is FAILED but success field is marked true.

Inconsistency 2

If a blockchain transaction fails, then there should not be any actualGasCost and actualGasUsed fields in the useroperations_ collection.

Query Used in Mongo Atlas UI

{transactionId: '0x7a7476d2451b17c81de9866efe6aa44a4124ba67ff4062a02718e9b825470074'}

Results

Screenshot 2024-06-11 at 5 11 41 PM

Expected Outcome

If transaction fails, then fields like actualGasCost and actualGasUsed should not be recorded in db, as they refer to the information recieved from UserOperationEvent which was not emitted in this transaction. Check the tx on explorer

tomarsachin2271 commented 2 months ago

The inconsistency#2 will result in wrong bundle profit calculations.

arcticfloyd1984 commented 2 months ago

Current Findings

I remember this bug now, it was saving the data incorrectly. The lastest entry of this is of a transaction from Jan 2024. Since then we have processed a lot of transactions and no transaction has this issue. It is safe to assume that this won't happen again.