Skip to content
Snippets Groups Projects
Hugo Trentesaux's avatar
Hugo Trentesaux authored
* delete notes.txt file

* update notes with links to issues

* update comment according to #159

* doc idtystatus in readme

* update weightinfo and benchmarks accordingly

* add benchmark

* remove remove_identity_consumers

* remove force_remove_identity call

* fix todo in test

* update doc

- remove request_membership
- remove validate_identity

* fix tests according to new MembershipRemovalReason

* add membership removal reasons

and clean up membership internal functions

* remove check_remove_identity

* build live tests

(but no current network to check them against)

* clippy :man_facepalming:

* add wot tests related to issue #136

* refac certification creation checks

* refac identity creation checks

* test benchmark ok

* more precise error messages

* check benchmarks ok

* cargo cucumber ok

* cargo test workspace ok

* cargo test workspace quasi ok

* cargo check all tests

* cargo check all

* remove IdtyEvent change owner key

* remove removal other reason

* refac revocation and removal reason

* wip

* refac

* refac scheduling (tests ok)

* add *Period

* cargo test identity ok

* remove IdtyEvent::Validated

* cargo test wot ok

* cargo test wot ok

(one fails but fot the good reason)

* cargo test membership ok

* cargo check wot tests

* cargo check identity tests

* cargo check membership tests

* also remove validate trait

* remove validate_identity

* refac identity status to allow more fine-grain control

* remove unused trait

* cargo check ok

* remove indentity confirmation constraints

* remove request from membership primitives

* remove request_membership from lib.rs
6b598084
History
Name Last commit Last update
..
src
Cargo.toml
README.md

Duniter quota pallet

Duniter identity system allows to allocate quota and refund transaction fees when not consumed.

General behavior

Quota system is plugged to transactions fees which is a rather critical aspect of substrate. That's why in duniter-account pallet OnChargeTransaction implementation, the default behavior is preserved, and refunds are added to a queue handeled in on_idle.

Path for a refund

This is what happens on a transaction:

  • frame-executive calls OnChargeTransaction implementations
  • duniter-account OnChargeTransaction implementation is called, and if an identity is linked to the account who pays the fees, request_refund is called
  • request_refund implementation of quota pallet determines whether the fees are eligible for refund based on the identity and then call queue_refund
  • queue_refund adds a refund to the RefundQueue which will be processed in on_idle
  • during on_idle, quota pallet processes the refund queue within the supplied weight limit with process_refund_queue
  • for each refund in the RefundQueue, try_refund is called
  • it first tries to use quotas to refund fees with spend_quota
  • if a certain amount of quotas has been spend, it actually performs the refund with do_refund, taking currency from the RefundAccount to give it back to the account who paid the fee

The conditions for a refund to happen are:

  1. an identity is linked to the account who pays the fees
  2. some quotas are defined for the identity and have a non-null value after update

TODO

  • sanity test checking that only member identities have quota