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
let fee = PrioritizationFeeCache::get_prioritization_fee(
prioritization_fee_cache.cache.clone(),&slot,);let fee = fee.lock().unwrap();assert_eq!(2, fee.get_min_transaction_fee().unwrap()); <--- die here
If I'm correct, prioritization_fee_cache.cache is updated by a function called service_loop. The function lives in another thread. If we do get_prioritization_fee via prioritization_fee_cache.cache before service_loop, we will get a default object. When we try to call get_min_transaction_fee from the default object, I think we will get a None.
Proposed Solution
maybe ensure the cache has been updated. not sure is there any determine way to do it.
Thanks for confirming the issue. I thought I updated all tests to call sync_update() to ensure cache's updated before asserting. But apparently i missed this one.
While looking into it, I also noticed that prioritization_fee_cache::drop() isn't necessary, if we are OK with not calling join() explicitly. As in #27568. wdyt @willhickey@CriesofCarrots
Problem
I can reproduce the error by
cargo test -p solana-runtime
and it is intermittent. would like to share some investigation here.https://github.com/solana-labs/solana/blob/master/runtime/src/prioritization_fee_cache.rs#L482-L487
If I'm correct,
prioritization_fee_cache.cache
is updated by a function calledservice_loop
. The function lives in another thread. If we doget_prioritization_fee
viaprioritization_fee_cache.cache
beforeservice_loop
, we will get a default object. When we try to callget_min_transaction_fee
from the default object, I think we will get a None.Proposed Solution
maybe ensure the cache has been updated. not sure is there any determine way to do it.
cc @taozhu-chicago @willhickey @CriesofCarrots
The text was updated successfully, but these errors were encountered: