@@ -10,11 +10,12 @@ use crate::{
1010use aptos_config:: config:: HotStateConfig ;
1111use aptos_drop_helper:: DropHelper ;
1212use aptos_storage_interface:: state_store:: {
13- state:: LedgerState , state_view:: cached_state_view:: ShardedStateCache ,
13+ state:: LedgerState , state_view:: cached_state_view:: ShardedStateCache , HotStateShardUpdates ,
1414} ;
1515use aptos_types:: {
1616 contract_event:: ContractEvent ,
1717 epoch_state:: EpochState ,
18+ state_store:: NUM_STATE_SHARDS ,
1819 transaction:: {
1920 block_epilogue:: BlockEndInfo , ExecutionStatus , Transaction , TransactionStatus , Version ,
2021 } ,
@@ -41,6 +42,7 @@ impl ExecutionOutput {
4142 block_end_info : Option < BlockEndInfo > ,
4243 next_epoch_state : Option < EpochState > ,
4344 subscribable_events : Planned < Vec < ContractEvent > > ,
45+ hot_state_updates : [ Vec < HotStateShardUpdates > ; NUM_STATE_SHARDS ] ,
4446 ) -> Self {
4547 let next_version = first_version + to_commit. len ( ) as Version ;
4648 assert_eq ! ( next_version, result_state. latest( ) . next_version( ) ) ;
@@ -65,6 +67,7 @@ impl ExecutionOutput {
6567 block_end_info,
6668 next_epoch_state,
6769 subscribable_events,
70+ hot_state_updates,
6871 } )
6972 }
7073
@@ -81,6 +84,7 @@ impl ExecutionOutput {
8184 block_end_info : None ,
8285 next_epoch_state : None ,
8386 subscribable_events : Planned :: ready ( vec ! [ ] ) ,
87+ hot_state_updates : std:: array:: from_fn ( |_| vec ! [ ] ) ,
8488 } )
8589 }
8690
@@ -99,6 +103,7 @@ impl ExecutionOutput {
99103 block_end_info : None ,
100104 next_epoch_state : None ,
101105 subscribable_events : Planned :: ready ( vec ! [ ] ) ,
106+ hot_state_updates : std:: array:: from_fn ( |_| vec ! [ ] ) ,
102107 } )
103108 }
104109
@@ -119,6 +124,7 @@ impl ExecutionOutput {
119124 block_end_info : None ,
120125 next_epoch_state : self . next_epoch_state . clone ( ) ,
121126 subscribable_events : Planned :: ready ( vec ! [ ] ) ,
127+ hot_state_updates : std:: array:: from_fn ( |_| vec ! [ ] ) ,
122128 } )
123129 }
124130
@@ -166,6 +172,8 @@ pub struct Inner {
166172 /// state cache.
167173 pub next_epoch_state : Option < EpochState > ,
168174 pub subscribable_events : Planned < Vec < ContractEvent > > ,
175+ /// Per checkpoint and optionally a partial block.
176+ pub hot_state_updates : [ Vec < HotStateShardUpdates > ; NUM_STATE_SHARDS ] ,
169177}
170178
171179impl Inner {
0 commit comments