Substrate Monthly Substrate Technical Newsletter — August Issue

OneBlock+
OneBlock Community
Published in
8 min readSep 2, 2024

This monthly newsletter is authored by Substrate Evangelist 时光

Hi, to all developers interested in Substrate technology:

Substrate Monthly — Ecosystem Technical Newsletter, produced by OneBlock+, summarizes technical progress of the Substrate framework and updates activities in the Polkadot ecosystem each month to get the community updated. Subjects include critical technical submissions, modifications and releases, design discussions, references, technical community updates and so on.

The following is the August issue. Enjoy~

Important Submissions and Releases

  1. Polkadot Stable Version 2407 Released
  2. Restoration of Damaged Staking Ledgers in Polkadot and Kusama This PR adds a migration in the Polkadot and Kusama runtimes to restore currently damaged ledgers in Polkadot and Kusama. The migration includes invoking pallet_staking::Pallet::<T>::restore_ledger for each “whitelisted” storage as Root origin. Checks are conducted to ensure that the staking in the restored ledger does not overflow the currently available balance in storage. If this occurs, the ledger is forcefully unstaked. This check is currently missing in the polkadot-sdk/pallet-staking. Alternatively, a temporary pallet can be added to the Fellowship runtime to repair the damaged staking ledger, displaying an external component to restore it and perform additional checks. Refer to this PR as an example.
  3. Elastic Scaling MVP Released This MVP version allows parachains to utilize up to three cores per relay chain block, achieving 3x throughput and 2-second block times.
  4. Addition of Polkadot Coretime Chain-spec The Polkadot Coretime chain specification has been added to the directory along with other system chain specifications. This was the chain specification used at genesis, and genesis head data was generated for it. It is also included in the Fellowship release v1.3.0 assets.
  5. Initial Version of pallet_revive Added This is a heavily modified and streamlined version of pallet_contracts. The most notable change is that it uses PolkaVM instead of Wasmi for contract execution. However, it also includes many other changes that make cross-compilation to YUL easier. For example, it will use AccountID20 instead of the native runtime address type, including all necessary mappings to AccountID32 to support AssetHub. Types like block numbers and balances will also be fixed to uint256. Chain extensions will be replaced by the ability to declare custom precompiles, similar to what is done on pallet_evm.
  6. Addition of pallet_proxy to People Chain and Coretime Chain Testnet Runtime Kusama and Polkadot can use proxies, but this feature was previously unavailable on testnets. Now, coretime-rococo can use proxies on coretime-westend, and people-rococo can use proxies on people-westend, similar to Kusama and Polkadot.
  7. Elastic Scaling: Added Queue Offset Declaration to Cumulus This PR implements part of Elastic Scaling without requiring new primitives, allowing it to be merged. It introduces new candidate receipt primitives. Remaining items to implement:

。Add UMP signal selection to the parachain system module.

。Utilize the new UMP signal commitment when submitting collation.

See the RFC for more background information: polkadot-fellows/RFCs#103.

8. Metadata V16 Update (Unstable): Enrich MetadataConfig with Associated Type Traits

  • This feature is part of the upcoming Metadata V16. Traits requiring TypeInfo or bound traits include associated types as Parameter in the pallet's metadata. Metadata is not yet exposed to end users, but the metadata intermediate representation (IR) includes these types.
  • Developers can opt out of associated type metadata collection by specifying the optional attribute #[pallet::config].
  • Additionally, the without_metadata parameter can be combined with the newly added attribute #[pallet::include_metadata] to selectively include certain associated types in the metadata collection.

9. Support for Asset Registration on Asset Hub via Bridge Allows an Asset Hub on one side to register assets on another Asset Hub via a bridge. The Rococo <> Ethereum test bridge will be deprecated and replaced by the Westend <> Ethereum test bridge. This PR also updates simulation tests to simulate the double-bridging between Ethereum <> Westend <> Rococo.

10. Addition of zombienet-sdk Testing to Parachain-template New CI mechanics were added to smoke-test parachain-template-node using zombienet-sdk.

11. [Backport] Added Feature to Allow Aura Collector to Use Full PoV Size This PR introduces a feature allowing selective use of the full PoV size.

12. [FRAME] Storage Generator Trait Cleanup This approach involves porting all methods defined in individual generator traits to their respective types in storage::types, and implementing storage::{StorageValue, StorageMap, StorageNMap, StorageDoubleMap}.

Design Proposals and Issue Discussions

  1. Elastic Scaling: Streamlined Block Production To achieve maximum throughput in Elastic Scaling, we need to streamline block production. Otherwise, optimal throughput can only be achieved by setting collators to size 1, which affects liveness and decentralization. The proposed solution:
  • During block production, the block author will stream all transaction hashes that it places into the block. Streaming is necessary because it’s not known in advance how many transactions can be accommodated.
  • Other nodes check if the relevant transactions are in their mempool. If not, they wait for them to arrive.
  • Build the block based on the incoming hash stream. It now learns about the new state simultaneously with the original author, introducing almost no additional latency.
  • Receive the block announcement from the block author and compare the state root with the one they arrived at. If it matches, they have everything they need.
  • If any of the above fails, simply fall back to normal block import and download the block as usual.

This successfully doubled throughput and reduced bandwidth requirements.

2. Increase max_pov_size to 10MB

Currently, the maximum PoV size on the Polkadot/Kusama relay chain is 5MB. Recent benchmarking has shown that the storage proof overhead increases significantly with the number of keys in storage. For example, when there are 1 million accounts, parachain throughput drops by 50%. Based on the data, the maximum PoV size should be doubled, and in the worst case, it will still only require 50% of the hardware specification bandwidth. The expected CPU cost of erasure encoding/decoding in the worst case will increase by 100%, which should be determined using subsystem benchmarks and seeing how it fits into the upcoming new hardware specifications.

