2

Solana version = 1.16.8 rustc -V = 1.69.0 solana-cli = 1.16.8

The transaction will process successfully if it is type Transaction but not if it is type VersionedTransaction.

I need to use a VersionedTransaction because I am trying to test with lookup tables.

let mut test_builder = TestEnvironmentBuilder::new();
test_builder.add_account_with_lamports(
    user.pubkey(),
    solana_sdk::system_program::ID,
    10_000_000_000_000,
);
/*
test_env is
pub struct TestEnvironment {
    pub context: RefCell<ProgramTestContext>,
    pub rent: Rent,
}
*/   
let mut test_env = test_builder.start().await; 
let mut context = test_env.context.borrow_mut();
//This is simple instruction to set compute units
let compute_ix = compute_instruction();
let transaction = Transaction::new_signed_with_payer(
    &[compute_ix],
    Some(&user.pubkey()),
    &[&user],
    context.last_blockhash,
);
let tx_result = context
    .banks_client
    .process_transaction_with_commitment(
        transaction,
        solana_sdk::commitment_config::CommitmentLevel::Processed,
    )
    .await;
println!("{:#?}", tx_result);    
[2023-08-24T18:28:31.713669302Z DEBUG solana_runtime::message_processor::stable_log] Program ComputeBudget111111111111111111111111111111 invoke [1]
[2023-08-24T18:28:31.713750348Z DEBUG solana_runtime::message_processor::stable_log] Program ComputeBudget111111111111111111111111111111 success
Ok(
    (),
)

When I replace with

let transaction = VersionedTransaction::try_new(
    VersionedMessage::V0(v0::Message::try_compile(
        &user.pubkey(),
        &[compute_ix],
        &[],
        context.last_blockhash,
    )?),
    &[&user],
)?;

The tx_result is

Err(
    RpcError(
        DeadlineExceeded,
    ),
)

What is going on here and how to fix?

3
  • 4
    You found a bug! Thanks for explaining the issue with an example, here's the fix: github.com/solana-labs/solana/pull/33005
    – Jon C
    Commented Aug 25, 2023 at 19:42
  • @JonC happy days. cheers
    – guccimane
    Commented Aug 26, 2023 at 2:30
  • 3
    I’m voting to close this question because it turned out to be a bug report. Commented Jan 5 at 6:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.