github moonbeam-foundation/moonbeam runtime-1601
Runtime 1601

latest releases: v0.41.1, v0.41.0, runtime-3300...
2 years ago

Breaking Changes

⚠️ Treasury deposit events

With the better support for Ethereum priority fees, there can be 2 treasury.Deposit substrate event per transaction (one corresponding to 20% of the gas used, and one corresponding to 20% of the priority fees being consumed)

⚠️ [Staking] Delegator leaving workflow is changing

Scheduling and executing delegator leave will soon be deprecated and are now simply performing a batch of schedule/execute revoke on the delegator's delegations.
This implies the following changes:

Obsolete DelegatorStatus::Leaving status

Before:

await api.tx.parachainStaking.schedule_leave_delegators("alith");
(await api.query.parachainStaking.delegatorState("alith")).status == "Leaving";

After ("Leaving" is no more an option)

await api.tx.parachainStaking.schedule_leave_delegators("alith");
(await api.query.parachainStaking.delegatorState("alith")).status == "Active";

Alith will have a revoke request in each of her delegations:

await api.query.parachainStaking.delegationScheduledRequests("charleth");
[...{delegator: "alith", when_executable: 2, action: { revoke: 100 } }]

await api.query.parachainStaking.delegationScheduledRequests("dorothy");
[...{delegator: "alith", when_executable: 2, action: { revoke: 25 } }]

cancel_leave_delegators will not be executable if a single Revoke has been manually cancelled.

Before

await api.tx.parachainStaking.schedule_leave_delegators("alith");               // status: Leaving
await api.tx.parachainStaking.cancel_delegation_request("charleth", "alith");   // cancels the scheduled Revoke request
await api.tx.parachainStaking.cancel_leave_delegators("alith");                 // status: Leaving
// OK

After

await api.tx.parachainStaking.schedule_leave_delegators("alith");               // status: Active, Revoke scheduled on all delegations
await api.tx.parachainStaking.cancel_delegation_request("charleth", "alith");   // cancels the scheduled Revoke request
await api.tx.parachainStaking.cancel_leave_delegators("alith");                 // status: Active
// ERR! DelegatorNotLeaving

Also cancel_leave_delegators now executes if all delegations have a scheduled Revoke (previously if status: Leaving).

execute_leave_delegators will not be executable if a single Revoke has been manually cancelled.

Before

await api.tx.parachainStaking.schedule_leave_delegators("alith");               // status: Leaving
await api.tx.parachainStaking.cancel_delegation_request("charleth", "alith");   // cancels the scheduled Revoke request
await api.tx.parachainStaking.execute_leave_delegators("alith");                // OK

After

await api.tx.parachainStaking.schedule_leave_delegators("alith");               // status: Active, Revoke scheduled on all delegations
await api.tx.parachainStaking.cancel_delegation_request("charleth", "alith");   // cancels the scheduled Revoke request
await api.tx.parachainStaking.execute_leave_delegators("alith");                // ERR! DelegatorNotLeaving

Also, execute_leave_delegators now executes if all delegations have a scheduled Revoke (previously if status: Leaving).

Delegator now allowed to delegate even if all delegations have a pending Revoke.

Before

await api.tx.parachainStaking.schedule_leave_delegators("alith");               // status: Leaving
await api.tx.parachainStaking.delegate("charleth", "alith");                    // ERR! CannotDelegateIfLeaving

After

await api.tx.parachainStaking.schedule_leave_delegators("alith");               // status: Active, Revoke scheduled on all delegations
await api.tx.parachainStaking.delegate("charleth", "alith");                    // OK

Delegator may now not schedule Decrease and Revoke requests while the existing Revoke is pending.

Before

await api.tx.parachainStaking.schedule_leave_delegators("alith");                 // status: Leaving
await api.tx.parachainStaking.schedule_delegator_bond_less("charleth", "alith");  // OK

After

await api.tx.parachainStaking.schedule_leave_delegators("alith");                 // status: Active, Revoke scheduled on all delegations
await api.tx.parachainStaking.schedule_delegator_bond_less("charleth", "alith");  // ERR! PendingDelegationRequestAlreadyExists

⚠️ [AuthorMapping] Introducing better key management

In order to support the new key that will be needed for the Randomness Pallet (Runtime 1700), the AuthorMapping pallet has been refactored to introduce additional keys.

addAssociation, updateAssociation and clearAssociation DEPRECATED

Those 3 extrinsics (and their equivalent Ethereum Precompile functions) are now deprecated. They are replaced by setKeys and removeKeys which are described later.
Those extrinsics are still compatible with the new keys set and will copy the nimbus key as the rand key so you will be able to use the randomness pallet even when using those extrinsics.

New set of keys

It will soon be required to set 2 keys for producing blocks, 1 for Nimbus (producing blocks) and 1 for Rand (producing Randomness). More information of the Rand key will come with the next runtime when the Randomness Pallet gets added.

It is currently possible to set those 2 keys manually through the moonbeam key insert command, or by rotating your keys:

> curl -H 'Content-type: application/json' -d '{"jsonrpc":"2.0","id":3,"method":"author_rotateKeys","params":[]}' http://localhost:9933

{"jsonrpc":"2.0","result":"0xf89303fb7d3a99324ad23db64ec8e64e003053222fd2eb417b28a7253df49e29b05a42189e2818bed19c3f7de6e8860894edd3d732f3fae50598a8e813dd6271","id":3}

The result of the key rotation is the size of 2 keys. The nimbus and rand key gets concatenated so you can pass them directly to authorMapping.setKeys

new authorMapping.setKeys

You can now submit the extrinsic authorMapping.setKeys (or the set_keys method from the author mapping precompile) providing the concatenated public keys for your nimbus and rand keys. As descrived before, it is the same format as the one returned by the author_rotateKeys RPC call.

