Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Glutton update script #2681

Closed
wants to merge 20 commits into from
Closed

Glutton update script #2681

wants to merge 20 commits into from

Conversation

NachoPal
Copy link
Contributor

@NachoPal NachoPal commented Jun 2, 2023

Script to update Gluttons Parachains. It allows to update Compute (percentage of the left over ref_time to consume during on_idle) and Storage (percentage of left over proof_size to consume during on_idle) storage items for a range of selected parachain ids.

Necessary to learn what are the limits of the Relay chain and subsequently the max number of Parachains it can handle.

@NachoPal NachoPal added B0-silent Changes should not be mentioned in any release notes T7-system_parachains This PR/Issue is related to System Parachains. A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. labels Jun 2, 2023
Copy link
Contributor

@sandreim sandreim left a comment

Choose a reason for hiding this comment

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

LGTM, only a few suggestions.

@rphmeier
Copy link
Contributor

rphmeier commented Jun 2, 2023

What does it mean to "update" a glutton parachain? Needs more description.

@bkchr
Copy link
Member

bkchr commented Jun 4, 2023

I have the strong feeling that this could be a 10 line polkadot js script?

@NachoPal
Copy link
Contributor Author

NachoPal commented Jun 5, 2023

What does it mean to "update" a glutton parachain? Needs more description.

Improved description

NachoPal and others added 6 commits June 5, 2023 12:32
* Fix docs

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update client/relay-chain-rpc-interface/src/reconnecting_ws_client.rs

Co-authored-by: Davide Galassi <davxy@datawok.net>

* Update cargo.lock with substrate

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update Cargo.lock for polkadot

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Davide Galassi <davxy@datawok.net>
Co-authored-by: parity-processbot <>
@NachoPal
Copy link
Contributor Author

NachoPal commented Jun 5, 2023

I have the strong feeling that this could be a 10 line polkadot js script?

Yeah, it would be definitely shorter, and would have taken me also less time. I considered both options, but Joe preferred me to use subxt.

Now that is done, I would love it to see it merged so we can start deploying the Glutton Parachains as soon as possible.

Copy link
Contributor

@gilescope gilescope left a comment

Choose a reason for hiding this comment

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

Like the use of subxt!

@gilescope
Copy link
Contributor

My only concern is the Cargo.lock changes. At the moment subxt is bringing in another version of substrate. Can/should we persuade it to use the same version of substrate as cumulus does?

[dependencies]
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
subxt = { version = "0.29.0", features = ["unstable-metadata"] }
sp-keyring = "23.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can nix this dep, don't think it's needed. Seems to compile on my machine without it.

Suggested change
sp-keyring = "23.0.0"

.runtime_api()
.at_latest()
.await?
.call(runtime_api_call)
Copy link

@jsdw jsdw Jun 7, 2023

Choose a reason for hiding this comment

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

If you want to avoid the unstable-metadata thing you could also use a "raw" call to the same thing (assuming nonce is a u32, which is true in substrate/polkadot and I'd expect most other chains):

let next_nonce: u32 = client
    .runtime_api()
    .at_latest()
    .await?
    .call_raw("AccountNonceApi_account_nonce", Some(&account.encode()))
    .await?;

I'm actually going to move Subxt to do this too, and will likely expose a way to get this in the next version

.unwrap();

// Submit and watch the tx
let in_block = signed_tx.submit_and_watch().await.unwrap().wait_for_in_block().await.unwrap();
Copy link

Choose a reason for hiding this comment

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

Just to note that .wait_for_in_block() doesn't guarantee that the block will be finalized; use .wait_for_finalized() for that, or even .wait_for_finalized_success() to also verify that the tx was successfully executed (ie an ExtrinsicSuccess event was produced from its inclusion)

@jsdw
Copy link

jsdw commented Jun 7, 2023

My only concern is the Cargo.lock changes. At the moment subxt is bringing in another version of substrate. Can/should we persuade it to use the same version of substrate as cumulus does?

Just to reiterate I said in DM; subxt won't bring in any substrate crates (except sp-core-hashing which is tiny) unless used with the "substrate-compat" feature flag so this hsouldn't matter :)

@@ -0,0 +1,4403 @@
# This file is automatically @generated by Cargo.
Copy link
Member

Choose a reason for hiding this comment

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

@bkchr do you have any opinion on multiple Cargo.lock files per repo?
I still think its not a good idea and then should rather be its own repo.
The monorepo migration will not profit from this either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we do not add it to the main workspace, what is the issue for having other Cargo.lock files on their own package?

Copy link
Member

Choose a reason for hiding this comment

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

The dependabot does not update it (so the deps will be out dated) and our CI tooling like fmt, clippy will not work.

Copy link
Contributor Author

@NachoPal NachoPal Jun 7, 2023

Choose a reason for hiding this comment

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

I do not mind at all to move it to its own repo. It is just a tool to help to achieve a higher goal which is Glutton Parachains management. It is not mandatory to include it in Cumulus.

But if it is true that adding subxt to the main workspace could potentially lead to multiple versions of the same crate, and at the same time, we do not want to have multiple Cargo.lock files, then it means we are banning subxt from Cumulus/monorepo.

Copy link
Contributor Author

@NachoPal NachoPal Jun 7, 2023

Choose a reason for hiding this comment

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

The dependabot does not update it (so the deps will be out dated) and our CI tooling like fmt, clippy will not work.

Yes, I understand that, but there are other scripts using Polkadot Js with a yarn.lock, and those are not checked or updated either by the CI as far as I know. So I do not know why if we accept polkadot js we can not tolerate subxt getting outdated. I would understand it if it were part of the client/runtime.

Copy link
Member

Choose a reason for hiding this comment

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

I do not mind at all to move it to its own repo

I would personally favour this.

@jsdw
Copy link

jsdw commented Jun 7, 2023

My only concern is the Cargo.lock changes. At the moment subxt is bringing in another version of substrate. Can/should we persuade it to use the same version of substrate as cumulus does?

Just to reiterate I said in DM; subxt won't bring in any substrate crates (except sp-core-hashing which is tiny) unless used with the "substrate-compat" feature flag so this hsouldn't matter :)

Actually this isn't true; the substrate-compat feature is enabled by default, and you need the substrate crates currently to sign transactions, and Subxt needs to pull these from crates.io, so there's not currently a way to avoid the dupe deps at the mo!

I am working on adding some native signing support to Subxt so that you can do basic transaction signing like here without pulling in a load of substrate crates.

Alternately I'm hoping for a future where substrate crates are published regularly again, and polkadot/cumulus depend on the crates and not github master; it'll be easier to keep things like Subxt in line with the latest deps then :)

@NachoPal
Copy link
Contributor Author

NachoPal commented Jun 8, 2023

Closing in favor of: paritytech/parachain-utils#1

@NachoPal NachoPal closed this Jun 8, 2023
@NachoPal NachoPal deleted the nacho/glutton-update-script branch June 8, 2023 11:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. T7-system_parachains This PR/Issue is related to System Parachains.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants