Skip to content
Snippets Groups Projects

feat(identity): explicit revocation

Merged Pascal Engélibert requested to merge idty_revoke into master

Closes #14 (closed)

Edited by Éloïs

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Éloïs
  • Éloïs
  • added 41 commits

    Compare with previous version

  • Éloïs marked this merge request as draft

    marked this merge request as draft

  • Éloïs changed title from feat(identity): del_all_rights to Draft: feat(identity): explicit revocation

    changed title from feat(identity): del_all_rights to Draft: feat(identity): explicit revocation

    • Resolved by Éloïs

      @tuxmain Il faut également ajouter le hash du block genesis à la payload à signer afin d'empecher une attaque par rejeu entre 2 réseaux.

      Dans le runtime, tu peut récupérer le genesis hash ainsi:

      frame_system::Pallet::<T>::block_hash(T::BlockNumber::zero()))
  • added 13 commits

    Compare with previous version

  • @tuxmain j'ai refondu quasi totalement le code de la wot depuis tes commit. Tu peut au choix te rebaser sur master ou refaire ton code dans une nouvelle PR si tu trouve ça plus simple. J'ai notamment supprimer toute la logique de droits, donc ça devrais être plus simple.

    Aussi il faut que tu émette un évènement pour prévenir les autres pallet qui dépendent de l'identité. Plus précisément il faut prévenir via OnIdtyChange, c'est écouté par la pallet pallet_duniter_wot, c'est cette dernière qui centralise les réactions aux évènements et qui dit aux autres pallet ce qu'elles doivent faire quand un event surviens. Ici il te faut supprimer le membership associé dans la pallet membership. Il faut aussi modifier un handler au niveau du runtime pour prévenir la pallet uds account storage.

    Plus difficile, il faut également prévenir la sous-toile forgeron, bref c'est complexe, on peut se faire une visio pour défricher tout ça si besoin :)

  • added 91 commits

    Compare with previous version

  • @librelois J'ai voulu voir ce qui manquait pour finir ça mais avec cargo test test_idty_revocation --all-features:

    Erreurs error: failed to run custom build command for `gdev-runtime v3.0.0 (/home/tuxmain/Téléchargements/substrate-node-template/runtime/gdev)`

    Caused by: process didn't exit successfully: /home/tuxmain/Téléchargements/substrate-node-template/target/debug/build/gdev-runtime-94bec4b29034b304/build-script-build (exit status: 1) --- stdout Information that should be included in a bug report. Executing build command: "/home/tuxmain/.rustup/toolchains/nightly-2021-11-12-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/home/tuxmain/T\xc3\xa9l\xc3\xa9chargements/substrate-node-template/target/debug/wbuild/gdev-runtime/Cargo.toml" "--color=always" "--profile" "release" Using rustc version: rustc 1.58.0-nightly (936238a92 2021-11-11)

    [...]

    error[E0046]: not all trait items implemented, missing: successful_origin --> /home/tuxmain/.cargo/git/checkouts/substrate-f6ebe91f9d58abf1/8fbc011/frame/collective/src/lib.rs:1014:1 | 1014 | / impl< 1015 | | O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>, 1016 | | I, 1017 | | AccountId: Decode, ... | 1034 | | } 1035 | | } | |_^ missing successful_origin in implementation | = help: implement the missing item: fn successful_origin() -> OuterOrigin { todo!() }

    error[E0046]: not all trait items implemented, missing: successful_origin --> /home/tuxmain/.cargo/git/checkouts/substrate-f6ebe91f9d58abf1/8fbc011/frame/collective/src/lib.rs:1038:1 | 1038 | / impl< 1039 | | O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>, 1040 | | N: U32, 1041 | | AccountId, ... | 1056 | | } 1057 | | } | |_^ missing successful_origin in implementation | = help: implement the missing item: fn successful_origin() -> OuterOrigin { todo!() }

    error[E0046]: not all trait items implemented, missing: successful_origin --> /home/tuxmain/.cargo/git/checkouts/substrate-f6ebe91f9d58abf1/8fbc011/frame/collective/src/lib.rs:1062:1 | 1062 | / impl< 1063 | | O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>, 1064 | | N: U32, 1065 | | D: U32, ... | 1081 | | } 1082 | | } | |_^ missing successful_origin in implementation | = help: implement the missing item: fn successful_origin() -> OuterOrigin { todo!() }

    error[E0046]: not all trait items implemented, missing: successful_origin --> /home/tuxmain/.cargo/git/checkouts/substrate-f6ebe91f9d58abf1/8fbc011/frame/collective/src/lib.rs:1087:1 | 1087 | / impl< 1088 | | O: Into<Result<RawOrigin<AccountId, I>, O>> + From<RawOrigin<AccountId, I>>, 1089 | | N: U32, 1090 | | D: U32, ... | 1106 | | } 1107 | | } | |_^ missing successful_origin in implementation | = help: implement the missing item: fn successful_origin() -> OuterOrigin { todo!() }

  • @tuxmain il ne faut pas utiliser --all-features.

    Soi tu veut jouer tout les tests du projet (déconseillé), dans ce cas la commande est : cargo test --workspace

    Soit tu veut jouer les tests d'une crate en particulier et il faut utiliser l'option -p: dans ton cas cargo test -p pallet-identity.

    Quand tu veut jouer un seul test précis, filtrer avec le nom du test ne suffit pas, il faut quand même indiquer la crate explicitement avec -p.

  • added 5 commits

    Compare with previous version

  • @librelois Voilà, j'ai l'impression que les événements de révocation sont déjà gérés dans les autres palettes.

    Il faut peut-être des tests plus complets par contre ?

    Edited by Pascal Engélibert
  • added 1 commit

    • 1eb76a83 - feat(identity): revoke_identity

    Compare with previous version

  • Éloïs
  • Éloïs
  • Éloïs
  • Éloïs
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading