Skip to content

Conversation

@topointon-jump
Copy link
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

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

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

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

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
@github-actions
Copy link

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

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
@github-actions
Copy link

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%

#define FD_RUNTIME_CPI_MAX_INSTR_DATA_LEN (10240UL)

/* 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
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

Copy link
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.

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.

5 participants