Static analysis tool that extracts the worst case execution time of a dispatchable call on a Substrate's FRAME pallet.
This is my part of my master thesis at the DSLAB (EPFL) and ChainSecurity and is WIP.
Set the toolchain:
./scripts/setup.sh
Install the tool for cargo:
cargo install --path .
Run it on a pallet:
cd /path/to/frame/pallet/
touch src/*.rs && cargo saft --release
We make sure that the pallet is recompiled, otherwise we may not have access to the minimal needed MIR.
The tool does not support recursion and loops (for now).
The tool does not have access to all the MIR it wants, since we run it on a pallet, some concrete types that are injected by the Runtime are still generic and monomorphization cannot happen yet. This leads to the need for manual specifications, and thus imprecisions. The tool, in this proof-of-concept state, only supports the following pallets: balances, identity, utility, vesting and multisig. It possibly supports other pallets but the effort has been put on the previous list in particular.
You can add specifications to fill the needs for your pallet in the specifications.rs file.
This is a research project and it is not intended to be used as a product to fully trust.