runtimeverification / polkadot-verification

Verification of Polkadot WASM code
Other
9 stars 6 forks source link

Meeting Notes #19

Open ehildenb opened 4 years ago

ehildenb commented 4 years ago

Unfortunately I didn't think to keep meeting notes from the previous meetings, but I'll do so here for upcoming meetings.

ehildenb commented 4 years ago

Thursday September 5, 2019

Done

Discussion

ToDo

ehildenb commented 4 years ago

Monday September 9, 2019

Discussion

ehildenb commented 4 years ago

Thursday September 12, 2019

Done

Discussion

ToDo

ehildenb commented 4 years ago

Monday September 16, 2019

Discussion

ehildenb commented 4 years ago

Thursday September 19, 2019

Done

Discussion

ehildenb commented 4 years ago

Monday September 23, 2019

Discussion

ehildenb commented 4 years ago

Thursday September 26, 2019

Done

Discussion

ehildenb commented 4 years ago

Monday September 30, 2019

ehildenb commented 4 years ago

Thursday September 03, 2019

Done

Discussion

ehildenb commented 4 years ago

Monday October 07, 2019

ehildenb commented 4 years ago

Thursday October 10, 2019

Might be done

Done

ehildenb commented 4 years ago

Tuesday October 22, 2019

Discussion

ehildenb commented 4 years ago

Thursday October 24, 2019

Discussion

ehildenb commented 4 years ago

Tuesday October 29, 2019

Discussion

ehildenb commented 4 years ago

Thursday October 31, 2019

Done

Discussion

