You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(cache): rank ingested items with the live env basefee, not 0 (#280)
* fix(cache): rank ingested items with the live env basefee, not 0
CacheTask declared basefee as a loop-local reset to 0 on every select! iteration and assigned it only in the envs.changed() arm. Because add_bundle/add_tx run in the other select! arms (separate loop iterations), they always received basefee 0, so cached items were ranked by effective_gas_price(0) instead of the env basefee.
The rank is only a simulation-order and cache-eviction heuristic, so the impact is limited to ordering/eviction quality (negligible at gouda's ~7 wei basefee, latent on higher-basefee chains); it does not affect block validity or execution. Fixed by reading the block number and basefee from the live env at ingest time via current_block_and_basefee.
Adds cache_task_ranks_with_env_basefee as a regression test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Update src/tasks/cache/task.rs
Co-authored-by: Fraser Hutchison <190532+Fraser999@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Fraser Hutchison <190532+Fraser999@users.noreply.github.com>
0 commit comments