@@ -41,9 +41,9 @@ use {linera_base::prometheus_util::register_int_counter_vec, prometheus::IntCoun
4141use crate :: test_utils:: SystemExecutionState ;
4242use crate :: {
4343 committee:: { Committee , Epoch } ,
44- ApplicationDescription , ApplicationId , ChannelSubscription , ExecutionError ,
45- ExecutionRuntimeContext , MessageContext , MessageKind , OperationContext , OutgoingMessage ,
46- QueryContext , QueryOutcome , ResourceController , TransactionTracker ,
44+ ApplicationDescription , ApplicationId , ExecutionError , ExecutionRuntimeContext , MessageContext ,
45+ MessageKind , OperationContext , OutgoingMessage , QueryContext , QueryOutcome , ResourceController ,
46+ TransactionTracker ,
4747} ;
4848
4949/// The relative index of the `OpenChain` message created by the `OpenChain` operation.
@@ -72,8 +72,6 @@ pub struct SystemExecutionStateView<C> {
7272 pub epoch : HashedRegisterView < C , Option < Epoch > > ,
7373 /// The admin of the chain.
7474 pub admin_id : HashedRegisterView < C , Option < ChainId > > ,
75- /// Track the channels that we have subscribed to.
76- pub subscriptions : HashedSetView < C , ChannelSubscription > ,
7775 /// The committees that we trust, indexed by epoch number.
7876 // Not using a `MapView` because the set active of committees is supposed to be
7977 // small. Plus, currently, we would create the `BTreeMap` anyway in various places
@@ -211,16 +209,6 @@ pub enum SystemMessage {
211209 } ,
212210 /// Creates (or activates) a new chain.
213211 OpenChain ( OpenChainConfig ) ,
214- /// Subscribes to a channel.
215- Subscribe {
216- id : ChainId ,
217- subscription : ChannelSubscription ,
218- } ,
219- /// Unsubscribes from a channel.
220- Unsubscribe {
221- id : ChainId ,
222- subscription : ChannelSubscription ,
223- } ,
224212 /// Notifies that a new application was created.
225213 ApplicationCreated ,
226214}
@@ -353,10 +341,7 @@ where
353341 ChangeApplicationPermissions ( application_permissions) => {
354342 self . application_permissions . set ( application_permissions) ;
355343 }
356- CloseChain => {
357- let messages = self . close_chain ( context. chain_id ) . await ?;
358- txn_tracker. add_outgoing_messages ( messages) ?;
359- }
344+ CloseChain => self . close_chain ( ) . await ?,
360345 Transfer {
361346 owner,
362347 amount,
@@ -682,7 +667,7 @@ where
682667 }
683668 }
684669 // These messages are executed immediately when cross-chain requests are received.
685- Subscribe { .. } | Unsubscribe { .. } | OpenChain ( _) => { }
670+ OpenChain ( _) => { }
686671 // This message is only a placeholder: Its ID is part of the application ID.
687672 ApplicationCreated => { }
688673 }
@@ -762,27 +747,9 @@ where
762747 Ok ( OutgoingMessage :: new ( child_id, message) . with_kind ( MessageKind :: Protected ) )
763748 }
764749
765- pub async fn close_chain (
766- & mut self ,
767- id : ChainId ,
768- ) -> Result < Vec < OutgoingMessage > , ExecutionError > {
769- let mut messages = Vec :: new ( ) ;
770- // Unsubscribe from all channels.
771- self . subscriptions
772- . for_each_index ( |subscription| {
773- messages. push (
774- OutgoingMessage :: new (
775- subscription. chain_id ,
776- SystemMessage :: Unsubscribe { id, subscription } ,
777- )
778- . with_kind ( MessageKind :: Protected ) ,
779- ) ;
780- Ok ( ( ) )
781- } )
782- . await ?;
783- self . subscriptions . clear ( ) ;
750+ pub async fn close_chain ( & mut self ) -> Result < ( ) , ExecutionError > {
784751 self . closed . set ( true ) ;
785- Ok ( messages )
752+ Ok ( ( ) )
786753 }
787754
788755 pub async fn create_application (
0 commit comments