Skip to content

Add documentation around FRAME Origin#3362

Merged
kianenigma merged 29 commits into
masterfrom
kiz-origin-docs
Feb 27, 2024
Merged

Add documentation around FRAME Origin#3362
kianenigma merged 29 commits into
masterfrom
kiz-origin-docs

Conversation

@kianenigma

@kianenigma kianenigma commented Feb 16, 2024

Copy link
Copy Markdown
Contributor

Does the following:

  • Add a reference doc page named frame_runtime_types, which explains what types like RuntimeOrigin, RuntimeCall etc are.
  • On top of it, it adds a reference doc page called frame_origin which explains a few important patterns that we use around origins
  • And finally brushes up #[frame::origin] docs.
  • Updates the theme, sidebar and favicon to look like:
Screenshot 2024-02-20 at 12 16 00

All of this was inspired by https://substrate.stackexchange.com/questions/10992/how-do-you-find-the-public-key-for-the-medium-spender-track-origin/10993

closes paritytech/polkadot-sdk-docs#45
closes paritytech/polkadot-sdk-docs#43
contributes / overlaps with #2638 cc @liamaharon
deprecation companion: polkadot-developers/substrate-docs#2131
pba-content companion: Polkadot-Blockchain-Academy/pba-content#977

@kianenigma kianenigma added the T11-documentation This PR/Issue is related to documentation. label Feb 16, 2024
@kianenigma
kianenigma requested a review from a team as a code owner February 16, 2024 14:39
@kianenigma kianenigma added the R0-no-crate-publish-required The change does not require any crates to be re-published. label Feb 16, 2024

@profradha profradha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the write-up on origins!

Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_runtime_types.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_runtime_types.rs Outdated
@kianenigma
kianenigma requested a review from a team as a code owner February 20, 2024 13:22

@skunert skunert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice docs!

When I run locally it seems like the theming is inconsistent. On some pages I have the default theme and it switches randomly to a darker theme (browser: firefox). Not sure if this is an issue on my end 🤔
Screenshot from 2024-02-22 10-44-41

vs

Screenshot from 2024-02-22 10-44-33

Comment thread docs/sdk/src/meta_contributing.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_runtime_types.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_runtime_types.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Comment thread docs/sdk/src/reference_docs/mod.rs Outdated
@paritytech-review-bot
paritytech-review-bot Bot requested a review from a team February 23, 2024 10:24
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated

@liamaharon liamaharon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments but overall doc looks good. Also, theme looks great 👍🏼

Comment thread docs/sdk/src/reference_docs/mod.rs Outdated
Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
//! example:
//!
//! * If the majority of token holders agreed upon this. This is more or less what the
//! [`pallet_democracy`] does under the hood ([reference](https://github.com/paritytech/polkadot-sdk/blob/edd95b3749754d2ed0c5738588e872c87be91624/substrate/frame/democracy/src/lib.rs#L1603-L1633)).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an example of using the Origin abstraction? Seems just like regular logic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is meant to showcase that pallets can dispatch internally and set any origin. And, that an origin like root can only be acquired in this way.

I will re-read it one more time.

Comment thread docs/sdk/src/reference_docs/frame_origin.rs Outdated
kianenigma and others added 4 commits February 26, 2024 10:14
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

@muharem muharem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

It would be also very helpful to have more context for OriginTrait docs, specially methods add_filter, reset_filter, filter_call.

@kianenigma

Copy link
Copy Markdown
Contributor Author

Thank you!

It would be also very helpful to have more context for OriginTrait docs, specially methods add_filter, reset_filter, filter_call.

This is a great suggestion! will either do here or in a follow-up.

@kianenigma
kianenigma enabled auto-merge February 27, 2024 10:49
@kianenigma
kianenigma added this pull request to the merge queue Feb 27, 2024
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Feb 27, 2024
@kianenigma
kianenigma added this pull request to the merge queue Feb 27, 2024
Merged via the queue into master with commit 29369a4 Feb 27, 2024
@kianenigma
kianenigma deleted the kiz-origin-docs branch February 27, 2024 16:21
ordian added a commit that referenced this pull request Feb 28, 2024
…head-data

* origin/master: (51 commits)
  Runtime Upgrade ref docs and Single Block Migration example pallet  (#1554)
  Collator overseer builder unification (#3335)
  Introduce storage attr macro `#[disable_try_decode_storage]` and set it on `System::Events` and `ParachainSystem::HostConfiguration` (#3454)
  Add Polkadotters bootnoders per IBP application (#3423)
  Add documentation around FRAME Origin (#3362)
  Bridge zombienet tests: Check amount received at destination (#3490)
  Snowbridge benchmark tests fix (#3424)
  fix(zombienet): increase timeout in download artifacts (#3376)
  Cleanup String::from_utf8 (#3446)
  [prdoc] Validate crate names (#3467)
  Limit max execution time for `test-linux-stable` CI jobs (#3483)
  Introduce Notification block pinning limit (#2935)
  frame-support: Improve error reporting when having too many pallets (#3478)
  add Encointer as trusted teleporter for Westend (#3411)
  [pallet-xcm] Adjust benchmarks (teleport_assets/reserve_transfer_assets) not relying on ED (#3464)
  Add more debug logs to understand if statement-distribution misbehaving (#3419)
  Remove redundant parachains assigner pallet. (#3457)
  Use generic hash for runtime wasm in resolve_state_version_from_wasm (#3447)
  Runtime: allow backing multiple candidates of same parachain on different cores  (#3231)
  Bridge zombienet tests: move all "framework" files under one folder (#3462)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published. T11-documentation This PR/Issue is related to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ref docs for frame_composite_enums Ref docs for frame_origin

7 participants