Skip to content
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 Runtime::OmniNode variant to polkadot-parachain #4805

Merged
merged 17 commits into from
Jun 28, 2024

Conversation

serban300
Copy link
Contributor

@serban300 serban300 commented Jun 17, 2024

Adding Runtime::OmniNode variant + small changes

@serban300 serban300 self-assigned this Jun 17, 2024
@serban300 serban300 added the T0-node This PR/Issue is related to the topic “node”. label Jun 17, 2024
@serban300 serban300 force-pushed the polkadot-parachain-omni-node branch 3 times, most recently from b06a92c to 0c13a9a Compare June 17, 2024 09:38
@paritytech paritytech deleted a comment from paritytech-cicd-pr Jun 17, 2024
@bkchr
Copy link
Member

bkchr commented Jun 17, 2024

Why are you adding all these chain specs here?

@serban300 serban300 force-pushed the polkadot-parachain-omni-node branch 2 times, most recently from 6206313 to c8b1be8 Compare June 17, 2024 10:57
Also we can't have the banner printed all the time, because it leads to
printing malformed chain specs.
@serban300 serban300 force-pushed the polkadot-parachain-omni-node branch from c8b1be8 to 16b759d Compare June 17, 2024 10:58
@serban300 serban300 force-pushed the polkadot-parachain-omni-node branch from 16b759d to 84b1d32 Compare June 17, 2024 11:54
@kianenigma
Copy link
Contributor

kianenigma commented Jun 18, 2024

Why are you adding all these chain specs here?

the chain specs are only for manual testing, we should remove them 🙈 unless if they are used in CI tests.

@serban300
Copy link
Contributor Author

Why are you adding all these chain specs here?

the chain specs are only for manual testing, we should remove them 🙈 unless if they are used in CI tests.

Done

@@ -47,7 +47,7 @@ short-benchmark-westend: &short-bench
tags:
- benchmark
script:
- ./artifacts/polkadot-parachain benchmark pallet --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1
- ./artifacts/polkadot-parachain-omni-node benchmark pallet --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1
Copy link
Contributor

Choose a reason for hiding this comment

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

@ggwpez the days for this command is also numbered, is there a ticket to move this to the omni-bencher?

Side question: can the omni-node do benchmarking as well? what are the runtime-dependent parts of the benchmarking code that live in the node side? I suppose there are dependencies that led to the omni-bencher being created, but idk what they are.

