-
Notifications
You must be signed in to change notification settings - Fork 300
Payments pallet #691
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
Payments pallet #691
Conversation
Codecov Report
@@ Coverage Diff @@
## master #691 +/- ##
==========================================
+ Coverage 76.15% 77.52% +1.37%
==========================================
Files 84 88 +4
Lines 8065 9003 +938
==========================================
+ Hits 6142 6980 +838
- Misses 1923 2023 +100
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be some minimal payment amount to prevent spam
@xlc wouldn't the usual system fee calculated from the weight be enough to protect from spam? It's hard to determine what a reasonable minimum payment amount should be since different tokens can differ greatly in value, but I assume we want to at least ensure the receiving account gets the minimum existential deposit to not reaped? Should |
The fee is not enough. It only covers the computation, not storage. The principle is that every storage write must come with some form of spam protection. It can be a fixed amount deposit (like pallet proxy does), or some valuable assets is locked (ED). ED is usually low and can only cover so much storage usage. So the protection will be weak if you expand ED to cover too much storages and this is just an additional expansion. Ultimately it should be the runtime to decide the ED value, how much storages it can cover, and if this particular feature is included or not. You shouldn't avoid making decision for the runtime within pallet, which will make it less reusable. The the simple solution is to expose a hook to check if payment amount so you can defer the decision to the runtime. Then you can simply check against with |
Understood, reserving an extra deposit for the storage cost of the remark which is our main variable is in our todo list, I was thinking of making it part of the "incentive amount" to not add yet another fee and configuration parameter that hurts usability, incentive amount is an extra percentage reserved from the payment returned after release(when payment detail is removed from storage), it can remain being a percentage but we can require it to not fall bellow a minimum that depends on the size of the remark. |
Why do you even need to store the remark onchain? It can be queried easily with an indexer. Also currently this pallet won't support multiple payments between a sender and receiver, which is maybe fine, but less than ideal. |
Fair point about the remark we could change that, I wasn't seeing it like the system remark but a more important part of the payment detail that other pallets could access for whatever reason. In Virto we plan to use it within the The single payment per sender-receiver is actually on purpose, it makes the pallet simpler and it proved better for users actually since its easier to know that you only have one transaction at the time with a given client, at least for p2p interactions that we handle in a chat is simpler and more than acceptable, imagine the treasury paying a team for some development, you usually want them to finish one job before staring another. In the future it might become a bigger limitation but I guess we'll let users be the judges of that :) |
Not sure why the CI fails, |
That will be due to rust version. Please make sure you are using a later version
|
Hi @xlc sorry to bother but it seems like you are the only one who can currently help us with this review. |
.into_iter() | ||
// leave out tasks in the future | ||
.filter(|(_, ScheduledTask { when, task })| when <= &now && matches!(task, Task::Cancel)) | ||
.collect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should limit number of tasks to take
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this commit is lost? also better to use .take(n)
than truncate
Can you upgrade to polkadot-v0.9.19 and address my comments and then it should be good to merge |
…ime-module-library into multiple-fee-recipients
…me-module-library into payments-pallet
Continuing the discussion in #665. We, the Virto Network team recently finished our first Web3 grant milestone for the development of the
payments_pallet
, a flexible and economically secure escrow-like system that allows people pay for off-chain products or services with any givenMultiReservableCurrency
, we believe our pallet can have numerous use cases outside our parachain and being part of the ORML code base makes it more reachable to the community.Main Features
release
(usually when an off-chain event like a bank transfer has taken place)Recurrent payments: Ability to create payments that repeat periodicallyTBD. *Not part of Web3 grant