Documentation and Resources

  1. Dedot Usage Documentation

Interacting with ink! smart contracts using Polkadot.js has always been challenging, but thanks to Dedot’s type-safe API (latest version:), interacting with ink! smart contracts is now easier and more developer-friendly than ever. With Dedot, developers can use the native TypeScript type system exclusively without dealing with wrapped codec types.

  1. Elastic Scaling MVP Guide

Elastic Scaling is a feature that allows parachains to seamlessly increase/decrease the number of cores they use. This may be desirable to increase the computational or storage throughput of a parachain or reduce the latency between transaction submission and inclusion in a parachain block. Currently, with asynchronous backing enabled, a parachain can only include one block on the relay chain every 6 seconds, regardless of how many cores the parachain receives. Elastic Scaling further enhances the 10x throughput increase from asynchronous backing by allowing collators to submit up to three parachain blocks per relay chain block, further tripling throughput.

The full implementation of Elastic Scaling covers the entire relay/parachain stack and is still ongoing. The MVP is still considered experimental software, so stability is not guaranteed.

Technical Ecosystem and Community

  1. Gathering Top Minds to Explore Ecosystem Frontiers: Polkadot Decoded Asia 2024 in Singapore is About to Kick Off

The Polkadot Decoded Asia 2024 conference will be grandly held in Singapore from September 16–17, as an important part of TOKEN2049 Week. It will deeply focus on the cutting edge of Polkadot ecosystem development, with over 100 guest speakers and 2,000+ peers attending the conference to share their insights into the potential trends in the Polkadot. Polkadot founder Gavin Wood will also be present to deliver his first public speech in Asia after two years, announcing important developments for Polkadot’s future. Attending developers should stay tuned! Note: Oneblock+ community users, please choose the Ecosystem Pass to get a free ticket!

。Event website: https://www.metaera.hk/polkadot2024

。Register now: https://lu.ma/hszom0hw

2. Web3 Summit in Berlin Concludes Successfully! Gavin Wood Proposes Three Different DIMs

From August 19–21, the Web3 Summit brought a three-day series of talks and hackathons! Gavin Wood proposed three different “Digital Identity Mechanisms” (DIMs) at the conference, aiming to return control of digital identities to users, ensuring the security, privacy, and unity of identity.

。DIM1: Proof-of-Ink: This is a personalized design or statement uniquely linked to your identity, similar to an immutable digital mark, verified by the community to ensure its authenticity.

。DIM2 and DIM3: These mechanisms offer different functions and incentives, with specific details to be announced later.

3. Polkadot Hackathon: Singapore Registration Closed, Bangkok Registration Still Open

OneBlock+ Community will host the 2024 Polkadot Hackathon from July 11 — November 14, 2024, with two locations (Singapore and Bangkok), offering a total prize pool of over $630,000! The code submission deadline for the Polkadot Hackathon Singapore is closed, and the Bangkok code submission deadline is October 16 at 12:00 PM (UTC+8). The four main track themes, prize pool, incentives, and schedule have been announced.

4. Global Leaders Gather in Brussels: Polkadot Decoded 2024 Concludes Successfully As the flagship event of the Polkadot ecosystem, Polkadot Decoded 2024 was held in Brussels in July. The event brought together developers, investors, enthusiasts, and industry leaders from around the world to explore the latest innovations in blockchain technology.

5. New Pallet Launch! The 8th Substrate Advanced Development Course Officially Starts! OneBlock+ launched the “Substrate Advanced Development and Project Practice” course, taught by Polkadot community developer Sun Kaichao, senior Polkadot developer Zhou Jun, and senior smart contract developer Wang Dazui! The course helps you navigate the complexities and provides a clear path for development learning!

🚀🚀 The 8th Substrate Advanced Development Course, free admission, limited to 100 people!

Registration link: https://wj.qq.com/s2/14825200/0zv4

6. First VaraDevGuide Concludes Successfully: Building DApp from Scratch

The first phase of the “Vara Introductory Practical Guide: Building DApp from 0 to 1,” jointly launched by OneBlock+ and Vara Network, has officially concluded. The course recruited nearly 400 participants, with a total view count of over 12,800+, helping learners lay a solid foundation in the blockchain field and enhance their practical skills.

Cross-chain Protocols

  1. [XCMv5] Improved Fee Mechanism

The idea is to extend the current XCM fee mechanism to support delivery fees in principle but may also support other types of fees. This is achieved by adding two features:

PayFees: An operation that designates a fee registry where fees are deposited and retained until the execution ends. Crucially, it is separate from the holding register.

2. Addition of SetAssetClaimer Instruction Use CamelCase for structure names and snake_case for variables/members. Check out https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md and https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/STYLE_GUIDE.md for more contributor information. Tip: Cargo can handle most of the style formatting for you. Just run cargo fmt -p <crate-name> or cargo fmt --all. In our case, you should use the nightly version to format some of the advanced linters we use: cargo +nightly fmt -p <crate-name>.

About OneBlock+

OneBlock+ is the first and the largest blockchain developer community in China. At OneBlock+, we provide full support for developers with their substrate studies and further set off their career paths. We host Polkadot Hackathons every season to attract top-notch developers to build and innovate for the prosperity of the ecosystem. As a greater China technology resource integrator, OneBlock+ also partners with developers, communities, business elites, and key media who have business insights and experiences in the blockchain industry to provide educational events, such as technical courses, webinars, AMAs, and offline events for the industry. Want to shape the crypto world together? Come and join us today!

Twitter / Telegram / Discord / YouTube

--

--

OneBlock+
OneBlock Community

Cultivate substrate developer community and redefine the future of open web ecosystem together.