-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pallet-verifier #2234
Add pallet-verifier #2234
Conversation
aa57ea2
to
a042d81
Compare
a042d81
to
19b6b86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for showing interest in the RFP. The proposal has sufficient technical depth, appreciate it. I have a few comments/questions:
-
you rightly mention some of the limitations of MIRAI when generics and macros are used. Whats your approach to tackle this? are you looking at modifying (simplifying) the complexity at the MIR level? could you please elaborate?
-
my personal experience with MIRAI for arithmetic overflows/underflows was that it produced a lot of false positives. This was specifically because "possible incomplete analysis of call because of a nested call to a function without a MIR body". Have you looked into this issue? Static analysers inherently generate false-positives as they over-approximate the program, and in general it is a very hard problem. I would also argue that an FP of 50-60% is still decent (as a developer i would be very happy if i find 1 real bug out of 2-3 warning that pallet-verifier generates). However it gets tricky if its higher. Can you include a small benchmark to quantify the accuracy of the tool?
Hi @bhargavbh, thanks for taking the time to review, I appreciate the feedback 🙂
The short answer is yes, but I actually describe the approach in detail in the "Finding tractable entry points" and "Generating tractable entry points automatically" subsections.
Yes, so in general MIRAI emits a lot of warnings from the standard library and system calls when run at the Something I've noticed is that most false positives only show up at the So I've detailed a hybrid approach in the "Using MIRAI as a library" section, that essentially allows us to access MIRAI's diagnostics buffer directly and decide which diagnostics we want to "suppress" or "promote" based our domain knowledge and the reported primary and related locations for the diagnostic. (the aforementioned section has some more details about this 🙂). But beyond that, another lever at our disposal, specifically for the "function without a MIR body" issue, is to add "summaries/foreign contracts" for these missing "foreign functions" (e.g. standard library functions that aren't inlined and system calls). Having said that, with the approach of bypassing Finally, when it comes to the panic and arithmetic overflow/underflow detection itself, MIRAI seems to be quite accurate at that for simple examples/functions, likely because Rust's type system and relative simplicity of these checks in MIR makes these analyses quite tractable compared to other languages. It's a bit late over here, so I'll think about the methodology for benchmarking the accuracy of the tool and share that tomorrow. |
Thanks @davidsemakula . I like your approach with adding summaries/ post-conditions (contracts) to frequently occurring external calls that are problematic to address the false positive rates. |
Thanks @bhargavbh ... I added the benchmark to the deliverables 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposal has sufficient technical depths. Main challenges and potential approaches to tackle them have been described. A developer productivity tool like this is needed in the ecosystem. Suggested changes have been incorporated. Happy to approve it.
@bhargavbh Awesome! thanks for the swift review/approval and for the positive feedback and recommend improvements 🙂 |
I will share it again with the rest of the team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @bhargavbh based on this and also your previous work @davidsemakula happy to approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Hey @davidsemakula, are you aware that grants are now 30% in DOT? Just asking because you only provided one payment address. In the meantime, could you fill out the KYC form (assuming you are applying as an individual, otherwise please use this form)? |
Hi @semuelle
Yes, I'm aware of the 30% split, but I assumed the same address could be use for both (DOT & USDT), LMK if that's not the case.
I've completed the KYC form (for individuals). Thanks! 🙂 |
Congratulations and welcome to the Web3 Foundation Grants Program! Please refer to our Milestone Delivery repository for instructions on how to submit milestones and invoices, our FAQ for frequently asked questions and the support section of our README for more ways to find answers to your questions. |
Minor update: Should be able to wrap this up in the next 1-2 weeks! |
Hi @davidsemakula I don't believe we ever received any deliveries, are you still planning to deliver these milestones? |
Hi @keeganquigley |
Hi @davidsemakula just checking in. |
Hi @keeganquigley |
Project Abstract
This application is a response to the RFP for Static Analysis for Runtime Pallets.
pallet-verifier is a tool for static analysis of FRAME runtime pallets that are used for building Substrate-based blockchains.
pallet-verifier aims to detect common security vulnerabilities found in FRAME pallets using static program analysis techniques like data-flow analysis, abstract interpretation and symbolic execution.
Grant level
Application Checklist
project_name.md
).@_______:matrix.org
(change the homeserver if you use a different one)