-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various estimator fixes #21298
Various estimator fixes #21298
Conversation
mystenmark
commented
Feb 20, 2025
•
edited
Loading
edited
- Use LruCache for local estimates
- Ensure estimator receive loop exigts at end of epoch
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
59c3206
to
549d3e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits, feel free to take em or leave em
crates/sui-config/src/node.rs
Outdated
/// | ||
/// If unspecified, this will default to `10000`. | ||
#[serde(default = "default_local_execution_time_lru_cache_size")] | ||
pub local_execution_time_lru_cache_size: usize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove "LRU" from the names here, the type of cache isn't so important and who knows if we want to change it later
@@ -74,16 +76,19 @@ impl ExecutionTimeObserver { | |||
let mut observer = Self { | |||
epoch_store: Arc::downgrade(epoch_store), | |||
consensus_adapter, | |||
local_observations: HashMap::new(), | |||
local_observations: LruCache::new( | |||
NonZero::new(lru_cache_size).expect("lru_cache_size must be non-zero"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JMO: if you need it to always be nonzero here, the argument to ExecutionTimeObserver::spawn should take a NonZero
}; | ||
tokio::spawn(async move { | ||
let epoch_store = epoch_store.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change the function arg here also to just be the by-value copy you need instead of taking a & and then cloning inside the function
cba62d2
to
2a9718f
Compare