Open yj0x0x opened 2 years ago
Why I think that this activity related with pool's activity;
When you wee the endblocker transaction operation through the Rosetta API,
Below coin_spent
operation's received address is cosmos13s0lj78gujy89vn9780gq6qn4v937ywjasyw2q
.
Which is pool address when you could see below.
link : https://www.mintscan.io/cosmos/account/cosmos13s0lj78gujy89vn9780gq6qn4v937ywjasyw2q
coin_spent
operation.
{
"operation_identifier": {
"index": 2
},
"type": "coin_spent",
"status": "Success",
"account": {
"address": "cosmos1tx68a8k9yz54z06qfve9l2zxvgsz4ka3hr8962"
},
"amount": {
"value": "-24770",
"currency": {
"symbol": "uatom",
"decimals": 0
}
}
},
coin_receive
operation
{
"operation_identifier": {
"index": 7
},
"type": "coin_received",
"status": "Success",
"account": {
"address": "cosmos13s0lj78gujy89vn9780gq6qn4v937ywjasyw2q"
},
"amount": {
"value": "24770",
"currency": {
"symbol": "uatom",
"decimals": 0
}
}
},
I have also checked liquidity module's endblocker
function.
// ExecutePoolBatches executes the accumulated msgs in the batch.
// The order is (1)swap, (2)deposit, (3)withdraw.
func (k Keeper) ExecutePoolBatches(ctx sdk.Context) {
params := k.GetParams(ctx)
logger := k.Logger(ctx)
k.IterateAllPoolBatches(ctx, func(poolBatch types.PoolBatch) bool {
if !poolBatch.Executed && ctx.BlockHeight()%int64(params.UnitBatchHeight) == 0 {
executedMsgCount, err := k.SwapExecution(ctx, poolBatch)
if err != nil {
panic(err)
}
k.IterateAllPoolBatchDepositMsgStates(ctx, poolBatch, func(batchMsg types.DepositMsgState) bool {
if batchMsg.Executed || batchMsg.ToBeDeleted || batchMsg.Succeeded {
return false
}
executedMsgCount++
if err := k.ExecuteDeposit(ctx, batchMsg, poolBatch); err != nil {
logger.Error("deposit failed",
"poolID", poolBatch.PoolId,
"batchIndex", poolBatch.Index,
"msgIndex", batchMsg.MsgIndex,
"depositor", batchMsg.Msg.GetDepositor(),
"error", err)
if err := k.RefundDeposit(ctx, batchMsg, poolBatch); err != nil {
panic(err)
}
}
return false
})
k.IterateAllPoolBatchWithdrawMsgStates(ctx, poolBatch, func(batchMsg types.WithdrawMsgState) bool {
if batchMsg.Executed || batchMsg.ToBeDeleted || batchMsg.Succeeded {
return false
}
executedMsgCount++
if err := k.ExecuteWithdrawal(ctx, batchMsg, poolBatch); err != nil {
logger.Error("withdraw failed",
"poolID", poolBatch.PoolId,
"batchIndex", poolBatch.Index,
"msgIndex", batchMsg.MsgIndex,
"withdrawer", batchMsg.Msg.GetWithdrawer(),
"error", err)
if err := k.RefundWithdrawal(ctx, batchMsg, poolBatch); err != nil {
panic(err)
}
}
return false
})
// Mark the batch as executed when any msgs were executed.
if executedMsgCount > 0 {
poolBatch.Executed = true
k.SetPoolBatch(ctx, poolBatch)
}
}
return false
})
}
These function I think check about account's validation.
But reported endblocker tx ,002D9BEECFD46E4B35339D47166B7D0CE6F357DFA54AF3EBD1854ACC33A4D4CFB0
, has activities without account's balance validation.
Could you please check this balance incorrection?
Hi @yj0x0x , I can't find tx 002D9BEECFD46E4B35339D47166B7D0CE6F357DFA54AF3EBD1854ACC33A4D4CFB0, could you please let me know the exact tx hash? and there is no liquidity tx on the block 8695158
Summary of Bug
Account
cosmos1tx68a8k9yz54z06qfve9l2zxvgsz4ka3hr8962
activities in the block height8695158
has balance incorrect. Transaction hash is the002D9BEECFD46E4B35339D47166B7D0CE6F357DFA54AF3EBD1854ACC33A4D4CFB0
which isendblocker
transaction. This activity possibly get throughRosetta API
return. Returns are like belowoperation below is weird that because address cosmos1tx68a8k9yz54z06qfve9l2zxvgsz4ka3hr8962 didn't have any balance for assets on chain.
I have traced this address asset through bulletin rest api like below.
There were no balance about this address but there were activity . I also compare through api.cosmos.network/cosmos/bank/v1beta1/balances/. Result also same.
Is there some issue about block data or something?
Version
Gaia v6.0.4 Liquidity module version is v1.4.6
Steps to Reproduce
You can query cosmos node with Rosetta API turn on and like below.
For Admin Use