This page contains summaries of the merged PRs into Substrate organized in two sections: “Runtime” (using the B1-note_worthy
+ T1-runtime
labels) and “Node SDK” (using the B1-note_worthy
+ T0-node
labels).
Read more about how Substrate uses labels here.
Here are note-worthy Runtime PRs in Substrate repo merged between 2023-06-23 and 2023-07-25.
WeightMeter
: more consistent namingSummary
The code changes recommended by @gavofyork involve more consistent naming for the WeightMeter
. The changes include deprecating certain methods and introducing new ones with different names. Additionally, the consumed
and limit
variables are privatized and new getter methods consumed()
and limit()
are added.
integrity_test
in ExternalitiesSummary
This code change includes a change to always run the integrity_test
in test externalities.
Summary
This PR stabilizes the V15 metadata by making several changes. It exposes APIs to easily update the metadata in the future, collects type information about the runtime API functions, adds overarching enums to the metadata to ease decoding, modifies the extrinsic metadata to include type information for certain types, and adds support for custom types without breaking changes. These changes aim to improve the stability and functionality of metadata for Substrate chains.
Block
to frame_system
instead of construct_runtime
and removes Header
and BlockNumber
Summary
This code change fixes an issue related to defining parameters in construct_runtime!
. It allows for a simplified syntax and adds types as part of frame_system
. Additionally, it removes BlockNumber
and Header
from frame_system::Config
and instead uses Block
to retrieve them. This is a breaking change, but it is backwards compatible with a warning issued for the older syntax.
Summary
This code change includes memory database reference counts when the test-externalities storage is backed up and restored from snapshots.
pallet-message-queue
: add queue pausingSummary
This code change introduces a QueuePausedQuery
hook into the Message Queue pallet that allows for dynamically pausing queues before they start servicing. It reduces complexity and improves efficiency compared to using Yield
or implementing ProcessMessage
for pausing. Additionally, explicit suspension via a bool flag in BookState
is implemented, although it is not well usable for the specific context of the code change. The changes include adding the QueuePausedQuery
to the Message Queue pallet config, adding a new trait, and extending error types.
VersionedRuntimeUpgrade
Summary
This code change makes it easier to write versioned runtime upgrades. It introduces a struct called VersionedRuntimeUpgrade
that handles version handling and allows developers to write migrations without worrying about checking and setting storage versions. The struct takes five type parameters and when its on_runtime_upgrade
method is called, it compares the on-chain version of the pallet to the version being upgraded from. If they match, the Inner::on_runtime_upgrade
method is called and the on-chain version is set to the version being upgraded to. Otherwise, a warning is logged. The code change also includes an example and discusses the decision to keep #[pallet::storage_version]
and use From
and To
instead of just Version
. There are also some TODOs listed.
GenesisBuild<T,I>
deprecated. BuildGenesisConfig
added.Summary
The PR deprecates the BuildGenesis<T,I>
trait and introduces a new non-generic trait called BuildGenesisConfig
. The new trait is implemented for pallet’s and runtime’s GenesisConfig
s and provides a single build
function to put initial values of the genesis config into the storage. The BuildStorage
trait is now responsible for storage building and assimilating. Some pallets were affected by this change and required the addition of _instance
and/or _config: PhantomData<T>
fields. The genesis_build
macro supports both GenesisBuild<T>
and BuildGenesisConfig
. The BuildStorage
trait is implemented by the pallet
macro for each pallet’s GenesisConfig
. The BuildGenesisConfig
is implemented for RuntimeGenesisConfig
by the construct_runtime
macro. Additionally, the unused BuildModuleGenesisStorage
was deprecated and removed from macros.
Index
for Nonce
Summary
This code change renames frame_system::Config::Index
to frame_system::Config::Nonce
. It is a breaking change that requires developers to update the implementation of frame_system::Config
for their Runtime
.
Summary
This PR introduces changes to expose the overarching types for RuntimeEvent
, RuntimeCall
, and RuntimeError
for the V15 metadata. The code that generates RuntimeEvent
is extended to also generate the RuntimeError
enum. The construction of the runtime is changed to ensure that the Error
enum is propagated to the metadata for each pallet that declares one. The construct_runtime
transitioned from an implicit to an explicit state, and a new state explicit expanded
is introduced. The tt_extra_parts
is added to each pallet definition to create a token stream of expanded pallet parts. The PR also includes links to related PRs and issues.
GenesisBuilder
runtime APISummary
This is a proposal for a new Runtime API called GenesisBuilder
that allows for creating and serializing a default GenesisConfig
to JSON, as well as deserializing and storing a GenesisConfig
from a JSON blob. This change is related to issue #13334, a step towards getting rid of the native runtime.
Summary
Extrinsic metadata fields have been enriched to provide users with additional types for decoding extrinsics. This includes the Address
, Call
, Signature
, and Extra
types. The availability of these fields eliminates the need for manual parsing and allows for easier decoding of extrinsics. Additionally, there have been updates to the UncheckedExtrinsic type to handle cases where the runtime may have different or missing types. Subxt testing has also been implemented to ensure that the type IDs match the extrinsic type parameters.
paged-list
Summary
Introduces a pallet called pallet-paged-list
that provides a linked list data structure. The elements are aggregated into pages to reduce memory footprint. The API includes methods for iterating over elements, draining elements, and appending elements. Fuzzer tests are in place to test random sequences of appending and removal of elements.
Summary
This code change involves several modifications:
i64.const
instruction.gas
host function and the restriction on importing a function with this name in the Wasm module of a contract.The fuel syncs involve two separate fuel meters, one for measuring Weight
burn during host function execution and another for measuring Fuel burn during Wasm instruction execution. The i64.const
instruction weight is used for conversion between the two units of measurement.
The migration process involves removing CodeStorage
and renaming OwnerInfo
to CodeInfo
. It also refunds deposits attached to the freed-up storage.
The effects of this change include improved storage usage efficiency and performance, resulting in cost savings for contract authors and users.
Summary
This PR adds the ability to split components of a pallet and includes an example to demonstrate this functionality.
Here are note-worthy Node SDK PRs in Substrate repo merged between 2023-06-23 and 2023-07-25.
SubstrateCli::native_runtime_version
functionSummary
The native runtime will be removed, so the native_runtime_version
function will no longer be needed. Downstream users should remove native_runtime_version
from their implementation of the SubstrateCli
trait.
Summary
This PR adds ignore_onchain_heap_pages
flag to WasmExecutorBuilder
to ignore the on-chain value of heap pages and use the default one.
hash
and date
optionalSummary
The code change makes the hash
and date
optional in certain installations.
Summary
The code change removes the need to pass a generic parameter and instead allows for passing host functions directly.
Summary
This code change improves the reporting of invalid boot nodes by only reporting each boot node once as invalid and only reporting addresses that were added as startup, not addresses learned from other nodes.
Summary
This code change adds support for nested transactions in sp-api
by using execute_in_transaction
. It was previously working but was unintentional. This change brings back the support for nested transactions and includes a test to ensure it does not break.
frame-metadata
behind some featureSummary
This PR put’s frame-metadata
behind a feature flag to allow for building non-FRAME runtimes that require sp-api
without needing to build the FRAME crates.
Summary
This PR removes the execution strategies and prepares for making sp-api
not compile time dependent on the native runtime. It also introduces behavior changes to the runtime API, removes the build_offchain_workers
function, and makes changes to the Grandpa and BABE client crates. Additionally, several CLI args are deprecated.
Summary
The code changes involve updating to new hardware specifications, with a slower CPU but faster disk. The benchmark results show the relative changes in performance for different operations. The disk speed values were rounded down for consistency.