Skip to content

Commit

Permalink
fix: return last_execectuted_sub_dag + 1 to account for narwhal off b…
Browse files Browse the repository at this point in the history
…y 1 error
  • Loading branch information
daltoncoder committed May 30, 2024
1 parent a12c1f6 commit 21b2d07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/consensus/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ impl<Q: SyncQueryRunnerInterface, NE: Emitter> ExecutionState for Execution<Q, N
}

async fn last_executed_sub_dag_index(&self) -> u64 {
self.query_runner.get_sub_dag_index()
// Note we add one here because of an off by 1 error in Narwhal codebase
// if we actually return the last sub dag index that we exectuted during a restart that is
// going to be the sub dag index they send us after a restart and we will re-execute it
self.query_runner.get_sub_dag_index() + 1
}
}

0 comments on commit 21b2d07

Please sign in to comment.