diff --git a/deliveries/pallet-verifier.md b/deliveries/pallet-verifier.md new file mode 100644 index 000000000..13dd090f1 --- /dev/null +++ b/deliveries/pallet-verifier.md @@ -0,0 +1,26 @@ +# Milestone Delivery :mailbox: + +**The delivery is according to the official [milestone delivery guidelines](https://github.com/w3f/Grants-Program/blob/master/docs/Support%20Docs/milestone-deliverables-guidelines.md).** + +* **Application Document:** [Pallet Verifier](https://github.com/w3f/Grants-Program/blob/master/applications/pallet-verifier.md) +* **Milestone Number:** 1 & 2 + +**Context** (optional) + +This is a combined delivery for both milestone 1 and 2. + +**Deliverables** + +| Number | Deliverable | Link | Notes | +|---------|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **0a.** | License | [MIT](https://github.com/davidsemakula/pallet-verifier/blob/master/LICENSE-MIT) or [Apache 2.0](https://github.com/davidsemakula/pallet-verifier/blob/master/LICENSE-APACHE). | Dual-licensed under either of MIT or Apache 2.0 licenses at the downstream user's option. | +| **0b.** | Documentation | [README](https://github.com/davidsemakula/pallet-verifier/blob/master/README.md) and [Architecture](https://github.com/davidsemakula/pallet-verifier/blob/master/ARCHITECTURE.md) documents. | The [README](https://github.com/davidsemakula/pallet-verifier/blob/master/README.md) contains instructions for installation and usage, the [Architecture document](https://github.com/davidsemakula/pallet-verifier/blob/master/ARCHITECTURE.md) describes how `pallet-verifier` works, while the [source code on GitHub](https://github.com/davidsemakula/pallet-verifier) contains extensive inline documentation. | +| **0c.** | Testing and Testing Guide | [Testing guide](https://github.com/davidsemakula/pallet-verifier/blob/master/TESTING.md). | [UI tests](https://rustc-dev-guide.rust-lang.org/tests/ui.html#introduction) are defined in the [tests/ui](https://github.com/davidsemakula/pallet-verifier/tree/master/tests/ui) directory using the [ui_test framework](https://crates.io/crates/ui_test) (also used by [clippy](https://github.com/rust-lang/rust-clippy) and [miri](https://github.com/rust-lang/miri))
Check out the ["Test Structure" section of the Testing Guide](https://github.com/davidsemakula/pallet-verifier/blob/master/TESTING.md#test-structure) for a detailed description of the purpose of the different test cases and test suites.

For milestone 1: All tests in the [tests/ui/driver](https://github.com/davidsemakula/pallet-verifier/tree/master/tests/ui/driver) and [tests/ui/cargo](https://github.com/davidsemakula/pallet-verifier/tree/master/tests/ui/cargo) subdirectories/ test suites except those related to "integer cast overflow" are relevant (i.e. tests with names that *DON'T* include "int-cast-overflow" suffix).

For milestone 2: Only "integer cast overflow" related tests in [tests/ui/driver](https://github.com/davidsemakula/pallet-verifier/tree/master/tests/ui/driver) and [tests/ui/cargo](https://github.com/davidsemakula/pallet-verifier/tree/master/tests/ui/cargo) are relevant (i.e. tests with names that include "int-cast-overflow" suffix).

Test cases in the [tests/ui/sdk](https://github.com/davidsemakula/pallet-verifier/tree/master/tests/ui/sdk) subdirectory/ test suite are production [FRAME](https://docs.substrate.io/learn/runtime-development/#frame) pallet tests, and include FRAME pallets copied directly from the [Polkadot SDK](https://github.com/paritytech/polkadot-sdk), and as such, apply to both milestones and serve to check the effectiveness of the tool on "real world" production FRAME pallets.

Lastly, the [custom benchmark suite](https://github.com/davidsemakula/pallet-verifier/blob/master/TESTING.md#the-custom-benchmark) is defined in the [benches directory](https://github.com/davidsemakula/pallet-verifier/tree/master/benches). Check out the ["custom benchmark" section of the Testing Guide](https://github.com/davidsemakula/pallet-verifier/blob/master/TESTING.md#the-custom-benchmark) for instructions for running the custom benchmark, and a description of how it works. | +| **0d.** | Docker | N/A | | +| **0e.** | Article | [Article](https://davidsemakula.com/blog/introducing-pallet-verifier) | | +| 1. | Rust binary crate | [GitHub repository](https://github.com/davidsemakula/pallet-verifier) | This includes deliveries for both milestone 1 and 2.

For milestone 1: [custom rustc driver](https://github.com/davidsemakula/pallet-verifier/blob/master/src/driver.rs), [custom cargo subcommand](https://github.com/davidsemakula/pallet-verifier/blob/master/src/main.rs), [MIRAI integration](https://github.com/davidsemakula/pallet-verifier/blob/master/src/callbacks/verifier.rs) ([see also](https://github.com/davidsemakula/pallet-verifier/blob/844a49f85f434442202f724c2b5a8aecd0cf9d84/src/driver.rs#L144-L168)) and [automatic tractable entry point generation](https://github.com/davidsemakula/pallet-verifier/blob/master/src/callbacks/entry_points.rs) ([see also](https://github.com/davidsemakula/pallet-verifier/blob/844a49f85f434442202f724c2b5a8aecd0cf9d84/src/driver.rs#L124-L142)).

For milestone 2: [adding the `mirai-annotations` crate as a dependency to FRAME pallets without editing `Cargo.toml`](https://github.com/davidsemakula/pallet-verifier/blob/844a49f85f434442202f724c2b5a8aecd0cf9d84/src/main.rs#L259-L273) (see also [this](https://github.com/davidsemakula/pallet-verifier/blob/844a49f85f434442202f724c2b5a8aecd0cf9d84/src/driver.rs#L196-L254), [this](https://github.com/davidsemakula/pallet-verifier/blob/844a49f85f434442202f724c2b5a8aecd0cf9d84/src/main.rs#L180-L223) and [this](https://github.com/davidsemakula/pallet-verifier/blob/844a49f85f434442202f724c2b5a8aecd0cf9d84/src/cli_utils.rs#L128-L138)), [adding MIRAI annotations to MIR, and more specifically to support automatically adding annotations for verifying that integer `as` conversions don't overflow/underflow nor lose precision](https://github.com/davidsemakula/pallet-verifier/blob/master/src/providers/int_cast_overflow.rs).

Check out the [architecture document](https://github.com/davidsemakula/pallet-verifier/blob/master/ARCHITECTURE.md) for a detailed description of how the various components work and fit together. | + + +**Additional Information** + +Please use the [master branch](https://github.com/davidsemakula/pallet-verifier/tree/master) for testing.