Skip to content
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

Repair BPF loader test (and implementation?) after https://github.com/solana-labs/solana/pull/31462 #1308

Closed
steveluscher opened this issue May 24, 2023 · 4 comments · Fixed by solana-labs/solana#31792

Comments

@steveluscher
Copy link
Collaborator

Overview

The BPF loader tests started to fail after solana-labs/solana#31462.

Steps to reproduce

First, compile and start a test validator.

cd solana/validator
./solana-test-validator

Then on the same machine, run the web3.js tests.

git clone git@github.com:solana-labs/solana-web3.js.git
cd solana-web3.js
pnpm install
cd packages/library-legacy
TEST_LIVE=1 pnpm test:unit:node

For faster feedback, open packages/library-legacy/test/bpf-loader.test.ts and change the first describe to describe.only.

Description of bug

BPF loader tests fail.


> @solana/web3.js@0.0.0-development test:unit:node /home/sol/src/solana-web3.js/packages/library-legacy
> cross-env NODE_ENV=test TS_NODE_COMPILER_OPTIONS='{ "module": "commonjs", "target": "es2019" }' ts-mocha --require esm './test/**/*.test.ts'



  BPF Loader
    load BPF program
      1) get confirmed transaction
      2) simulate transaction
      3) simulate transaction with returnData
      4) deprecated - simulate transaction without signature verification
      5) simulate transaction without signature verification
      ✔ simulate transaction with bad programId
      ✔ reload program


  2 passing (4s)
  5 failing

  1) BPF Loader
       load BPF program
         get confirmed transaction:
     Error: failed to send transaction: Transaction simulation failed: This program may not be used for executing instructions
      at Connection.sendEncodedTransaction (src/connection.ts:5860:13)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at Connection.sendRawTransaction (src/connection.ts:5819:20)
      at Connection.sendTransaction (src/connection.ts:5807:12)
      at sendAndConfirmTransaction (src/utils/send-and-confirm-transaction.ts:35:21)
      at Context.<anonymous> (test/bpf-loader.test.ts:98:27)

  2) BPF Loader
       load BPF program
         simulate transaction:
     AssertionError: expected 'InvalidProgramForExecution' to be null
      at Context.<anonymous> (test/bpf-loader.test.ts:143:26)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  3) BPF Loader
       load BPF program
         simulate transaction with returnData:
     AssertionError [ERR_ASSERTION]: return data must be defined!
      at Context.<anonymous> (test/bpf-loader.test.ts:183:15)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  4) BPF Loader
       load BPF program
         deprecated - simulate transaction without signature verification:
     AssertionError: expected 'InvalidProgramForExecution' to be null
      at Context.<anonymous> (test/bpf-loader.test.ts:203:26)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  5) BPF Loader
       load BPF program
         simulate transaction without signature verification:
     AssertionError: expected 'InvalidProgramForExecution' to be null
      at Context.<anonymous> (test/bpf-loader.test.ts:236:26)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)



 ELIFECYCLE  Command failed with exit code 5.

The validator throws here:

https://github.com/solana-labs/solana/blob/f52ded35f4e332568dd214bb777d2e1a845df2d7/runtime/src/accounts.rs#L298-L300

@steveluscher
Copy link
Collaborator Author

I tried to assign this to you @pgarg66, but I guess you're not part of this repo or something.

@pgarg66
Copy link

pgarg66 commented May 24, 2023

Fixed by this solana-labs/solana#31792
Some changes are needed in the test w.r.t. delay visibility feature.

@steveluscher
Copy link
Collaborator Author

…and those changes were made in #1309 🎉

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2023

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants