Skip to content

Conversation

ripatel-fd
Copy link
Contributor

  • Reduce funk key size to 32 bytes (from 40 bytes)
  • Move program cache to separate funk instance and wksp
  • Introduce program cache eviction policy
  • Restructure program cache logic / general cleanup
    • Reduce verbosity in API documentation
    • Clean up API naming
    • Split up API into a few smaller headers
  • Reduce program cache fill allocations and memory copies
    (directly populate calldests map, skip calldests map alloc for
    newer sBPF versions)
  • Remove broken/unused concurrency model in previous program cache
    implementation

@ripatel-fd ripatel-fd force-pushed the ripatel/program-cache-sep branch 6 times, most recently from 8ebeca0 to 375b575 Compare October 4, 2025 21:02
@ripatel-fd ripatel-fd marked this pull request as ready for review October 5, 2025 03:10
@ripatel-fd ripatel-fd force-pushed the ripatel/program-cache-sep branch 5 times, most recently from b7e34a7 to dce26c1 Compare October 6, 2025 09:46
@ripatel-fd ripatel-fd force-pushed the ripatel/program-cache-sep branch from dce26c1 to 805f08a Compare October 6, 2025 16:05
@ripatel-fd ripatel-fd force-pushed the ripatel/program-cache-sep branch 5 times, most recently from 62f8e14 to 5ee2476 Compare October 7, 2025 04:44
program_id,
&cache_entry )!=0 ) ) {
/* https://github.com/anza-xyz/agave/blob/v2.2.6/programs/loader-v4/src/lib.rs#L522-L528 */
fd_progcache_rec_t const * cache_entry =
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this a concurrent access? The entry might get evicted before you can read executable etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fix this in a follow-up PR. The purpose of this PR was to separate out the account database and the loaded program cache.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ripatel-fd ripatel-fd force-pushed the ripatel/program-cache-sep branch 3 times, most recently from bf29fd5 to 2e58ab1 Compare October 7, 2025 18:44
- Reduce funk key size to 32 bytes (from 40 bytes)
- Move program cache to separate funk instance and wksp
- Introduce program cache eviction policy
- Restructure program cache logic / general cleanup
  - Reduce verbosity in API documentation
  - Clean up API naming
  - Split up API into a few smaller headers
- Reduce program cache fill allocations and memory copies
  (directly populate calldests map, skip calldests map alloc for
  newer sBPF versions)
- Remove broken/unused concurrency model in previous program cache
  implementation
- Remove strict instruction logging requirements
  (no program cache tombstone entries for obviously invalid
  programs, such as invalid section table)
- Simplify cache invalidation logic ("queue program for re-
  verification"): now just inserts a tombstone
- Reuse cache entries across forks (cache entries tracked at fork
  graph nodes determined by program modify slot, instead of program
  load slot)
@ripatel-fd ripatel-fd force-pushed the ripatel/program-cache-sep branch from 2e58ab1 to 1d05b87 Compare October 7, 2025 23:09
Copy link

github-actions bot commented Oct 7, 2025

Performance Measurements ⏳

Suite Baseline New Change
backtest mainnet-368528500-perf per slot 0.097525 s 0.100368 s 2.915%
backtest mainnet-368528500-perf snapshot load 3.1 s 2.9 s -6.452%
backtest mainnet-368528500-perf total elapsed 97.52457 s 100.36795 s 2.916%
firedancer mem usage with mainnet.toml 1009.12 GiB 1011.12 GiB 0.198%

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