ChorusOne/solido

Creating Anker instance may be dangerously close to the compute limit

Closed this issue · 0 comments

ruuda commented

test_anker.py failed once for me locally:

Stdout: Failed to create Anker instance.
Solana RPC client returned an error:

  Request:    Some(SendTransaction)
  Kind:       RPC response error
  Error code: -32002
  Message:    Transaction simulation failed: Error processing Instruction 0: Program failed to complete
  Reason:     Transaction preflight failure
  Error:     

    Raw:      InstructionError(0, ProgramFailedToComplete)
    Display:  Error processing Instruction 0: Program failed to complete


  Logs:      

    Program 8MT6MtwbSdNyYH655cDxf2MypYSVfmAdx8jXrBWPREzf invoke [1]
    Program log: Creating account at B5yfndBsoNKckRH7NTwswRpftRRyM4pdnfwibFFk34zX, funded with 0.002512560 SOL from Bu3TFkuDsL8bzTcTv3FS71JzuEpWBKvjT3m4QWcw9rEP.
    Program 11111111111111111111111111111111 invoke [2]
    Program 11111111111111111111111111111111 success
    Program log: Allocating account for stSOL reserve ...
    Program log: Creating account at GfEc1KDKvnMpR7eeswpTfN9hTnnSuvfRikMe9SZ3UL1s, funded with 0.002039280 SOL from Bu3TFkuDsL8bzTcTv3FS71JzuEpWBKvjT3m4QWcw9rEP.
    Program 11111111111111111111111111111111 invoke [2]
    Program 11111111111111111111111111111111 success
    Program log: Initializing SPL token account for stSOL reserve ...
    Program log: Initializing SPL token account for mint 46KHqKGtqcs1Bis7FWmCvzsbKx7wFf5Z16UaW1Nxj72q at GfEc1KDKvnMpR7eeswpTfN9hTnnSuvfRikMe9SZ3UL1s ...
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]
    Program log: Instruction: InitializeAccount
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3412 of 73876 compute units
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
    Program log: Allocating account for UST reserve ...
    Program log: Creating account at CxnVjZ3T8yT1jX3KnFKfrrrehzS4RxMao5ARorcMz748, funded with 0.002039280 SOL from Bu3TFkuDsL8bzTcTv3FS71JzuEpWBKvjT3m4QWcw9rEP.
    Program 11111111111111111111111111111111 invoke [2]
    Program 11111111111111111111111111111111 success
    Program log: Initializing SPL token account for UST reserve ...
    Program log: Initializing SPL token account for mint nAm5yBuy7yWZrb8zYntTuMn7ZmVKNpuNw3SY5b8X5cZ at CxnVjZ3T8yT1jX3KnFKfrrrehzS4RxMao5ARorcMz748 ...
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]
    Program log: Instruction: InitializeAccount
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3412 of 13934 compute units
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
    Program 8MT6MtwbSdNyYH655cDxf2MypYSVfmAdx8jXrBWPREzf consumed 200000 of 200000 compute units
    Program failed to complete: exceeded maximum number of instructions allowed (200000) at instruction #26229
    Program 8MT6MtwbSdNyYH655cDxf2MypYSVfmAdx8jXrBWPREzf failed: Program failed to complete

Rebuilding and running again fixed the issue, but it might be that we are dangerously close to the compute limit, and depending on the particular addresses it will fail or pass. If that is the case, then it should be easy to avoid by removing a few of the address print, as formatting tends to use a lot of compute units.