-
Notifications
You must be signed in to change notification settings - Fork 351
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
event data is wrong #4256
Comments
Thanks for the bug report @showlocked - could you please share what products/apps are affected by this? This helps us prioritise the work a lot |
this wallet balance is wrong, and another wallet may be |
i dont know how mintscan works in terms of showing transactions (ill ping them here as well), but to me it looks all fine except that output, the balances in the end are correct. see: and obviously the difference in the balance is that when you undelegate, the rewards get claimed as well but i assume thats not in question here |
Yes, the balance is correct, but the event data is wrong. This is a serious error for developers who need to parse the event as a transfer transaction. |
hmm i see, i checked on our internal rpc and yeah the attributes seem that are correct, but not in correct order (never checked this on other cosmos networks if this part is always ordered or not)
|
Yes, if there is an exchange that supports deposits and withdrawals for this kind of transaction, it will lead to asset losses. Please fix it as soon as possible. |
I've re-read this issue a few times but I still don't understand the issue.
Can you clarify this?
You meant 324489887 utia not 324. The full address is https://www.mintscan.io/celestia/address/celestia1tygms3xhhs3yv487phx3dw4a95jn7t7ls3yw4w which is the not bonded tokens pool. It is expected behavior for tokens to go there as a result of the undelegate transaction.
This amount is associated withdrawing rewards.
After a user undelegates, they must wait the unbonding period. After the unbonding period, the tokens will move from the not bonded token pool to the user's account. Ref: https://docs.cosmos.network/v0.45/modules/staking/02_state_transitions.html#complete-unbonding
Based on the OP, I don't think there's a bug in the event attributes. Exchanges shouldn't treat events as the source of truth and instead should query the state of the blockchain. If you still think there is a bug, can you clarify where? It would also help if you included minimal steps to repro. |
What I mean is that the positions of 87utia and 324489887utia are reversed, which causes the transfer amount to be reversed when we parse it. |
We can compare it with a normal transfer event, and you will find that the amount of the internal transfer event of this pledge transaction is wrong. |
isn't the tx in the op from an undelegation? when undelegating, the funds don't go back to the user, they go to some module address, which is what is happening in the events the state machine is "transfering" funds to a module address |
Shouldn't the transfer event in Cosmos be a standard? The transfer event of the address celestia1s0k4hxn3cuaz72e6qtmzk6xh30t6f7zx97qc84 does not correspond to the balance change. |
funds aren't being transfered to that address, cause its an undelegation, which has an unbonding period. undelegation involves the movement of funds in the state machine, but its not how you describe. The entry point is here https://github.com/celestiaorg/cosmos-sdk/blob/d1d32585feeac12f875f569c6d5086f1163c010c/x/staking/keeper/msg_server.go#L336 . It will take some digging to understand it, but ask an llm to walk you through it. also, we don't touch the staking or bank modules, so if this is a bug, its a bug in every v0.46.x cosmos-sdk chain and the best place to ask is there. |
🙂 thanks for opening an issue @showlocked, but this isn't a bug afaict. |
Summary of Bug
I found a problem, I don't know if it is a bug, in one of our users' unstaking transactions, the balance recipient of the internal event does not correspond to the amount.
https://www.mintscan.io/celestia/tx/4E26D3E23C35125A9C9A9C848C701BF4DF871E9F8CB60D18C2679A921505905B?sector=json
This transaction should be receiving 324489887utia
But the actual amount receiver of the internal event is wrong.
We can think of the transfer event as a transfer transaction, so according to the screenshot I took, the transfer should be:
A transaction of 87 was sent to xxxqc84
A transaction of 324 was sent to xxyw4
This is a problem. The user did not add the balance back correctly after the delegate deducted 324.
This block data is like this:
[ { "key": "recipient", "value": "celestia1s0k4hxn3cuaz72e6qtmzk6xh30t6f7zx97qc84" }, { "key": "sender", "value": "celestia1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8k44vnj" }, { "key": "amount", "value": "87utia" }, { "key": "recipient", "value": "celestia1tygms3xhhs3yv487phx3dw4a95jn7t7ls3yw4w" }, { "key": "sender", "value": "celestia1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3y3clr6" }, { "key": "amount", "value": "324489887utia" } ]
in fact, it should be like this:
[ { "key": "recipient", "value": "celestia1s0k4hxn3cuaz72e6qtmzk6xh30t6f7zx97qc84" }, { "key": "sender", "value": "celestia1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8k44vnj" }, { "key": "amount", "value": "324489887utia" }, { "key": "recipient", "value": "celestia1tygms3xhhs3yv487phx3dw4a95jn7t7ls3yw4w" }, { "key": "sender", "value": "celestia1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3y3clr6" }, { "key": "amount", "value": "87utia" } ]
If the exchange supports this type of deposit and withdrawal event, it may cause asset losses
Version
current
Steps to Reproduce
i dont know
The text was updated successfully, but these errors were encountered: