dfinity / dfinity/cycles-ledger

Transfer_from Duplicate request errors when transfering from different accounts

Open
#112 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
11
Forks
6
Avg merge
6d 17h
Merged PRs (30d)
2

Description

In local testing, I'm currently batching multiple transfer_from calls from a canister to the cycles ledger.

In this simple case, I set up 16 cycle ledger developer "user" accounts, and then make calls in parallel to transfer the exact same amount of cycles from each user to an account owned by a canister (the receiver account is the same for all 16 calls).

Even though the "sender" of cycles in each case is different, I'm receiving duplication errors.

When I stringify the resulting errors (in Motoko) I see one successful transfer, and the rest recognized as duplicates.

[{"ok":"720"},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}},{"err":{"Duplicate":{"duplicate_of":"720"}}}]

Following these deduplication instructions and adding unique memo content for each request solves this problem (no deduplication errors), but it feels like if the sender and receiver are different, the payload is structurally different and this deduplication error shouldn't occur (it shouldn't require me adding a unique memo).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start with the linked ICRC-1 transaction-deduplication guidance and reproduce parallel transfer_from calls using distinct senders and a shared receiver, with and without unique memos. Done means establishing whether this duplicate result is expected and documenting or addressing the agreed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, payments
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.