Ex:

const keys = [
  "0x1111111111111111111111111111111111111111111111111111111111111111", // Nimbus
  "0x2222222222222222222222222222222222222222222222222222222222222222", // Rand
];
const concatenatedKeys = `0x${keys.map((key) => key.slice(2)).join("")}`;
await api.tx.authorMapping.setKeys(concatenatedKeys).signAndSend(alith);

It is also used to replace your existing keys

new authorMapping.removeKeys

This extrinsic authorMapping.removeKeys can be used to remove the mapping between your account and your keys.

Ex:

await polkadotApi.tx.authorMapping.removeKeys().signAndSend(alith);

authorMapping.registerKeys is now REMOVED

This is being replaced directly by authorMapping.setKeys

Changes event names to ensure consistent naming

AuthorRegistered -> KeysRegistered
AuthorRotated -> KeysRotated
AuthorDeregistered -> KeysRemoved

Limit of 1 set of keys per Account

It is not possible anymore to have multiple set of keys per account.

⚠️ The migration will take the first NimbusId owned by a given AccountId to insert into NimbusLookup: AccountId => Option. For any additional NimbusId owned by that AccountId, the migration clears the association and returns (unreserves) the deposit.

XCM

  • XcmTransactor->set_transact_info now accepts an additional optional value called transact_extra_weight_signed
  • TransactInfoWithWeightLimit storage item now does not return fee_per_second, as this value exists in a distinct storage item called DestinationAssetFeePerSecond. Precompiles that were accessing this storage item have been adapted so that the change is non-breaking, by reading from both storage item

Runtimes

Moonbase

✨ spec_version                : 1601
🏋 size                        : 1266239
#️⃣ sha256                      : 0x8e62abf4918df56773df2a3ca2d8649ea671c25469ea18726d96375ef859ff19
#️⃣ blake2-256                  : 0xff6caebdd4e7306c5b2f2f02ffbdb6ef5e22af403ddda77eacb66f853270ecb0
🗳️ proposal (authorizeUpgrade) : 0x901cc99b6f70109d7e322ea5f0e4f155f151439e9f353887bb6afee64b59b08b

Moonriver

✨ spec_version                : 1601
🏋 size                        : 1253944
#️⃣ sha256                      : 0xf54f8e0563bc11ce3b14e503c6381c71f7b99db52c3603d931ee031b3344b15a
#️⃣ blake2-256                  : 0xe5fc55a640d6b855b1953a0b2095a289840a8cfea1e270b644dfd2e9f01cc2f6
🗳️ proposal (authorizeUpgrade) : 0xf11f6feaed274d5ded52f921b4f25abc3ea123404e486736328499b9a8d6e9c4

Moonbeam

✨ spec_version                : 1601
🏋 size                        : 1254040
#️⃣ sha256                      : 0x0eee029d8d6429b6ea14c6ae5641577a747d83ac4e3e7b919cfb02589093cda9
#️⃣ blake2-256                  : 0xd099fc84c9bb333e4f34e3a07b148e360c22189bfe65c7a8ec7ac56e66546d65
🗳️ proposal (authorizeUpgrade) : 0xe468e0cecf773aed798c310467d3aa0f9e51c5c820b5b38125c0095d5e0be08a

Build information

WASM runtime built using rustc 1.57.0 (f1edd0429 2021-11-29)

Changes

  • Bump runtime to 1600 (#1447)
  • EIP2612: fix timestamp units (#1451)
  • Update to frontier v0.9.18 (#1464)
  • Remove scheduled delegation requests when either collator or delegator are leaving (#1463)
  • Enable local tokens (#GLMR and local assets) transactors in moonbeam (#1472)
  • Update delegate new error message (#1258)
  • Substrate/Polkadot/Cumulus v0.9.19 Dependency Update (#1438)
  • More standard EIP712 name for XC20 assets (#1488)
  • Add VRF key to session keys type (#1480)
  • Skip minting rewards event if amount is 0 (#1512)
  • Switch to exhaustive selector match in staking precompiles (#1521)
  • Build runtimes without feature on-chain-release-build (#1513)
  • Fix local asset id by encoding just once (#1523)
  • Use rounded up computation when calculating fee (#1511)
  • Fix Orbiter bug when adding an orbiter just after removing another (#1527)
  • Make author_mapping::set_keys take 1 input (#1525)
  • Substrate/Polkadot/Cumulus v0.9.20 dependency update (#1489)
  • Introduce exponential length fee for substrate-based fees (#1496)
  • Fix bug where block collator received priority fees fix (#1528)
  • Enable Orbiters for all runtimes (#1530)
  • Fix rewards being distributed for leaving delegators (#1515)
  • Add PrecompileHandle trait (subcall support) + precompile testing utils (#1487)
  • Add Batch precompile (#1498)
  • Enable signed transact message in XCM transactor (#1449)
  • Cleanup 1500 migrations (#1532)
  • Fix author mapping set_keys to take input Vec (#1535)
  • Prevent bond_more when revoke is pending (#1545)
  • Reduced minimum staking delegation in Moonbase to 1 DEV (#1547)
  • Prevent DELEGATECALL on custom EVM Precompiles (#1551)

Dependency changes

Moonbeam: runtime-1504...runtime-1601
Substrate: PureStake/substrate@fc3fd07...paritytech:563f4820
Polkadot: PureStake/polkadot@f0dc95a...paritytech:568169b4
Cumulus: PureStake/cumulus@76cf464...paritytech:4bbedb30
Frontier: PureStake/frontier@3d58fed...652abf1

Don't miss a new moonbeam release

NewReleases is sending notifications on new releases.