@@ -169,8 +169,9 @@ impl ConsensusHandlerInitializer {
169169mod additional_consensus_state {
170170 use std:: marker:: PhantomData ;
171171
172+ use consensus_core:: CommitRef ;
172173 use fastcrypto:: hash:: HashFunction as _;
173- use sui_types:: crypto:: DefaultHash ;
174+ use sui_types:: { crypto:: DefaultHash , digests :: Digest } ;
174175
175176 use super :: * ;
176177 /// AdditionalConsensusState tracks any in-memory state that is retained by ConsensusHandler
@@ -216,7 +217,6 @@ mod additional_consensus_state {
216217
217218 self . commit_info_impl (
218219 epoch_start_time,
219- protocol_config,
220220 consensus_commit,
221221 Some ( estimated_commit_period) ,
222222 )
@@ -225,7 +225,6 @@ mod additional_consensus_state {
225225 fn commit_info_impl (
226226 & self ,
227227 epoch_start_time : u64 ,
228- protocol_config : & ProtocolConfig ,
229228 consensus_commit : & impl ConsensusCommitAPI ,
230229 estimated_commit_period : Option < Duration > ,
231230 ) -> ConsensusCommitInfo {
@@ -246,8 +245,8 @@ mod additional_consensus_state {
246245 round : consensus_commit. leader_round ( ) ,
247246 timestamp,
248247 leader_author,
249- sub_dag_index : consensus_commit. commit_sub_dag_index ( ) ,
250- consensus_commit_digest : consensus_commit. consensus_digest ( protocol_config ) ,
248+ consensus_commit_ref : consensus_commit. commit_ref ( ) ,
249+ rejected_transactions_digest : consensus_commit. rejected_transactions_digest ( ) ,
251250 additional_state_digest : Some ( self . digest ( ) ) ,
252251 estimated_commit_period,
253252 skip_consensus_commit_prologue_in_test : false ,
@@ -269,8 +268,8 @@ mod additional_consensus_state {
269268 pub round : u64 ,
270269 pub timestamp : u64 ,
271270 pub leader_author : AuthorityIndex ,
272- pub sub_dag_index : u64 ,
273- pub consensus_commit_digest : ConsensusCommitDigest ,
271+ pub consensus_commit_ref : CommitRef ,
272+ pub rejected_transactions_digest : Digest ,
274273
275274 additional_state_digest : Option < AdditionalConsensusStateDigest > ,
276275 estimated_commit_period : Option < Duration > ,
@@ -290,8 +289,8 @@ mod additional_consensus_state {
290289 round : commit_round,
291290 timestamp : commit_timestamp,
292291 leader_author : 0 ,
293- sub_dag_index : 0 ,
294- consensus_commit_digest : ConsensusCommitDigest :: default ( ) ,
292+ consensus_commit_ref : CommitRef :: default ( ) ,
293+ rejected_transactions_digest : Digest :: default ( ) ,
295294 additional_state_digest : Some ( AdditionalConsensusStateDigest :: ZERO ) ,
296295 estimated_commit_period,
297296 skip_consensus_commit_prologue_in_test,
@@ -323,6 +322,10 @@ mod additional_consensus_state {
323322 . expect ( "estimated commit period is not available" )
324323 }
325324
325+ fn consensus_commit_digest ( & self ) -> ConsensusCommitDigest {
326+ ConsensusCommitDigest :: new ( self . consensus_commit_ref . digest . into_inner ( ) )
327+ }
328+
326329 fn consensus_commit_prologue_transaction (
327330 & self ,
328331 epoch : u64 ,
@@ -343,7 +346,7 @@ mod additional_consensus_state {
343346 epoch,
344347 self . round ,
345348 self . timestamp ,
346- self . consensus_commit_digest ,
349+ self . consensus_commit_digest ( ) ,
347350 ) ;
348351 VerifiedExecutableTransaction :: new_system ( transaction, epoch)
349352 }
@@ -357,7 +360,7 @@ mod additional_consensus_state {
357360 epoch,
358361 self . round ,
359362 self . timestamp ,
360- self . consensus_commit_digest ,
363+ self . consensus_commit_digest ( ) ,
361364 consensus_determined_version_assignments,
362365 ) ;
363366 VerifiedExecutableTransaction :: new_system ( transaction, epoch)
@@ -373,7 +376,7 @@ mod additional_consensus_state {
373376 epoch,
374377 self . round ,
375378 self . timestamp ,
376- self . consensus_commit_digest ,
379+ self . consensus_commit_digest ( ) ,
377380 consensus_determined_version_assignments,
378381 additional_state_digest,
379382 ) ;
@@ -801,7 +804,8 @@ impl<C: CheckpointServiceNotify + Send + Sync> ConsensusHandler<C> {
801804
802805 info ! (
803806 %consensus_commit,
804- "Received consensus output"
807+ "Received consensus output. Rejected transactions: {}" ,
808+ consensus_commit. rejected_transactions_debug_string( ) ,
805809 ) ;
806810
807811 self . last_consensus_stats . index = ExecutionIndices {
@@ -1049,19 +1053,28 @@ impl<C: CheckpointServiceNotify + Send + Sync> ConsensusHandler<C> {
10491053 timestamp_ms : commit_info. timestamp ,
10501054 last_of_epoch : final_round && !should_write_random_checkpoint,
10511055 checkpoint_height,
1056+ consensus_commit_ref : commit_info. consensus_commit_ref ,
1057+ rejected_transactions_digest : commit_info. rejected_transactions_digest ,
10521058 } ,
10531059 } ;
10541060 self . epoch_store
10551061 . write_pending_checkpoint ( & mut state. output , & pending_checkpoint)
10561062 . expect ( "failed to write pending checkpoint" ) ;
10571063
1064+ info ! (
1065+ "Written pending checkpoint: {:?}" ,
1066+ pending_checkpoint. details,
1067+ ) ;
1068+
10581069 if should_write_random_checkpoint {
10591070 let pending_checkpoint = PendingCheckpoint {
10601071 roots : randomness_schedulables. iter ( ) . map ( |s| s. key ( ) ) . collect ( ) ,
10611072 details : PendingCheckpointInfo {
10621073 timestamp_ms : commit_info. timestamp ,
10631074 last_of_epoch : final_round,
10641075 checkpoint_height : checkpoint_height + 1 ,
1076+ consensus_commit_ref : commit_info. consensus_commit_ref ,
1077+ rejected_transactions_digest : commit_info. rejected_transactions_digest ,
10651078 } ,
10661079 } ;
10671080 self . epoch_store
@@ -2147,7 +2160,7 @@ impl<C: CheckpointServiceNotify + Send + Sync> ConsensusHandler<C> {
21472160 // Therefore, the transaction sequence number starts from 1 here.
21482161 let current_tx_index = ExecutionIndices {
21492162 last_committed_round : commit_info. round ,
2150- sub_dag_index : commit_info. sub_dag_index ,
2163+ sub_dag_index : commit_info. consensus_commit_ref . index . into ( ) ,
21512164 transaction_index : ( seq + 1 ) as u64 ,
21522165 } ;
21532166
0 commit comments