-
Notifications
You must be signed in to change notification settings - Fork 740
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
omni-node: --dev sets manual seal and allows --chain to be set #6646
omni-node: --dev sets manual seal and allows --chain to be set #6646
Conversation
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
@@ -128,7 +128,8 @@ pub struct Cli<Config: CliConfig> { | |||
/// | |||
/// This is a dev option, and it won't result in starting or connecting to a parachain network. | |||
/// The resulting node will work on its own, running the wasm blob and artificially producing | |||
/// a block each `dev_block_time` ms, as if it was part of a parachain. | |||
/// a block each `dev_block_time` ms, as if it was part of a parachain. Defaults to 3000ms if | |||
/// not set and `--dev` is used. |
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 would be more explicit here about enabling manual sealing and fact that --dev
enables this.
/// Start a dev node that produces a block each `dev_block_time` ms.
///
/// This is a dev option. It enables a manual sealing, meaning blocks are produced manually
/// rather than being part of an actual network consensus process. Using the option won't
/// result in starting or connecting to a parachain network. The resulting node will work on
/// its own, running the wasm blob and artificially producing a block each `dev_block_time` ms,
/// as if it was part of a parachain.
///
/// The `--dev` flag sets the `dev_block_time` to a default value of 3000ms unless explicitly provided.
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.
Used your phrasing here: d6faae7
#[arg(long, conflicts_with_all = &["chain"])] | ||
/// This flag sets `--chain=dev`, `--force-authoring`, `--rpc-cors=all`, `--alice`, and `--tmp` | ||
/// flags, unless explicitly overridden. It also disables local peer discovery (see `--no-mdns` | ||
/// and `--discover-local`). |
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.
Should we mention manual seal here? (I know it does not enable it for every node, but I think it would be good to have this information in cli).
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.
Added a note here: d6faae7.
Signed-off-by: Iulian Barbu <[email protected]>
Co-authored-by: Michal Kucharczyk <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
Signed-off-by: Iulian Barbu <[email protected]>
This reverts commit 405485a.
@@ -134,7 +133,7 @@ impl pallet_timestamp::Config for Runtime { | |||
/// A timestamp: milliseconds since the unix epoch. | |||
type Moment = u64; | |||
type OnTimestampSet = Aura; | |||
type MinimumPeriod = ConstU64<MINIMUM_PERIOD>; | |||
type MinimumPeriod = ConstU64<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.
Ouf of curiosity - why this was set to 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.
At first, it seemed I couldn't run the parachain runtime based chain spec with chopsticks because of an error which IIRC stated that: "Timestamp slot must match CurrentSlot
. This likely means that the configured block time in the node and/or rest of the runtime is not compatible with Aura's SlotDuration
". After reading the code for a bit I thought it might have to do with the MinimumPeriod
, which I changed to SLOT_DURATION / 2
, resulting in the newly generated chain spec to work with chopsticks
. I don't remember if at that time though I validated that changing the minimum period back to 0 and rebuilding everything made chopsticks fail again. Then rebuilding the runtime at a later day made things work without the MinimumPeriod
change. I also tested this right now (removed the previous target folder) and things work as expected without the minimum period change. It might have been some inconsistent local state with my artifacts that caused the issue, but this begs for ensuring that the commands we recommend in the READMEs work in CI. Opened this: #6837.
48c28d4
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6646-to-stable2407
git worktree add --checkout .worktree/backport-6646-to-stable2407 backport-6646-to-stable2407
cd .worktree/backport-6646-to-stable2407
git reset --hard HEAD^
git cherry-pick -x 48c28d4c8b396307fbc9130ad491cb7b15f99c4b
git push --force-with-lease |
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-6646-to-stable2409
git worktree add --checkout .worktree/backport-6646-to-stable2409 backport-6646-to-stable2409
cd .worktree/backport-6646-to-stable2409
git reset --hard HEAD^
git cherry-pick -x 48c28d4c8b396307fbc9130ad491cb7b15f99c4b
git push --force-with-lease |
# Description This PR changes a few things: * `--dev` flag will not conflict with `--chain` anymore, but if `--chain` is not given will set `--chain=dev`. * `--dev-block-time` is optional and it defaults to 3000ms if not set after setting `--dev`. * to start OmniNode with manual seal it is enough to pass just `--dev`. * `--dev-block-time` can still be used to start a node with manual seal, but it will not set it up as `--dev` does (it will not set a bunch of flags which are enabled by default when `--dev` is set: e.g. `--tmp`, `--alice` and `--force-authoring`. Closes: #6537 ## Integration Relevant for node/runtime developers that use OmniNode lib, including `polkadot-omni-node` binary, although the recommended way for runtime development is to use `chopsticks`. ## Review Notes * Decided to focus only on OmniNode & templates docs in relation to it, and leave the `parachain-template-node` as is (meaning `--dev` isn't usable and testing a runtime with the `parachain-template-node` still needs a relay chain here). I am doing this because I think we want either way to phase out `parachain-template-node` and adding manual seal support for it is wasted effort. We might add support though if the demand is for `parachain-template-node`. * Decided to not infer the block time based on AURA config yet because there is still the option of setting a specific block time by using `--dev-block-time`. Also, would want first to align & merge on runtime metadata checks we added in Omni Node here: #6450 before starting to infer AURA config slot duration via the same way. - [x] update the docs to mention `--dev` now. - [x] mention about chopsticks in the context of runtime development --------- Signed-off-by: Iulian Barbu <[email protected]> Co-authored-by: Michal Kucharczyk <[email protected]> (cherry picked from commit 48c28d4)
Successfully created backport PR for |
Backport #6646 into `stable2412` from iulianbarbu. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Iulian Barbu <[email protected]>
Description
This PR changes a few things:
--dev
flag will not conflict with--chain
anymore, but if--chain
is not given will set--chain=dev
.--dev-block-time
is optional and it defaults to 3000ms if not set after setting--dev
.--dev
.--dev-block-time
can still be used to start a node with manual seal, but it will not set it up as--dev
does (it will not set a bunch of flags which are enabled by default when--dev
is set: e.g.--tmp
,--alice
and--force-authoring
.Closes: #6537
Integration
Relevant for node/runtime developers that use OmniNode lib, including
polkadot-omni-node
binary, although the recommended way for runtime development is to usechopsticks
.Review Notes
parachain-template-node
as is (meaning--dev
isn't usable and testing a runtime with theparachain-template-node
still needs a relay chain here). I am doing this because I think we want either way to phase outparachain-template-node
and adding manual seal support for it is wasted effort. We might add support though if the demand is forparachain-template-node
.--dev-block-time
. Also, would want first to align & merge on runtime metadata checks we added in Omni Node here: omni-node: add metadata checks for runtime/parachain compatibility #6450 before starting to infer AURA config slot duration via the same way.--dev
now.