Skip to content

Project Roadmap #42

Open
Open
@ehildenb

Description

@ehildenb

W3F Grants Program: Functional correctness verification of core Substrate modules for Polkadot

Introduction

The W3F is looking for auditors of the PR (Polkadot Runtime), focusing on the subset of Substrate modules used to implement Polkadot: https://medium.com/polkadot-network/apply-to-audit-polkadots-runtime-86c988ced31b.

This includes modules from the Substrate Runtime Module Library (SRML) and some Polkadot specific modules.
The modules are written in Rust, and are compiled to Wasm.
Of particular interest are authorization/code-execution attacks and denial-of-service attacks on the modules themselves (and thus on Substrate and potentially the network).

An audit at the Rust level will focus on high-level security properties of the code, but will not catch any build-time errors introduced or low-level functional correctness bugs. We propose formally verifying the generated Wasm code to guard against these bugs and to provide the security auditors with a complete specification of the behaviors of the generated Wasm. The verification artifacts (K specifications) can be integrated directly into Polkadot’s CI system so that on changes to behavior action must be taken to either fix the code or update the specification.

Deliverables:

  • K specifications of one core Substrate runtime module for Polkadot which is <100 lines of Rust.
  • Integration of the K specifications into the Polkadot CI system.
  • Transfer of knowledge on how to maintain and write K specifications to Polkadot developers.

Milestones:

  1. Meet with Polkadot devs to learn about the core Polkadot modules and select one module which (i) is important from a security standpoint due to widespread use, (ii) is largely frozen in its intended behavior, and (iii) is ideally <100 lines of Rust source code. Agree on the behaviors that need to be specified (as semi-formal English spec).
  2. Develop the K specification of the selected runtime module, weekly meetings (or more frequently) with Polkadot devs to keep them updated and have them learn how to maintain and write K specifications. Produce documentation describing the specification, including the high-level English specification and arguments that the K specification is a refinement of the English specification.
  3. Integrate the developed specifications into the Polkadot CI system. Note that we will setup the CI integration, then we will discuss with the Polkadot devs how it should be enabled. It may be prudent to minimize maintenance overhead by updating the specification less frequently than every PR (instead updating it on a larger release cycle).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions