dfinity / cycles-ledger Goto Github PK
View Code? Open in Web Editor NEWThe cycles ledger is a global ledger canister that enables principal IDs to hold cycles.
License: Apache License 2.0
The cycles ledger is a global ledger canister that enables principal IDs to hold cycles.
License: Apache License 2.0
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).
It would be similar to wallet_call
that is offered by cycle wallet at the moment.
type WalletResultCall = variant {
Ok : record { return: blob };
Err : text;
};
//Call Forwarding
wallet_call: (record {
canister: principal;
method_name: text;
args: blob;
cycles: nat64;
}) -> (WalletResultCall);
wallet_call128: (record {
canister: principal;
method_name: text;
args: blob;
cycles: nat;
}) -> (WalletResultCall);
This would enable users to make calls that require cycles. For example, an ICRC token canister may want its fees paid in cycles.
I know that there is a security concern of outstanding call contexts that could prevent ledger from being upgraded. But I still think this is worth discussing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.