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-05-01 and 2023-06-23.
Summary
This PR fixes the unused error for new_test_ext()
when compiling cargo test
in the kitchensink node by adding a test that uses it.
Summary
The code changes involve deleting two functions after a grace period and adding a removal date of July 2023 to various already deprecated items.
Summary
This code change removes some types from frame::support::inherent
and suggests importing them from their respective origins instead. It is recommended to wait for the frame
crate to give them a smooth transition.
SubmitOrigin
argumentSummary
This code change allows for inspection of the track a submission origin is being made for, and updates all type bounders in Substrate to support the EnsureOriginWithArg
trait as well as the EnsureOrigin
trait. A macro is introduced to allow EnsureOrigin
implementors to support EnsureOriginWithArg
. If using the Referenda pallet and encountering a build error around SubmitOrigin
, wrap the type with frame_support::AsEnsureOriginWithArg
to get an EnsureOriginWithArg
implementation.
type Migrations
to Config
Summary
This PR removes the hardcoded migration sequence from migrations.rs
in the Contracts pallet and places it within Config
so it can be configured in the runtime. Developers need to update their runtime configuration with their pending migrations. This is a breaking change as it adds a new type to the Config
.
Summary
The code changes include enabling serde
features in dependent crates, adding serde::Serialize
and serde::Deserialize
implementation for enum Forcing
in frame::staking
, providing Serialize/Deserialize
implementation for impl_opaque_keys
macro in primitives::runtime
, adding serde::Serialize
and serde::Deserialize
implementation for enum StakerStatus
in primitives::staking
, and implementing serde::Serialize/Deserialize
for pallets GenesisConfig
in no-std
. These changes are a step towards issue #13334 and are also reflected in the Polkadot and Cumulus companions.
Summary
This PR updates the System pallet to allow any kind of origin to call the remark
dispatchable.
Summary
This code change adds a migration that unreserves all deposits made by the tips
pallet. It records the reserves of all accounts with open tips prior to the migration, unreserves all balances locked up in tips, and checks that the reserved balances were reduced by the expected amount.
runtime_version
wasm sectionSummary
This code change enforces the runtime_version
wasm section in the wasm-builder
and provides a way to disable the check if needed. This change aims to prevent issues related to missing RuntimeVersion
in the runtime.
Summary
This code change adds a migration that unreserves all deposits and clears locks held by the democracy pallet. The pre-upgrade collects pre-migration data useful for validating the migration was successful, and also checks the integrity of deposited balances. The on-runtime upgrade unreserves and unlocks the balances. The post-upgrade checks that no more locks exist for the pallet, and reserved balances were reduced by the expected amount.
Summary
The PR adds a deprecation warning for using the runtime level GenesisConfig
, which has been renamed to RuntimeGenesisConfig
. It also includes links to related PRs in Cumulus and Polkadot companions.
Summary
This code change adds a migration that unreserves all deposits and unlocks all stake held by the Elections-phragmen pallet. The migration collects pre-migration data useful for validating the migration was successful, and also checks the integrity of deposited and reserved balances. The on_runtime_upgrade unreserves and unlocks the balances, and post_upgrade checks that all expected locks were removed, and reserved balances were reduced by the expected amount.
Hash
typeSummary
The code change removes the type Hash
from the pallet-merkle-mountain-range::Config
.
dev_mode
for explicit key bindingSummary
The code change allows using a default hasher in dev_mode in case of explicit key binding, which enables a syntax to work in dev_mode but throws an error otherwise.
entropy
function into frame SystemSummary
The code change introduces a stateless function that generates a unique identifier for use in XCM and potentially other areas of the ecosystem.
Summary
This PR updates the LockableCurrency
trait to ensure set_lock
is not a no-op when locking zero funds.
Summary
The code change enables GenesisConfig
compilation in no_std
environment and provides a Default
implementation for GenesisConfig
required for no_std in no-native runtime world.
Summary
The code change ensures that a referendum is only cancelled if the deciding deposit is not paid and the timeout elapses, rather than being cancelled regardless of whether it is queued or not.
Blocked
Account Status to Assets PalletDescription
This PR adds an asset account state of Blocked
when it is Frozen
and unable to receive funds of the asset.
Summary
The PR adds a new pallet that showcases all #[pallet::xxx]
macros and their usage.
Summary
This PR adds a multi-block migration framework for pallet-contracts and fixes an issue. The changes include steps to test migration with try-runtime and zombienet, finding blocks involved in a migration, and steps to make it a generic migration framework. The migration framework currently relies on MigrationInProgress
storage, which needs to be moved to a library or implemented as a new trait. Once implemented, people can configure their Migration type that they pass to Executive.
Summary
This PR updates the staking pallet’s set_controller
and bond
calls to not take the controller
argument, disallowing unique controllers for these functions. It also fixes staking tests, benchmarks, fast-unstake tests, test-staking-e2e tests, and root-offences tests, and tidies up functions.
Summary
The code change allows sequential blocks to be authored within the same slot, which will be useful for backlog of blocks and future roadmap items like elastic scaling and parallel block production. The update guide suggests setting the new AllowMultipleBlocksPerSlot
to false
to maintain current behavior.
Summary
This PR updates the return types of several hooks and introduces a new type called TryRuntimeError
which is an alias to DispatchError
. The hooks should no longer use assert!
and instead return TryRuntimeError
in case of an error. Existing error variants can be used, but if there isn’t one, &'static str
should be used which will be converted to TryRuntimeError
during compile time.
Summary
The code changes will now take into account the proof size while adjusting the fee in the Transaction Payment pallet, which will prevent an attacker from filling the block with storage size without paying an appropriate fee. The PR also considers proof size for calculation of transaction priority. Care needs to be taken to set the max PoV size for a chain to ensure optimal block fullness based on each weight dimension.
Summary
The HoldReason
attribute was recently switched to use the composite_enum
attribute, which requires changes to downstream code. This PR adds RuntimeHoldReason
as type to the Config trait and requires that Currency is uses the same reason. With this update, HoldReason
needs to be removed from pallet_nis::Config
and replaced with RuntimeHoldReason
. For the pallet_balances::Config
trait you need to change HoldIdentifier
to RuntimeHoldReason
and pass the RuntimeHoldReason
that is being generated by construct_runtime!
.
Summary
The code changes implement conformance tests for fungible
traits Inspect
and Mutate
. It includes a pattern for creating a function that accepts something implementing Inspect + Mutate
, implementation of inspect and mutate conformance tests, testing conformance tests against balances
, and creation of a macro to generate test cases wrapped with some logic.
Blocked
StatusSummary
The code changes add new dispatchables for creating and refunding accounts with zero balance in an asset class, represented by a new variant. A new trait is added to allow other pallets to create an account. A new account status of “Blocked” is also added, which prevents both withdrawals and deposits, and can be returned to its unrestricted state via the existing “thaw” function.
decl_*
MacrosSummary
The code changes involve deprecating decl_module
, decl_storage
, decl_error
, and decl_event
and migrating any remaining usage to #[frame_support::pallet]
. There are related issues and pull requests that these changes depend on.
Summary
This PR adds the ability for a pallet to define one or more defaults for its trait Config via #[pallet::config(with_default)]
. Then, when writing impl Config for Runtime
, one of these defaults can be used to elide any missing type item via #[derive_impl(path_to_default_impl)]
. At the moment, this is limited to type items that do not rely on frame_system::Config
. This PR also adds several attribute proc macros to frame_support, most notably #[derive_impl(..)]
and #[register_default_impl(..)]
, which in tandem make it possible to create trait impls that provide sane defaults and dynamically inject the non-colliding trait items from these impls into downstream trait impls that want to use the sane defaults but potentially override some of them.
StorageVersion
Summary
This code change ensures that if a user forgets to set the storage version in a pallet and calls current_storage_version
, it will fail to compile the code. It also checks in post_upgrade
that the pallet storage version was upgraded and no migration was missed. However, this may cause try-runtime
tests to fail, which can be fixed by setting the storage version using a simple migration.
system::set_code
instrisicSummary
The code changes benchmark system::set_code
by timing uncompression and setting the kitchensink runtime to determine an upper bound.
Summary
This PR adds host function calls for elliptic curve arithmetic used by Arkworks to the sp_crypto_ec_utils crate. The host calls are for bls12_381, bls12_377, ed_on_bls12_381, ed_on_bls12_77, bw6_761. The host functions receive their arguments serialized to Vec<u8>
by ark-scale and return the result as serialized Result<Vec<u8>, ()>
, which then needs to be deserialized by ark-scale
. The curves are defined in the https://github.com/paritytech/ark-substrate repo and receive the host functions by dependency injection. Tests are covered by pulling in https://github.com/paritytech/ark-substrate where we instantiate the ark-substrate
curves, which receive the sp-io host function implementations by dependency injection. The PR could be further optimized by adding more curves and replacing more operations by host function calls.
Summary
The changes to Society pallet include the removal of technical limitations on the number of members, proper use of BoundedVec
, and the ability for the founder to alter max members and intake size without a runtime upgrade. Members are ranked and voting weight is determined by rank. The candidate voting process is now a two-phase process, and the voting/reward/punishment scheme for candidates and challenged members is completely different.
Here are note-worthy Node SDK PRs in Substrate repo merged between 2023-05-01 and 2023-06-23.
Summary
The code change exposes the ability to set the Kademlia replication factor through the node’s CLI, which is useful in test environments where the default replication factor of 20 may cause issues with AuthorityDiscovery
.
Summary
The tree route will be calculated against the best block and used to determine if checks should be skipped.
Summary
The code fix corrects the where bound for the create_metadata
function by using the where bound declared at the type declaration augmented with the manual where bound.
sc-peerset
into sc-network
Summary
The code changes involve moving Peerset
, PeerStore
, and ProtocolController
from sc-peerset
to sc-network
& sc-network-common
in preparation for #14170. The B1-note_worthy
label is added because the sc-peerset
crate is retired.
Summary
A new OffchainTransactionPoolFactory
is introduced to create offchain transaction pools that can be registered in the runtime externalities context, which will simplify the creation of offchain transaction pools in a future PR.
Summary
The code changes increase the size of the local cache to 10MiB and give the node cache a bigger max size than the value cache to ensure caching of :code
and prevent it from being thrown out of the cache due to size limitations. Future improvements are planned to prevent certain values, such as :code
, from being removed from the cache at all.
Summary
The change makes it clearer to the user what the system is waiting for, instead of just saying “waiting for peers”.
Summary
The code change exposes database parameters for RevertCmd
via CLI, allowing users to use revert
with ParityDb.
Block history
if doing major syncSummary
This code change fixes an issue where a node would need to do a major sync to sync to the tip of the chain if it was stopped and started while downloading block history, even after warp syncing. The change also updates the sync state displayed by Informant
.
Summary
The code changes add delayed block finalization for instant block sealing consensus, which is needed for local development nodes such as substrate-contract-node and swanky-node. Frontend development requires the ability to configure the delayed time for block finalization after blocks are imported. An integration example for an actual node can be found here.
Summary
This PR removes the wasmi
backend, making the runtime execution exclusively wasmtime
.
Summary
This code change implements a feature for calculating statement count/size limit per account, adding a channel field to allow replacing statements, reintroducing a priority field, and removing time-based statement expiration. Encryption and API for reporting statistics are still left to do in follow-up PRs. There are also links to related PRs for polkadot and cumulus companions.
Summary
The code changes involve removing or renaming several CLI options in Substrate, including --rpc--max--payload
, --ws--max--out-buffer-capacity
, --ws-external
, --unsafe--ws--external
, --ipc--path
, --ws-port
, --ws-max--connections
, --rpc-http
, and --rpc-ws
. These changes are reflected in the Polkadot and Cumulus companions.