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

What should be placed in the instruction data? #35691

Closed
Subway2023 opened this issue Nov 17, 2024 · 1 comment
Closed

What should be placed in the instruction data? #35691

Subway2023 opened this issue Nov 17, 2024 · 1 comment
Labels
community Community contribution

Comments

@Subway2023
Copy link

Problem

I replaced hello_solana_program.so with my own C.so in integration_test.rs, but the execution failed. My command is as follows:

contract C {
    function f() public pure returns (uint r1)
    {
        uint8 a=0;
        r1=a+1234;
    }
}
solang compile --target solana C.sol --output ./output

replace hello_solana_program.so with C.so, then perform test and print result

cargo test --package solana-svm --test integration_sbw_test -- svm_integration --exact --show-output

there is error:

Result: [Executed { details: TransactionExecutionDetails { status: Err(InstructionError(0, InvalidAccountData)), log_messages: Some(["Program 1111111QLbz7JHiBTspS962RLKV8GndWFwiEaqKM invoke [1]", "Program is not deployed", "Program 1111111QLbz7JHiBTspS962RLKV8GndWFwiEaqKM failed: invalid account data for instruction"]), inner_instructions: None, durable_nonce_fee: None, return_data: None, executed_units: 0, accounts_data_len_delta: 0 }, programs_modified_by_tx: LoadedProgramsForTxBatch { entries: {}, slot: 5, environments: ProgramRuntimeEnvironments { program_runtime_v1: FunctionRegistry { map: {544561597: ([115, 111, 108, 95, 108, 111, 103, 95], 110517777804608), 930151202: ([115, 111, 108, 95, 109, 101, 109, 115, 101, 116, 95], 110517778118528), 1904002211: ([115, 111, 108, 95, 109, 101, 109, 99, 112, 121, 95], 110517778114016), 3069975057: ([97, 98, 111, 114, 116], 110517777846288)} }
, program_runtime_v2: FunctionRegistry { map: {} }
 }, hit_max_limit: false } }]
thread 'svm_integration' panicked at svm/tests/integration_sbw_test.rs:260:5:
assertion failed: result.execution_results[0].details().unwrap().status.is_ok()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Analyze

I suspect the error is caused by not assigning a value to the data field of the instruction, but I'm not sure what value should be assigned, shown in code

instructions: vec![CompiledInstruction {
    program_id_index: 1,
    accounts: vec![],
    data: vec![],
}],
@Subway2023 Subway2023 added the community Community contribution label Nov 17, 2024
Copy link
Contributor

This repository is no longer in use. Please re-open this issue in the agave repo: https://github.com/anza-xyz/agave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

No branches or pull requests

1 participant