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

[BUG] When there are more than 2 identical actions in the same Transaction, there will only be one data #148

Open
devmoondev opened this issue May 14, 2024 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@devmoondev
Copy link

Case

Send rewards to users. The two rewards are generated from different activities, so they need to be sent separately. However, the amount of the rewards is the same, resulting in two identical actions in the same transaction.

Sample code

await api.transact({
    actions: [{
        account: "eosio.token",
        name: 'transfer',
        authorization: [{
            actor: 'accountaaaaaa',
            permission: 'active',
        }],
        data: {
            from: 'accountaaaaaa',
            to: 'accountbbbbbb',
            quantity: '0.0001 SYS',
            memo: 'transfer'
        },
    },
    {
        account: "eosio.token",
        name: 'transfer',
        authorization: [{
            actor: 'accountaaaaaa',
            permission: 'active',
        }],
        data: {
            from: 'accountaaaaaa',
            to: 'accountbbbbbb',
            quantity: '0.0001 SYS',
            memo: 'transfer'
        },
    },
],
})

Querying the data in ES reveals that there is only one action record in this transaction, and the second will be lost.

@igorls
Copy link
Member

igorls commented May 18, 2024

Unfortunately, on the current version the deduplication happens based on the act_digest per action inside a transaction. Removing the deduplication can greatly increase storage needs for all operators due to misuse of receipt notifications and also spamming.

We are working on improved processing and optimizations for future releases.

@devmoondev my recommendation for the smart contract developer is to use a different memo if this data is important to be indexed, this will make the act_digest be different and you should get both actions in

@igorls igorls added bug Something isn't working good first issue Good for newcomers labels May 18, 2024
@igorls igorls added this to the v3.4 milestone May 18, 2024
@igorls igorls self-assigned this May 18, 2024
@devmoondev
Copy link
Author

@devmoondev my recommendation for the smart contract developer is to use a different memo if this data is important to be indexed, this will make the act_digest be different and you should get both actions in

Thank you for your patient reply. This problem can be avoided once discovered, but for those who encounter it for the first time, there will be a lot of misunderstandings, thinking that their coins are lost. I currently separate actions into different transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants