Skip to content

Conversation

@topointon-jump
Copy link
Contributor

Adds a set of fixtures and a unit test fixture runner for vm input serialization, generated by running the input through the Agave vm input serializers. Compares the output buffer, the vm regions and the region metadata. Includes coverage of stricter_abi_and_runtime_constraints and account_data_direct_mapping.

Adjusted some of the serialization code to make it more amenable for unit testing, removing the dependency on fd_runtime_t.

@topointon-jump
Copy link
Contributor Author

topointon-jump commented Nov 27, 2025

This pr depends on, and adds tests for, #7389. Needs to be rebased when 7389 is merged.

FD_FEATURE_ACTIVE( load_slot, features, account_data_direct_mapping ),
FD_FEATURE_ACTIVE( load_slot, features, stricter_abi_and_runtime_constraints ),
0 );
0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could be useful to have in-line comments with what these values are, much like in fd_bpf_loader_program.c

@topointon-jump topointon-jump force-pushed the topointon/bpf-loader-serialization-testss branch from 3aa95f5 to a15b3ff Compare November 28, 2025 16:14
@topointon-jump topointon-jump force-pushed the topointon/bpf-loader-serialization-testss branch from a15b3ff to 9a7e90d Compare November 28, 2025 16:17
Comment on lines 412 to 416
if( FD_UNLIKELY( err ) ) {
return err;
}

if( FD_UNLIKELY( input==NULL ) ) {
return FD_EXECUTOR_INSTR_ERR_MISSING_ACC;
}

fd_sha256_t _sha[1];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fd_exec_instr_ctx_get_index_of_instr_account_in_transaction throws FD_EXECUTOR_INSTR_ERR_MISSING_ACC if the account is missing, so propagating the error is the correct thing to do here and doesn't change the behaviour.

@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.0733 s 0.074339 s 1.417%
backtest mainnet-368528500-perf snapshot load 3.796 s 3.144 s -17.176%
backtest mainnet-368528500-perf total elapsed 73.300332 s 74.339282 s 1.417%
firedancer mem usage with mainnet.toml 1013.23 GiB 1013.23 GiB 0.000%

@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.073295 s 0.07316 s -0.184%
backtest mainnet-368528500-perf snapshot load 3.785 s 3.208 s -15.244%
backtest mainnet-368528500-perf total elapsed 73.294634 s 73.159935 s -0.184%
firedancer mem usage with mainnet.toml 1013.23 GiB 1013.23 GiB 0.000%

@github-actions
Copy link

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.076924 s 0.076404 s -0.676%
backtest mainnet-368528500-perf snapshot load 4.846 s 3.059 s -36.876%
backtest mainnet-368528500-perf total elapsed 76.924404 s 76.404374 s -0.676%
firedancer mem usage with mainnet.toml 1013.23 GiB 1013.23 GiB 0.000%

@@ -0,0 +1,58 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ik this is still WIP but would it be better to have these as test vector fixtures instead ofo having a bunch of JSONs committed to the repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants