Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aschran committed Jan 30, 2025
1 parent 221fce6 commit 1c5e1fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/sui-core/src/authority/authority_per_epoch_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,7 @@ impl AuthorityPerEpochStore {
if let Err(e) = tx_local_execution_time.try_send((ptb.clone(), timings, total_duration)) {
// This channel should not overflow, but if it does, don't wait; just log an error
// and drop the observation.
// TODO: add a metric for this.
warn!("failed to send local execution time to observer: {e}");
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/sui-core/src/authority/execution_time_estimator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ impl ExecutionTimeObserver {
// Send a new observation through consensus if our current moving average
// differs too much from the last one we shared.
// TODO: Consider only sharing observations for entrypoints with congestion.
// TODO: Consider only sharing observations that disagree with consensus estimate.
let new_average = local_observation.moving_average.get_average();
if local_observation.last_shared.map_or(true, |last_shared| {
let diff = last_shared.abs_diff(new_average);
Expand All @@ -156,6 +157,7 @@ impl ExecutionTimeObserver {
ExecutionTimeObservation::new(epoch_store.name, to_share),
);
// TODO: Add metrics for shared observations.
// TODO: Add a rate limit on consensus submissions.
if let Err(e) = self
.consensus_adapter
.submit_to_consensus(&[transaction], &epoch_store)
Expand Down
1 change: 1 addition & 0 deletions crates/sui-core/src/consensus_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ impl SuiTxValidator {
}

ConsensusTransactionKind::ExecutionTimeObservation(obs) => {
// TODO: Use a separate limit for this that may truncate shared observations.
if obs.estimates.len()
> epoch_store
.protocol_config()
Expand Down

0 comments on commit 1c5e1fd

Please sign in to comment.