Skip to content
Snippets Groups Projects
Commit 70fa134b authored by Cédric Moreau's avatar Cédric Moreau
Browse files

pending TODOs

parent b613e577
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,8 @@ Meaning that a given `document` is signed by some available keyring.
A public key is following the [Substrate's definition of an Account public key](https://wiki.polkadot.network/docs/learn-keys#account-keys), that is an Ed25519, Sr25519 or Ecdsa public key.
> TODO: precise where is the signatory's public key stored in a document?
## Constants
Constant | Goal
......@@ -62,8 +64,8 @@ xpercent | Minimum percent of sentries to reach to match the distance r
msValidity | Maximum age of an active membership (in seconds)
stepMax | Maximum distance between each WoT member and a newcomer
medianTimeBlocks | Number of blocks used for calculating median time.
minTimeChange | The minimum allowed value for time changing
maxTimeChange | The maximum allowed value for time changing
minTimeChange | The minimum allowed value for time changing TODO: OK ou pas ?
maxTimeChange | The maximum allowed value for time changing TODO: OK ou pas ?
blockGenTime | The average time between two blocks
## Documents
......@@ -88,6 +90,8 @@ Where:
The concrete binary version of a document must follow Substrate's definition: see [how to compose a signed extrinsic](https://github.com/scs/substrate-api-client/blob/4589ccbc5643053a845729c77b175215471cff3f/compose-macros/src/lib.rs) for more details.
> TODO: préciser
### Metadata
Every document must end with the following values:
......@@ -97,6 +101,8 @@ Every document must end with the following values:
* Spec version: to ensure the action is compliant with current specification (i.e. the protocol)
* Action version: to ensure the action is compliant with current actions definition (format, parameters)
> TODO: préciser
### Signature
Every document is signed over the whole data (document + metadata).
......@@ -115,6 +121,10 @@ An identity is to published in the process of becoming a new WoT member, thus pr
Fees are returned to the sender if the operation succeeds.
> TODO: quelle protection si pas de monnaie ?
>
> TODO: calcul des frais
#### Format
Dubp.identify(user_id, metadata)
......@@ -162,6 +172,8 @@ Where:
* `0x3db211c9fccee8b149b1a9b2e478a689e6750060395b49fe40125ba1050228a3` is the hexadecimal value of genesis hash
* The last three `()` metadata values are required for the current specification checks
> TODO: vérifier/revoir les specification checks
### Revocation
#### Definition
......@@ -172,6 +184,8 @@ A revocation is the act for its owner to permanently disable the membership of a
Fees are returned to the sender if the operation succeeds.
> TODO: suffisant ? calcul
#### Use case
Disabling the membership of an Account, because, for example:
......@@ -186,7 +200,7 @@ Disabling the membership of an Account, because, for example:
#### Example
A valid revocation document:
A valid revokation document:
```
sign(
......@@ -211,12 +225,14 @@ sign(
Where:
* `0x00` is the value meaning _non-perishable_
* `0x00` is the Nonce special value _00_ as Nonce is not controlled for this particular document
* `0x00` is the Nonce special value _00_ (TODO: confirm) as Nonce is not controlled for this particular document
* `100` is the current spec version
* `1` is the current tx version
* `0x3db211c9fccee8b149b1a9b2e478a689e6750060395b49fe40125ba1050228a3` is the hexadecimal value of genesis hash
* The last three `()` metadata values are required for the current specification checks
> TODO: vérifier/revoir les specification checks
### Certification
#### Definition
......@@ -229,6 +245,8 @@ Fees are returned to the sender if he is a member.
The idea is to make this operation _free_ and allowed only for members. Non-members would pay the fee and see the certification fail, so fees won't be returned for them.
> TODO: calcul
#### Format
Dubp.certify(target_pubkey, metadata)
......@@ -274,6 +292,8 @@ Where:
* `0x3db211c9fccee8b149b1a9b2e478a689e6750060395b49fe40125ba1050228a3` is the hexadecimal value of genesis hash
* The last three `()` metadata values are required for the current specification checks
> TODO: vérifier/revoir les specification checks
### Membership
A _membership_ is the mean by which an Account owner expresses its will to become or remain a member of the WoT (so the owner can produce the UD, blocks and certify people).
......@@ -282,6 +302,10 @@ A _membership_ is the mean by which an Account owner expresses its will to becom
Fees are returned to the sender if the operation succeeds, making it free for members.
> TODO: quelles règles pour permettre à un non-membre de publier son adhésion sans risque de spam ? Problème du non-membre qui n'a pas de quoi financer les frais.
>
> TODO: calcul
#### Format
Dubp.adhere(metadata)
......@@ -319,6 +343,8 @@ Where:
* `0x3db211c9fccee8b149b1a9b2e478a689e6750060395b49fe40125ba1050228a3` is the hexadecimal value of genesis hash
* The last three `()` metadata values are required for the current specification checks
> TODO: vérifier/revoir les specification checks
### UD production
#### Definition
......@@ -335,6 +361,8 @@ The operation fails if the production equals `0`, which can occur for the follow
* no UD was officialized since the account has become member
* all the available UDs were already produced
> TODO: fees amount?
#### Format
Dubp.produce_ud(metadata)
......@@ -386,6 +414,8 @@ A transaction allows transferring money from an account to another.
There are no fees if the transaction is made by a member account (more precisely: fees are returned if the transaction succeeds).
> TODO: calcul
#### Format
Dubp.transfer(amount, to, produce_ud_if_needed, metadata)
......@@ -445,6 +475,8 @@ Where:
* `0x3db211c9fccee8b149b1a9b2e478a689e6750060395b49fe40125ba1050228a3` is the hexadecimal value of genesis hash
* The last three `()` metadata values are required for the current specification checks
> TODO: vérifier/revoir les specification checks
### Session
#### Definition
......@@ -469,8 +501,12 @@ Public keys to be used for:
* GRANDPA
* I'm online
> TODO
#### Example
> TODO
### AtomicSwap
See [Substrate's AtomicSwap pallet](https://docs.substrate.io/rustdocs/latest/pallet_atomic_swap/index.html).
......@@ -499,6 +535,9 @@ extrinsics_root | Merkle root of the body elements
state_root | Merkle root of the Storage
digest | TODO: pas clair
> TODO: décrire précisément comment les champs s'enchaîne en hexa ou autre
> TODO: préciser comment BABE s'intègre dans le bloc (slot number notamment)
##### Body
A list of ordered documents (a.k.a _Extrinsics_).
......@@ -566,16 +605,24 @@ else
HEAD.parent_hash == HEAD~1.hash
> Définir block.hash
#### HR_02 - HEAD.extrinsics_root
HEAD.extrinsics_root == B16_MERKLE_ROOT(HEAD.body)
> Définir MERKLE_ROOT
#### HR_03 - HEAD.state_root
HEAD.state_root == B16_MERKLE_ROOT(NEW_STORAGE)
> Définir NEW_STORAGE
#### HR_04 - HEAD.digest
> TODO
### Processing: identity
#### Variables
......@@ -600,6 +647,8 @@ HEAD.state_root == B16_MERKLE_ROOT(NEW_STORAGE)
#### IR_04 - implicit revocation
> TODO: gérer ce point vu qu'il n'y a pas d'expiration de piscine (IDTY_EXPIRY?)
#### Changeset
Each identity produces the following changeset:
......@@ -615,6 +664,8 @@ Each identity produces the following changeset:
### Processing: membership
> TODO: ajouter l'invalidation des certifications qui ne matchent pas le pseudo ?
#### Variables
* `PUBLIC_KEY`: the membership's signatory
......@@ -635,12 +686,16 @@ If `HEAD.number > 0`:
#### MR_03 - enough certs (BR_G27 + BR_G79)
> TODO: vérifier que les certifications expirées sont bien supprimées, celles rejouées pas dupliquées
COUNT(CERTS_TO) >= sigQty
> Functionally: any member or newcomer needs `[sigQty]` certifications coming *to* him to be in the WoT
#### MR_04 - distance (BR_G24 + BR_G76)
> TODO: revoir
dSen = CEIL(HEAD.membersCount ^ (1 / stepMax))
GRAPH = SET(CERTS_TO, 'issuer', 'receiver')
SENTRIES = SUBSET(GRAPH, dSen, 'issuer')
......@@ -693,8 +748,13 @@ else:
Also:
> TODO: BR_G92
> TODO: défaire l'ancien MS_EXPIRY
ARRAY_REMOVE(STORAGE.MS_EXPIRY[ACCOUNT.expires_on][issuer = PUBLIC_KEY])
> TODO: le nouvel expiry (basé sur ENTRY)
ARRAY_PUSH(STORAGE.MS_EXPIRY[ENTRY.expires_on], { issuer: PUBLIC_KEY })
### Processing: revocation
......@@ -708,6 +768,8 @@ Also:
ACCOUNT.member == true
> TODO: revocation cannot be done on a non-member? (wasMember == true but member == false)
#### RR_02 - revoked is not already revoked (BR_G31 + BR_G83)
ACCOUNT.revoked_on == None
......@@ -734,6 +796,8 @@ Each revocation produces 1 new entry:
* `ACCOUNT`: `STORAGE.ACCOUNT[PUBKEY_FROM]` before processing
* `CERTS_TO`: `STORAGE.CERTS_TO[PUBKEY_TO]` before processing
> TODO: ajouter le pseudo ?
#### CR_01 - certification period (BR_G38 + BR_G67)
If `HEAD.number > 0`:
......@@ -758,16 +822,24 @@ Requirement:
existing == None || existing.replayable_on < HEAD~1.medianTime
> TODO: "<=" ? In "replayable_on <= HEAD~1.medianTime"
#### CR_05 - postpone expiry (BR_G92)
> TODO: défaire l'ancien CERT_EXPIRY
ARRAY_REMOVE(STORAGE.CERT_EXPIRY[CERTS_TO[PUBKEY_TO].expires_on], { issuer: PUBKEY_FROM })
> TODO: le nouvel expiry (basé sur ENTRY)
ARRAY_PUSH(STORAGE.CERT_EXPIRY[ENTRY.expires_on], { issuer: PUBKEY_FROM })
#### Changeset
Each certification produces 1 new entry:
> TODO: vérifier que DUBP fonctionne bien sur ce mode partout "CERTS_TO"
ACCOUNT = (
certs_count = certs_count + 1
cert_chainable_on = MedianTime + sigPeriod
......@@ -781,14 +853,21 @@ Each certification produces 1 new entry:
### Processing: UD production
> TODO: stockage des périodes de membritude dans le compte ?
> TODO: utilisation des périodes de membritude dans le compte pour produire les DU
#### Variables
* `PUBLIC_KEY`: the UD production's signatory
* `ACCOUNT`: `STORAGE.ACCOUNT[PUBLIC_KEY]` before processing
* `amount`: the computed amount of money created from UDs
> TODO: unitBase problem (+ migration)
#### UD_01 - mortality
> TODO
#### UD_02 - amount
amount = 0
......@@ -836,6 +915,8 @@ If operation succeeded incorporate the following changes:
* `UNITBASE_TO(t)`: `` before processing
* `refUnitBase`: `HEAD.unitBase` before processing
> TODO: unitBase problem (+ migration)
#### Changeset
Each transaction introduces:
......@@ -850,10 +931,18 @@ Each transaction introduces:
#### TR_01 - mortality
> TODO
#### TR_02 - enough balance
> TODO
> TODO: base ?
#### TR_03 - overflow
> TODO: in case of "+" operation failure or "pow" failure
#### TR_03 - low account (BR_G106)
For `ACCOUNT in [STORAGE.ACCOUNT[PUBLIC_KEY], STORAGE.ACCOUNT[to]]`:
......@@ -863,6 +952,8 @@ For `ACCOUNT in [STORAGE.ACCOUNT[PUBLIC_KEY], STORAGE.ACCOUNT[to]]`:
ACCOUNT.balance = 0
> Functionnally: too low accounts should not exist (anti account spamming)
>
> TODO: see if there could be another solution to avoid dead accounts to remain despite unitBase changed?
#### TR_04 - empty account
......@@ -872,10 +963,14 @@ For `ACCOUNT in [ACCOUNT_FROM, ACCOUNT_TO]`:
ACCOUNT = None
> TODO: be cautious on account deletion. Check that there is no relevant information before doing so (consumed dividends? idty remaining? ms?)
> Technically: destroy the entry in DB
### Processing: session keys
> TODO
#### Variables
* `PUBLIC_KEY`: the transaction's signatory
......@@ -883,14 +978,24 @@ For `ACCOUNT in [ACCOUNT_FROM, ACCOUNT_TO]`:
#### SK_01 - mortality
> TODO
#### SK_02 - is member
> TODO
#### SK_03 - stake
> TODO
#### SK_04 - format
> TODO: Les clés de session doivent être de type sr25519 (https://docs.substrate.io/v3/concepts/session-keys/)
#### Changeset
> TODO: impacts session courante aussi ?
If the operation succeeded, introduce the following changes:
ACCOUNT = (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment