Skip to content

Conflicting cheat code use (withdraw_excess_lamports) #29

@jberthold

Description

@jberthold

The proof test_process_withdraw_excess_lamports showed an unexpected cheat code projection.
The proof gets stuck with the following K cell:

<k>
  #traverseProjection (
    toStack ( 2 , local ( 2 ) ) ,
    Aggregate ( variantIdx ( 0 ) , ListItem (Integer ( ARG_UINT1:Int , 8 , false ))
      ListItem (Integer ( ARG_UINT2:Int , 8 , false ))
      ListItem (Integer ( ARG_UINT3:Int , 8 , false ))
      ListItem (Integer ( ARG_UINT4:Int , 8 , false ))
... (this is input data representing an `AccountInfo` struct)
      ListItem (Integer ( ARG_UINT70:Int , 64 , false ))
      ListItem (Integer ( 165 , 64 , false ))
    ) , 
    PAccountIMint  .ProjectionElems ,
    CtxPAccountPAcc ( IAcc ( ...) ) )  .Contexts )
  ~> #derefTruncate ( noMetadata , projectionElemField ( fieldIdx ( 3 ) , ty ( 600077 ) )  .ProjectionElems )
  • The #derefTruncate shows there was a Deref projection before
  • Context CtxPAccountPAcc( IAcc(...)) shows we are accessing the Account structure of a PAccountAccount set up by cheatcode_is_account
  • the remaining projection (in #derefTruncate wants to read field 3 (the integer with ARG_UINT3)

What is wrong is the PAccountIMint projection. This projection is out of place here for two reasons

  1. There was no Mint set up, it must have been an interface account (IAcc in context)
  2. We already projected to the Account so we cannot project to a second component any more.

After fixing the DELEGATE key branching issue, proof test_process_burn showed the same problem:
After running the whole proof,

the proof tree shows a number of stuck nodes.

┌─ 1  🌳 ROOT      ((root, init))       │ line     2
├─ 3     NORMAL                        │ line   719
├─ 4  🔀 SPLIT     ((split))            │ line  6542
┃  ├─ 5     NORMAL                        │ line 11849
┃  ├─ 7     NORMAL                        │ line 17153
┃  ├─ 9     NORMAL                        │ line 22991
┃  ├─ 10    NORMAL                        │ line 28830
┃  ├─ 11 🔀 SPLIT     ((split))            │ line 34153
┃  ┃  ├─ 12    NORMAL                        │ line 39531
┃  ┃  ├─ 14    NORMAL                        │ line 44906
┃  ┃  ├─ 16 🔀 SPLIT     ((split))            │ line 50810
┃  ┃  ┃  ├─ 18    NORMAL                        │ line 56189
┃  ┃  ┃  ├─ 22    NORMAL                        │ line 61565
┃  ┃  ┃  ├─ 26 🔀 SPLIT     ((split))            │ line 67050
┃  ┃  ┃  ┃  ├─ 30    NORMAL                        │ line 72429
┃  ┃  ┃  ┃  ├─ 38    NORMAL                        │ line 77805
┃  ┃  ┃  ┃  └─ 46 ❌ STUCK     ((stuck, leaf))      │ line 83199
┃  ┃  ┃     ├─ 31    NORMAL                        │ line 89198
┃  ┃  ┃     ├─ 39    NORMAL                        │ line 94574
┃  ┃  ┃     └─ 47 ❌ STUCK     ((stuck, leaf))      │ line 99961
┃  ┃     ├─ 19    NORMAL                        │ line 105960
┃  ┃     ├─ 23    NORMAL                        │ line 111336
┃  ┃     ├─ 27 🔀 SPLIT     ((split))            │ line 117249
┃  ┃     ┃  ├─ 32    NORMAL                        │ line 122629
┃  ┃     ┃  ├─ 40    NORMAL                        │ line 128006
┃  ┃     ┃  └─ 48 ❌ STUCK     ((stuck, leaf))      │ line 133401
┃  ┃        ├─ 33    NORMAL                        │ line 139401
┃  ┃        ├─ 41    NORMAL                        │ line 144778
┃  ┃        └─ 49 ❌ STUCK     ((stuck, leaf))      │ line 150166
┃     ├─ 13    NORMAL                        │ line 156197
┃     ├─ 15    NORMAL                        │ line 161572
┃     ├─ 17 🔀 SPLIT     ((split))            │ line 166985
┃     ┃  ├─ 20    NORMAL                        │ line 172394
┃     ┃  ├─ 24    NORMAL                        │ line 177800
┃     ┃  ├─ 28 🔀 SPLIT     ((split))            │ line 183347
┃     ┃  ┃  ├─ 34    NORMAL                        │ line 188756
┃     ┃  ┃  ├─ 42    NORMAL                        │ line 194162
┃     ┃  ┃  └─ 50 ❌ STUCK     ((stuck, leaf))      │ line 199586
┃     ┃     ├─ 35    NORMAL                        │ line 205615
┃     ┃     ├─ 43    NORMAL                        │ line 211021
┃     ┃     └─ 51 ❌ STUCK     ((stuck, leaf))      │ line 216438
┃        ├─ 21    NORMAL                        │ line 222467
┃        ├─ 25    NORMAL                        │ line 227873
┃        ├─ 29 🔀 SPLIT     ((split))            │ line 233816
┃        ┃  ├─ 36    NORMAL                        │ line 239226
┃        ┃  ├─ 44    NORMAL                        │ line 244633
┃        ┃  └─ 52 ❌ STUCK     ((stuck, leaf))      │ line 250058
┃           ├─ 37    NORMAL                        │ line 256088
┃           ├─ 45    NORMAL                        │ line 261495
┃           └─ 53 ❌ STUCK     ((stuck, leaf))      │ line 266913
   ├─ 6     NORMAL                        │ line 272943
   └─ 8  ❌ STUCK     ((stuck, leaf))      │ line 278247
┌─ 2  🌳 ROOT      ((root, leaf, target, terminal)) │ line 283581
📊 STATISTICS
════════════════════════════════════════
📈 Total nodes: 53
  ⚪ Normal      :  34
  🌳 Root        :   2
  🔀 Split       :   8
  ❌ Stuck       :   9
🎯 Proof Outcome:
  ❌ STUCK: 9 branch(es) got stuck
All stuck nodes except the last one have the same problem. The `--full-printer` proof tree is attached here:

test_process_burn-full.txt.gz

Metadata

Metadata

Assignees

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