-
Notifications
You must be signed in to change notification settings - Fork 825
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
Add README.md to umbrella #7600
base: master
Are you sure you want to change the base?
Conversation
Maybe I’m getting ahead of myself on the versioning stuff. 👼 For sprucing up the README 🎀—logos, badges, maybe a few emojis. Could I borrow some from the repo’s README? |
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.
Thanks for the initiative. There will be some more reviewers taking a look, so maybe wait for that and then look at the whole feedback in general before changing things.
I asked again internally, and apparently it is better if we write this as Rustdoc and then export it. The difference is that we can actually compile the example to see that it works.
But we can do that as last step. Writing it as markdown is good for now since it renders in github.
@@ -0,0 +1,95 @@ | |||
# `polkadot-sdk` | |||
|
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.
For sprucing up the README 🎀—logos, badges, maybe a few emojis. Could I borrow some from the repo’s README?
Yes of course. I think having a unified look could even be beneficial. Although the repo readme is probably a bit over the top for our need here 😆
umbrella/README.md
Outdated
@@ -0,0 +1,95 @@ | |||
# `polkadot-sdk` | |||
|
|||
`polkadot-sdk` is an umbrella crate re-exporting all other published crates, except for the example and fuzzing, plus some of the runtime crates like Rococo. Consider it the entry to the whole Polkadot and Substrate ecosystem. |
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.
I think the word "umbrella" is not actually that well known in this context. We may need to explain it more first.
You can also omit Rococo, it will be phased out.
umbrella/README.md
Outdated
|
||
## Versioning | ||
|
||
We do a stable release for the SDK quarterly with a version scheme reflecting the release cadence. At the time of writing, the latest version is `stable2412` (released on December 2024). To avoid confusion, we plan to align with the established scheme for the umbrella crate. For example, the next stable version of `polkadot-sdk` will be `2503.0.0`. |
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.
Am currently asking the release team on what to do here. Either we go with this, or 0.2503
instead.
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.
I feel like 2503.0.0 might have a better chance of being semver-compatible—a lot more than bug fixes could happen in a 3-month window.
|
||
## Usage | ||
|
||
The re-exported crates are grouped under the following feature sets. |
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.
I think we dont need to explain all of these features in detail. The big ones like node
and runtime
should probably be first and then the other ones can go into a dropdown for details.
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.
So the scenarios are as follows.
I want to do the following:
- I want to build a node with the umbrella crate (
node
feature) - I want to build a runtime with the umbrella crate (
runtime
feature) - I want to have benchmarking in the runtime
- I want to use pallet-x, y and z in my runtime
These should be answered in this section.
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.
Yeah, that’s better! 😊
umbrella/README.md
Outdated
|
||
```toml | ||
[dependencies] | ||
polkadot-sdk = { version = "0.12.0", features = ["runtime", "tuples-96"] } |
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.
The tuples-96
is only needed for bigger runtimes and is a power-user feature.
Can explain it in some advanced section.
umbrella/README.md
Outdated
|
||
[features] | ||
runtime-benchmarks = ["polkadot-sdk/runtime-benchmarks"] | ||
with-tracing = ["polkadot-sdk/with-tracing"] |
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.
The tracing is also power user. Maybe focus on the minimal viable usage here - just a runtime.
umbrella/README.md
Outdated
* fine-grained control over dependencies | ||
* any suggestions? | ||
|
||
In addition to the features above, each re-exported crate is feature-gated individually so that one can control exactly which crates to include. In the contrived example below, only the `frame-support` and `frame-system` crates are needed. |
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.
Some context:
This is done to reduce build time in cases where only a small subset of dependencies is needed. The less dependencies you enable - the faster it builds.
} | ||
``` | ||
|
||
To learn more about building with the Polkadot SDK, you may start with these [guides](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/index.html). |
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.
Let's link to both this, and docs.polkadot.com
.
|
||
Seldomly, if the runtime grows larger than 64 pallets, the trait implementations will no longer apply, then the feature `tuples-96` (or even `tuples-128`) is required (at the cost of increased compile time). | ||
|
||
## 🚀 Versioning |
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.
Link to https://github.com/paritytech/release-registry/ would be useful.
polkadot-sdk = { version = "0.12.0", features = ["frame-support", "frame-system"] } | ||
``` | ||
|
||
```rust |
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.
It is great that this is a full e2e working example!
What is missing is the fact that there is no connection made between polkadot-sdk
and polkadot-sdk-frame
, which is also exported as a part of it.
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.
High level question: if we're adding an umbrella README, does it make sense to have it in here (polkadot-sdk-docs - reference_docs) too? Thinking about include_str!
it to the umbrella_crate.rs
. Some existing parts from umbrella_crate.rs
might still be relevant for this README, like Known Issues
, so we can add them to the README and replace the umbrella_crate.rs
entirely. I think the rust
code sections from the README will be compiled when building the docs for polkadot-sdk-docs
too, so we ensure they are still compiling over time.
It doesn't feel right to me to describe a language feature as a known issue. It kind of makes it sound like it’s a problem with polkadot-sdk that can be fixed, when it’s really neither. What do you think about this instead? // `frame_support` and `frame_system` are declared here
use polkadot_sdk::*;
#[frame_support::pallet(dev_mode)]
pub mod pallet {
// `frame_support` and `frame_system` are imported in the outer module,
// but are not automatically inherited here. Need to "re-import" to make
// them available in the inner module.
use super::*; If it's what you want here, I could also include a bit about how |
No, the thing I was thinking is to merge this README and the |
Resolves #7536