```
cargo run --release --bin polkadot-parachain --features runtime-benchmarks -- benchmark machine --base-path /mnt/scratch/benchmark
cargo run --release --bin polkadot-parachain-omni-node --features runtime-benchmarks -- benchmark machine --base-path /mnt/scratch/benchmark
Copy link
Contributor

Choose a reason for hiding this comment

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

From my understanding, all node benchmark commands should eventually be moved to omni-bencher CLI. I am not sure if the tool is ready yet, but good to know what is the end goal.


https://paritytech.github.io/chainspecs

<bold>polkadot-parachain-omni-node --chain asset-hub-polkadot --sync warp -- --chain polkadot --sync warp</>
Copy link
Contributor

Choose a reason for hiding this comment

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

The meat of the omni node is knowing how to use the --chain. But this flag is coming from the depth of the substrate's CLI types. I wish there was a way to customize the doc you get from --chain to, for example, demonstrate the list of options for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if this is possible. I will check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find a way to do this so far

Please refer to the following resources to learn more about the omni-node:
- https://forum.polkadot.network/t/polkadot-parachain-omni-node-gathering-ideas-and-feedback/7823/4
- https://github.com/paritytech/polkadot-sdk/issues/5
- sdk-docs
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to work on a small set of ref-docs and push them to this PR about how to use the omni-node.

Copy link
Member

Choose a reason for hiding this comment

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

IMO this entire text is spam. What is the need to spam every node launch with this stuff? You don't need to mention the issues etc...

Also --help is like available on every CLI program on this planet.

Formerly know as polkadot-parachain, now called polkadot-parachain-omni-node, equipped with running more parachains in the Polkadot networks.

If you run the binary, which was renamed, you already know that it was renamed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am trying to gain more attention to this. How about we let it spam all CLIs for a few versions, then move it to --help?

I generally agree it is spammy. We can also move it to --help as of now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it for the moment since it doesn't fit if we keep the old name. I can add it back if you decide that it's needed.

How about we let it spam all CLIs for a few versions, then move it to --help ?

If we show it, we need to show it only just with --help. Otherwise for example the chain-spec generation commands will show it, resulting in malformed chain specs.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6505723

@serban300 serban300 marked this pull request as ready for review June 20, 2024 06:53
@serban300 serban300 changed the title polkadot-parachain-omni-node v0.1.0 Add Runtime::OmniNode variant to polkadot-parachain Jun 20, 2024
@serban300
Copy link
Contributor Author

serban300 commented Jun 20, 2024

The CI is passing and I reverted the renaming. The PR only adds the Runtime::OmniNode variant now plus some cosmetics. @bkchr @kianenigma could you take another look please ?

cumulus/polkadot-parachain/src/main.rs Show resolved Hide resolved
info!("Parachain Account: {}", parachain_account);
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });
info!("🪪 Parachain id: {:?}", id);
info!("🧾 Parachain Account: {}", parachain_account);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
info!("🧾 Parachain Account: {}", parachain_account);

Not sure we need this anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not though? it seems like a nice user friendly addition to me. As a noob, it would be nice to see it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also think it's nice to have it.

Comment on lines +875 to +876
// rococo actually uses aura import and consensus, unlike most system chains that use
// relay to aura.
Copy link
Member

Choose a reason for hiding this comment

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

"relay to aura" is generic that it also works if you just have an aura chain from gensis.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, just that it is needlessly checking some if statement, so it is a miniscule slower, but it indeed works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if I understood correctly. Are you suggesting to use start_generic_aura_lookahead_node here ?

Copy link
Member

@eskimor eskimor left a comment

Choose a reason for hiding this comment

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

Looks good. I am concerned though introducing Omninode this way. If we need to change the user interface we should not evolve it over time on a live product.

cumulus/polkadot-parachain/src/command.rs Show resolved Hide resolved

(norm_id, orig_id, para.map(Into::into))
(id, id, None)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm. Is this also a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldn't be. This is just cosmetics. The logic should be the same as before.

@bkchr
Copy link
Member

bkchr commented Jun 23, 2024

If we need to change the user interface we should not evolve it over time on a live product.

What? What user interface are you talking about here? What are the changes to this user interface you are talking about here? I don't see them. Please show them to me.

@kianenigma
Copy link
Contributor

If we need to change the user interface we should not evolve it over time on a live product.

What? What user interface are you talking about here? What are the changes to this user interface you are talking about here? I don't see them. Please show them to me.

For example, we agreed that as the next step, we want to add the ability to dummy-run a runtime without consensus (manual-seal + automatic submission). This will possibly require new CLI flags, or in the worst case cause some bug somewhere. Similarly, once we add EVM support, it will be a lot of change. I think this is what Rob is concerned about here.

tbh I originally agreed more with Rob (+this would also allow us to rename things as we wished, and actually call the the omno node binary omni-node), but atm the pragmatic solution is to move forward with the current plan, so will review and approve now.

Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

LGTM module the open conversations

@bkchr
Copy link
Member

bkchr commented Jun 26, 2024

This will possibly require new CLI flags, or in the worst case cause some bug somewhere.

For sure this will require a new CLI flag. However, you could have a bug everywhere.

tbh I originally agreed more with Rob (+this would also allow us to rename things as we wished, and actually call the the omno node binary omni-node), but atm the pragmatic solution is to move forward with the current plan, so will review and approve now.

TBH, I know how all this code works. I don't get why you are afraid or whatever.

Copy link
Contributor

@skunert skunert left a comment

Choose a reason for hiding this comment

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

Looks good!

cumulus/polkadot-parachain/src/main.rs Outdated Show resolved Hide resolved
@serban300 serban300 added this pull request to the merge queue Jun 28, 2024
Merged via the queue into paritytech:master with commit 18a6a56 Jun 28, 2024
156 of 159 checks passed
@serban300 serban300 deleted the polkadot-parachain-omni-node branch June 28, 2024 06:28
TomaszWaszczyk pushed a commit to TomaszWaszczyk/polkadot-sdk that referenced this pull request Jul 7, 2024
)

Adding `Runtime::OmniNode` variant + small changes

---------

Co-authored-by: kianenigma <[email protected]>
@serban300 serban300 mentioned this pull request Jul 22, 2024
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
)

Adding `Runtime::OmniNode` variant + small changes

---------

Co-authored-by: kianenigma <[email protected]>
AurevoirXavier added a commit to darwinia-network/darwinia that referenced this pull request Dec 25, 2024
sfffaaa pushed a commit to peaqnetwork/polkadot-sdk that referenced this pull request Dec 27, 2024
)

Adding `Runtime::OmniNode` variant + small changes

---------

Co-authored-by: kianenigma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants