Skip to content
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

Merged
merged 4 commits into from
Feb 21, 2025
Merged

Various estimator fixes #21298

merged 4 commits into from
Feb 21, 2025

Conversation

mystenmark
Copy link
Contributor

@mystenmark mystenmark commented Feb 20, 2025

  • Use LruCache for local estimates
  • Ensure estimator receive loop exigts at end of epoch

@mystenmark mystenmark requested a review from aschran February 20, 2025 21:00
Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 7:12pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 7:12pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 7:12pm

Copy link
Contributor

@aschran aschran left a 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

///
/// If unspecified, this will default to `10000`.
#[serde(default = "default_local_execution_time_lru_cache_size")]
pub local_execution_time_lru_cache_size: usize,
Copy link
Contributor

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"),
Copy link
Contributor

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();
Copy link
Contributor

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

@mystenmark mystenmark force-pushed the mlogan-estimator-fixes branch from cba62d2 to 2a9718f Compare February 21, 2025 19:10
@mystenmark mystenmark temporarily deployed to sui-typescript-aws-kms-test-env February 21, 2025 19:10 — with GitHub Actions Inactive
@mystenmark mystenmark merged commit 50411e0 into main Feb 21, 2025
47 checks passed
@mystenmark mystenmark deleted the mlogan-estimator-fixes branch February 21, 2025 19:41
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.

2 participants