### `set_balance` 
    syntax Bool ::= ensureRoot ( AccountId ) [function] 
 // --------------------------------------------------- 
    rule    ensureRoot(_)      => false                                            [owise] 
    rule [[ ensureRoot(ACCTID) => true  ]] <adminAccounts> ADMINS </adminAccounts> requires ACCTID in ADMINS 

    syntax Action ::= "set_balance" "(" AccountId "," AccountId "," Int "," Int ")" 
 // ------------------------------------------------------------------------------- 
    rule <k> set_balance(ORIGIN, WHO, FREE_BALANCE', RESERVED_BALANCE') 
          => imbalance_event(FREE_BALANCE, FREE_BALANCE') 
          ~> set_free_balance(WHO, FREE_BALANCE') 
          ~> imbalance_event(RESERVED_BALANCE, RESERVED_BALANCE') 
          ~> set_reserved_balance(WHO, RESERVED_BALANCE') 
         ... 
         </k> 
         <account> 
           <accountID> WHO </accountID> 
           <balance> FREE_BALANCE | RESERVED_BALANCE </balance> 
           ... 
         </account> 
      requires ensureRoot(ORIGIN) 

    rule <k> R:Result => . ... </k> 

    syntax Event ::= PositiveImbalance ( Int ) | NegativeImbalance ( Int ) 
 // ---------------------------------------------------------------------- 

    syntax Action ::= imbalance_event ( Int , Int ) 
 // ----------------------------------------------- 
    rule <k> imbalance_event(ORIG, NEW) => . ... </k> 
      requires NEW ==Int ORIG 

    rule <k> imbalance_event(ORIG, NEW) => . ... </k> 
         <events> ... (.List => PositiveImbalance(NEW -Int ORIG)) </events> 
      requires NEW >Int ORIG 

    rule <k> imbalance_event(ORIG, NEW) => . ... </k> 
         <events> ... (.List => NegativeImbalance(NEW -Int ORIG)) </events> 
      requires NEW <Int ORIG 

Rule merging, concetually

Looks something like this.

If we have the initial program: (i32.const 1) ~> (i32.const 2) ~> (i32.add) and the Wasm semantics contain the following rules

1: <k> (ITYPE.const X) => <ITYPE> X ... </k>
2: <k> <ITYPE> VAL => . ... </k>
   <valstack> ST => <ITYPE> VAL : ST </valstack>
3: <k> (ITYPE.add) => <ITYPE> #trunc(ITYPE, X + Y) </k>
   <valstack> <ITYPE> X: <ITYPE> Y : ST => ST </valstack>

then the rules will be applied in this order: 1 2 1 2 3 2

The rule merger takes pairs of rules and merges them into a single step. So rule 1 and 2 would merge to

1_2_merged: <k> (ITYPE.const X) => . ... </k>
                          <valstack> ST => <ITYPE> X : ST </valstack>

And the entire sequence would merge to

1_2_1_2_3_merged: <k> (ITYPE.const X) ~> (ITYPE.const Y) ~> (ITYPE.add) => . ... </k>
                                  <valstack> ST => <ITYPE> #trunc(ITYPE, X + Y) : ST </valstack>

In the end we end up with one or more descriptions of the entire execution along one path in the Wasm code. These descriptions then become a full generated specification of the program (in our case the program is set_balance). We then prove an inclusion between the hand-written specification and our generated specifications.

ehildenb commented 4 years ago

Tuesday November 06, 2019

ehildenb commented 4 years ago

Thursday November 07, 2019

Discussion

ehildenb commented 4 years ago

Tuesday November 19, 2019

Done

Discussion

ehildenb commented 4 years ago

December 05, 2019

ehildenb commented 4 years ago

December 12, 2019

Pending Review

In Progress

Status Update

https://github.com/runtimeverification/polkadot-verification/issues/20#issuecomment-565129659

ehildenb commented 4 years ago

Thursday December 19, 2019

ehildenb commented 4 years ago

Thursday January 9, 2020

ehildenb commented 4 years ago

Thursday January 16, 2020

ehildenb commented 4 years ago

Thursday January 23, 2020

ehildenb commented 4 years ago

Thursday February 6, 2020

ehildenb commented 4 years ago

Thursday March 19, 2020

ehildenb commented 4 years ago

Thursday April 2, 2020

ehildenb commented 4 years ago

Thursday April 16, 2020

ehildenb commented 4 years ago

Thursday April 23, 2020

hjorthjort commented 4 years ago

Thursday May 07, 2020

hjorthjort commented 4 years ago

Thursday May 14, 2020

ehildenb commented 4 years ago

Thursday May 21, 2020

ehildenb commented 4 years ago

Thursday May 28, 2020

ehildenb commented 4 years ago

Thursday June 5, 2020

ehildenb commented 4 years ago

Thursday June 11, 2020

ehildenb commented 4 years ago

Thursday June 18, 2020

hjorthjort commented 4 years ago

Thursday June 25, 2020

hjorthjort commented 4 years ago

Thursday July 2, 2020

hjorthjort commented 4 years ago

Thursday July 9, 2020

hjorthjort commented 3 years ago

Thursday July 16, 2020

Milestone 3 Generate the Wasm execution specifications of the bytecode: ● a. Generate execution traces of the Wasm code using the LLVM backend and a fuzzing frontend. This will produce sequences of rules in the order that they are executed, called BALANCES-MODULE-TRACE_i (subscripted by _i for the fact that there are many traces). ● B. Do common subsequence analysis on the BALANCES-MODULE-TRACE_i to find common subsequences of rules, and ask the Haskell backend to merge those rules together into rules which take larger steps. Several heuristics for rule merging will be provided, which select different subsequences to do merging with, and we can see which ones perform best. ● Compile the generated merged rules into the semantics with higher priority than the original rules, so that they can be used for both symbolic and concrete execution.

hjorthjort commented 3 years ago

Thursday 22 July, 2020

hjorthjort commented 3 years ago

Thursday 30 July, 2020

hjorthjort commented 3 years ago

Thursday 20 August, 2020

hjorthjort commented 3 years ago

Thursday 27 August, 2020

hjorthjort commented 3 years ago

Internal meeting about project directions

Performance measurement of grant 1

Add performance measurement code to see the performance impact of merged rules.

Future directions

ehildenb commented 3 years ago

Thursday September 3, 2020

hjorthjort commented 3 years ago

Thursday September 10, 2020

Necessary

hjorthjort commented 3 years ago

Thursday September 17, 2020

hjorthjort commented 3 years ago

Thursday December 10, 2020