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

feat: ⏫ upgrade to Polkadot SDK stable2409 #228

Merged
merged 67 commits into from
Oct 15, 2024

Conversation

TDemeco
Copy link
Contributor

@TDemeco TDemeco commented Oct 14, 2024

Update from Polkadot SDK stable2407 to stable2409

  • Changelog for Node Dev:
    • #5250 - Export MetricsService and add public constructor to RpcHandlers
      • Note: I went through our code and I don't believe we need any changes, but it's worth it to double check.
    • #5195 - Bump Aura authoring duration to 2s to make better use of the provided coretime.
      • Note: Updated in StorageHub.
    • #3786 - Make changing peer ID while active a bit more robust.
      • This implements RFC91, which tries to solve the problem that happens when a node doesn't persist its node key while in the active set so both the old and new address persist in the DHT and nodes in the network will randomly resolve to one of them until the old one expires after 36h.
    • #5352 - Aura: ensure parachains are building on all relay chain forks per slot.
    • #5431 - Remove the need to wait for target block header in warp sync implementation.
      • Note: parameter name changed in build_network, updated in SH.
    • #5288 - Added polkadot-parachain-lib helper library that can be used to build a parachain node.
      • Note: it would be quite a big refactor to use it for our parachain node right now.
    • #5269 - Related to #5288, adding the ability to build a parachain node using u64 as the block number type
    • #4739 - Genesis config presets added to parachain template.
      • Note: refactored structure to follow new template guidelines in SH.
    • #5316 - Add timestamp function to sp-consensus-slots. This function returns the timestamp when the slot began.
    • #5065 - Replace env_logger with sp_tracing because of an issue with env_logger and gum.
      • Note: no changes required on our side but good to know in case we were planning on using env_logger.
    • #5364 - Improve sc-service API by not requiring the whole Configuration object and using specific configuration options instead.
      • Note: required changes made in StorageHub’s node implementation.
    • #5527 - Report BestBlock events only for NewBlock reports. This ensures that the chainHead_v1_follow method of the RPC-v2 API is always reporting a BestBlock event after a NewBlock
      • The stream reported a BestBlock event for a block not previously reported via NewBlock because of a race condition. Now, instead of relying on the client’s info they use the last finalized block to emit a new event. So there are two cases when a new BestBlock event is emitted:
        • The best block is in the pruned list, and is reported immediately.
        • The best block is not a descendant of the last finalized block
    • #5339 - Replace unnecessary &mut self with &self in BlockImport::import_block(), since independent blocks can technically be imported concurrently (and in practice it was called through Arc anyway).
  • Changelog for Runtime Dev:
    • #4970 - Remove pallet::getter usage from the transaction-payment pallet.
      • Note: changes applied to StorageHub’s runtime.
    • #5384 - MaybeConsideration extension trait for Consideration. This allows the management of tickets that may represent no cost.
      • Note: Consideration is used for migrating pallets that utilize the Currency and fungible traits for holds and freezes, which we do, so it might be useful in the future.
    • #5695 - pallet-migrations: fix index access for singular migrations.
      • A bug was discovered in the migrations pallet that occurs when a single MBM is configured. This is fixed in this PR.
    • #5327 - Moved presets to the testnet runtimes.
      • Note: changes in StorageHub applied to follow structure of other system chains.
    • #5604 - Clear other messages before dry-running
      • The DryRunApi.dry_run_call and DryRunApi.dry_run_xcm functions used to populate forwarded_xcms with all the existing messages in the queues at the time. Now, existing (irrelevant) messages are cleared when dry-running, meaning only the messages produced by the dry-run call (or xcm) will be returned in forwarded_xcms.
    • #5712 - Better logs for message execution and processing in xcm-emulator
      • Note: our XCM simulator uses the XCM emulator from Parity in the backend, so we’ll get these extra logs.
    • #5132 - Add from_mel for Footprint. This allows to generate a Footprint type by calculating the Maximum Encoded Length of a generic type.
    • #5131 - Swap for paying delivery fees in different assets. This allows XCMs to use the configured AssetExchanger to swap fees to use for delivery fees, if possible.
      • Note: great addition but since we only use DOT (or at least that’s the plan) we don’t have an AssetExchanger. Maybe we could allow to swap other assets to DOT using the AssetHub, but I believe (not confirmed) those would not be native DOTs and we would end up managing two kinds of DOTs (native and derivative).
    • #5173 - Umbrella crate: exclude chain-specific crates. The umbrella crate is supposed to be chain-agnostic. Since devs might want to use chain-specific crates and they should be able to select matching versions numbers, it is recommended to use psvm
    • #5580 - Improve error messages for pallet macro generated code.
    • #4488 - TX Payment: drop ED requirements for tx payments with exchangable assets.
      • Basically, when swapping assets during a transaction payment, the amount had to be greater than the ED because it used an intermediary empty account if the user lacks a native asset account.
      • Note: no change needed on StorageHub since we only handle native DOT, but thought it was interesting to know.
    • #5467 - Make PendingConfigs storage item public, which holds a list of configuration changes each with a session index at which it should be applied.
    • #5078 - Add possibility to inject non-authorities session-keys in genesis for non-validators, since currently all keys injected in genesis were considered as part of the initial validators set.
      • Note: change made in StorageHub’s runtime.
    • #4967 - Remove pallet::getter from pallet-balances.
      • Note: changes done in StorageHub tests.
    • #5155 - Use umbrella crate for minimal template. This PR adds a few minor changes to make the umbrella crate ready to use for production and integrates it in the minimal template.
      • Note: we should keep this one in the back of our minds since it seems this is the direction that the Polkadot SDK devs want parachain teams to follow.
    • #4976 - Make xcm::v4::PalletInfo public.
    • #5257 - Enable proof-recording in the timing benchmarks. This is the correct default settings for parachains on recent versions of polkadot-sdk. In addition, the ProofSizeExt extension is available during benchmarking.
    • #4930 - Add test macro to emulated chains, to test if trapped assets can be claimed. It also adds a macro to test if the relay chain is a trusted teleporter.
      • Note: we could use these macros if we add the whole framework that the polkadot-sdk repo has for tests of system chains, but I believe this should be done in the PR that adds StorageHub as a system chain to the repo.
    • #5655 - Reset to genesis storage after each run. This fixes an error where, after the first benchmark, the second one used an invalid genesis state because the genesis state was partially provided via OverlayedChanges, which were reset. It also adds the —genesis-builder-preset option to allow using different genesis preset names.
  • Changelog for Node Operator:
    • #4792 - RPC: bind to IPV6 if available and add CLI —experimental-rpc-endpoint to specify listed address.
      • Note: changes made in StorageHub, since this removes the deny_unsafe from the RPC implementation.
    • #5240 - Warn on empty —public-addr CLI parameter when starting a validator node. In the future, this will be a hard failure.
  • Changelog for Runtime User:
    • #4424 - Coretime auto renewal. Any task that utilizes a core that can be auto-renewed (such as parachains) can enable auto-renewal, which is paid from the task’s sovereign account.

@TDemeco TDemeco changed the title feat: 🚧 start update to stable2409 feat: ⏫ upgrade to Polkadot SDK stable2409 Oct 14, 2024
@TDemeco TDemeco marked this pull request as ready for review October 14, 2024 18:50
mod weights;

extern crate alloc;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know why this is here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is because the runtime is a no_std crate that supports allocation (more specifically, we use alloc in the genesis_config_presets.rs file), and alloc is a "sysroot" crate which is distributed with Rust itself, so the 2018 Rust update that removed the need for extern crate syntax doesn't apply for it (more info here)

@TDemeco TDemeco merged commit 12e3982 into main Oct 15, 2024
21 checks passed
@TDemeco TDemeco deleted the update/polkadot-sdk-stable2409 branch October 15, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants