Skip to content

flamenco, runtime, vm: clean up bounds on the number of instruction accounts#7553

Merged
topointon-jump merged 1 commit into
mainfrom
topointon/sol_get_processed_sibling_instruction_fix_2
Jan 6, 2026
Merged

flamenco, runtime, vm: clean up bounds on the number of instruction accounts#7553
topointon-jump merged 1 commit into
mainfrom
topointon/sol_get_processed_sibling_instruction_fix_2

Conversation

@topointon-jump
Copy link
Copy Markdown
Contributor

@topointon-jump topointon-jump commented Dec 4, 2025

Corrects the value of FD_INSTR_ACCT_MAX to a larger bound derived from the transaction MTU. Without this, it is possible to cause a conformance divergence.

Credit to @nick0ve for reporting this in https://github.com/firedancer-io/auditor-internal/issues/348.

We were also using FD_INSTR_ACCT_MAX in several places where we shouldn't have been. This PR corrects that, so that we only use this larger bound where it's actually necessary.

Thankfully, solana-foundation/solana-improvement-documents#406 fixes this by limiting the number of instruction accounts to 255 at the transaction sanitization level. Once that SIMD is implemented and activated we can use the same 255 limit everywhere.

Increases the size of fd_runtime_t by 470KB.

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from e10ece9 to 275e9ac Compare December 4, 2025 19:39
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 4, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.050966 s 0.050701 s -0.520%
backtest mainnet-368528500-perf snapshot load 1.626 s 1.64 s 0.861%
backtest mainnet-368528500-perf total elapsed 50.9661 s 50.701451 s -0.519%
firedancer mem usage with mainnet.toml 1023.23 GiB 1023.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from 275e9ac to b6823dc Compare December 4, 2025 19:47
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 4, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.083272 s 0.076843 s -7.720%
backtest mainnet-368528500-perf snapshot load 3.068 s 3.066 s -0.065%
backtest mainnet-368528500-perf total elapsed 83.271952 s 76.842749 s -7.721%
firedancer mem usage with mainnet.toml 1023.23 GiB 1023.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch 2 times, most recently from 263d7a5 to 526d1fd Compare December 4, 2025 21:22
@topointon-jump topointon-jump changed the title [WIP] flamenco, runtime, vm: clean up bounds on the number of instruction accounts flamenco, runtime, vm: clean up bounds on the number of instruction accounts Dec 4, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 4, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.073861 s 0.073771 s -0.122%
backtest mainnet-368528500-perf snapshot load 3.18 s 3.144 s -1.132%
backtest mainnet-368528500-perf total elapsed 73.861388 s 73.770658 s -0.123%
firedancer mem usage with mainnet.toml 1023.23 GiB 1023.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from 526d1fd to 55c40db Compare December 4, 2025 21:38
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 4, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.062897 s 0.063242 s 0.549%
backtest mainnet-368528500-perf snapshot load 2.345 s 2.343 s -0.085%
backtest mainnet-368528500-perf total elapsed 62.897126 s 63.242102 s 0.548%
firedancer mem usage with mainnet.toml 1023.23 GiB 1023.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from 55c40db to 132eaf9 Compare December 4, 2025 23:16
Comment thread src/flamenco/runtime/info/fd_instr_info.c Outdated
Comment thread src/flamenco/runtime/program/fd_bpf_loader_serialization.c
Comment thread src/flamenco/runtime/program/fd_native_cpi.c Outdated
Comment thread src/flamenco/runtime/fd_runtime_const.h Outdated
Comment thread src/flamenco/vm/syscall/fd_vm_syscall_cpi.c
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 4, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.073589 s 0.074041 s 0.614%
backtest mainnet-368528500-perf snapshot load 3.208 s 3.155 s -1.652%
backtest mainnet-368528500-perf total elapsed 73.589184 s 74.041384 s 0.614%
firedancer mem usage with mainnet.toml 1023.23 GiB 1023.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from 132eaf9 to 981de07 Compare December 4, 2025 23:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 4, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.050908 s 0.050993 s 0.167%
backtest mainnet-368528500-perf snapshot load 1.612 s 1.609 s -0.186%
backtest mainnet-368528500-perf total elapsed 50.90766 s 50.992866 s 0.167%
firedancer mem usage with mainnet.toml 1023.23 GiB 1023.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from 981de07 to a3e3d2d Compare December 5, 2025 00:02
mjain-jump
mjain-jump previously approved these changes Dec 5, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 5, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.073527 s 0.07412 s 0.807%
backtest mainnet-368528500-perf snapshot load 3.194 s 3.206 s 0.376%
backtest mainnet-368528500-perf total elapsed 73.527075 s 74.12003 s 0.806%
firedancer mem usage with mainnet.toml 1023.23 GiB 1023.23 GiB 0.000%

@@ -105,7 +105,7 @@ static const fd_cluster_version_t FD_RUNTIME_CLUSTER_VERSION = {
/* The bpf loader's serialization footprint is bounded in the worst case
by 64 unique writable accounts which are each 10MiB in size (bounded
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

comments shouldn't exceed 80 chars

Comment thread src/flamenco/runtime/info/fd_instr_info.c
Copy link
Copy Markdown
Contributor

@ripatel-fd ripatel-fd left a comment

Choose a reason for hiding this comment

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

The fix looks good, but can we add a manual test passing a worst-case transaction into the runtime? This makes it easier to verify the behavior in the future without having to rely on external fuzzing infra.

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from a3e3d2d to ce51746 Compare January 5, 2026 22:07
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 5, 2026

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.050337 s 0.05026 s -0.153%
backtest mainnet-368528500-perf snapshot load 1.619 s 1.643 s 1.482%
backtest mainnet-368528500-perf total elapsed 50.337145 s 50.260467 s -0.152%
firedancer mem usage with mainnet.toml 993.23 GiB 993.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch 2 times, most recently from c50f29b to b7a6d5a Compare January 5, 2026 23:56
@topointon-jump topointon-jump enabled auto-merge (squash) January 5, 2026 23:57
@topointon-jump
Copy link
Copy Markdown
Contributor Author

@ripatel-fd done! will migrate it over to the new unit test framework when we have it, for now I copy/pasted the other test setup code

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 6, 2026

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.050378 s 0.050455 s 0.153%
backtest mainnet-368528500-perf snapshot load 1.651 s 1.642 s -0.545%
backtest mainnet-368528500-perf total elapsed 50.377961 s 50.455203 s 0.153%
firedancer mem usage with mainnet.toml 993.23 GiB 993.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from b7a6d5a to 7c8d430 Compare January 6, 2026 02:15
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 6, 2026

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.050269 s 0.050337 s 0.135%
backtest mainnet-368528500-perf snapshot load 1.68 s 1.674 s -0.357%
backtest mainnet-368528500-perf total elapsed 50.269465 s 50.337073 s 0.134%
firedancer mem usage with mainnet.toml 993.23 GiB 993.23 GiB 0.000%

@topointon-jump topointon-jump force-pushed the topointon/sol_get_processed_sibling_instruction_fix_2 branch from 7c8d430 to e4f4215 Compare January 6, 2026 02:41
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 6, 2026

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.05045 s 0.050153 s -0.589%
backtest mainnet-368528500-perf snapshot load 1.707 s 1.627 s -4.687%
backtest mainnet-368528500-perf total elapsed 50.44964 s 50.15335 s -0.587%
firedancer mem usage with mainnet.toml 993.23 GiB 993.23 GiB 0.000%

@topointon-jump topointon-jump merged commit b39236f into main Jan 6, 2026
13 checks passed
@topointon-jump topointon-jump deleted the topointon/sol_get_processed_sibling_instruction_fix_2 branch January 6, 2026 15:38
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