diff --git a/examples/hex-game/README.md b/examples/hex-game/README.md index 2e65ce11634..bafab18794c 100644 --- a/examples/hex-game/README.md +++ b/examples/hex-game/README.md @@ -74,7 +74,7 @@ sleep 1 The `start` mutation starts a new game. We specify the two players using their new public keys, on [`http://localhost:8080/chains/$CHAIN_1/applications/$APP_ID`][main_chain]: -```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 mutation { start( players: [ @@ -89,7 +89,7 @@ mutation { The app's main chain keeps track of the games in progress, by public key: -```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 query { gameChains { keys(count: 3) @@ -99,7 +99,7 @@ query { It contains the temporary chain's ID, and the ID of the message that created it: -```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 query { gameChains { entry(key: "8a21aedaef74697db8b676c3e03ddf965bf4a808dc2bcabb6d70d6e6e3022ff7") { diff --git a/examples/hex-game/src/lib.rs b/examples/hex-game/src/lib.rs index 1186b25e6e0..5f2ba50e52e 100644 --- a/examples/hex-game/src/lib.rs +++ b/examples/hex-game/src/lib.rs @@ -78,7 +78,7 @@ sleep 1 The `start` mutation starts a new game. We specify the two players using their new public keys, on [`http://localhost:8080/chains/$CHAIN_1/applications/$APP_ID`][main_chain]: -```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 mutation { start( players: [ @@ -93,7 +93,7 @@ mutation { The app's main chain keeps track of the games in progress, by public key: -```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 query { gameChains { keys(count: 3) @@ -103,7 +103,7 @@ query { It contains the temporary chain's ID, and the ID of the message that created it: -```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 query { gameChains { entry(key: "8a21aedaef74697db8b676c3e03ddf965bf4a808dc2bcabb6d70d6e6e3022ff7") { diff --git a/examples/social/README.md b/examples/social/README.md index 5e2d7f14fb4..7339b5664c7 100644 --- a/examples/social/README.md +++ b/examples/social/README.md @@ -53,7 +53,7 @@ linera --with-wallet 0 project publish-and-create examples/social This will output the new application ID, e.g.: ```rust -e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 ``` With the `wallet show` command you can find the ID of the application creator's chain: @@ -88,7 +88,7 @@ one of the chain where it isn't registered yet: mutation { requestApplication( chainId: "1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03", - applicationId: "e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000" + applicationId: "e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000" ) } ``` @@ -108,10 +108,10 @@ query { ``` Open both URLs under the entry `link`. Now you can use the application on each chain. -E.g. [in the 8081 tab](http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000) +E.g. [in the 8081 tab](http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000) subscribe to the other chain: -```gql,uri=http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 mutation { subscribe( chainId: "e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65" @@ -119,9 +119,9 @@ mutation { } ``` -Now make a post [in the 8080 tab](http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000): +Now make a post [in the 8080 tab](http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000): -```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 mutation { post( text: "Linera Social is the new Mastodon!" @@ -132,7 +132,7 @@ mutation { Since 8081 is a subscriber. Let's see if it received any posts: # You can see the post on running the [web-frontend](./web-frontend/), or follow the steps below. -```gql,uri=http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 query { receivedPosts { keys { timestamp author index } } } ``` diff --git a/examples/social/src/lib.rs b/examples/social/src/lib.rs index f59f806783e..55841171f5f 100644 --- a/examples/social/src/lib.rs +++ b/examples/social/src/lib.rs @@ -62,7 +62,7 @@ linera --with-wallet 0 project publish-and-create examples/social This will output the new application ID, e.g.: ```ignore -e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 ``` With the `wallet show` command you can find the ID of the application creator's chain: @@ -97,7 +97,7 @@ one of the chain where it isn't registered yet: mutation { requestApplication( chainId: "1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03", - applicationId: "e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000" + applicationId: "e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000" ) } ``` @@ -117,10 +117,10 @@ query { ``` Open both URLs under the entry `link`. Now you can use the application on each chain. -E.g. [in the 8081 tab](http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000) +E.g. [in the 8081 tab](http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000) subscribe to the other chain: -```gql,uri=http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 mutation { subscribe( chainId: "e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65" @@ -128,9 +128,9 @@ mutation { } ``` -Now make a post [in the 8080 tab](http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000): +Now make a post [in the 8080 tab](http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000): -```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8080/chains/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 mutation { post( text: "Linera Social is the new Mastodon!" @@ -141,7 +141,7 @@ mutation { Since 8081 is a subscriber. Let's see if it received any posts: # You can see the post on running the [web-frontend](./web-frontend/), or follow the steps below. -```gql,uri=http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000001000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 +```gql,uri=http://localhost:8081/chains/1db1936dad0717597a7743a8353c9c0191c14c3a129b258e9743aec2b4f05d03/applications/e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65010000000000000000000000e476187f6ddfeb9d588c7b45d3df334d5501d6499b3f9ad5595cae86cce16a65030000000000000000000000 query { receivedPosts { keys { timestamp author index } } } ``` diff --git a/linera-chain/src/chain.rs b/linera-chain/src/chain.rs index 6fb695c043c..76a93df084e 100644 --- a/linera-chain/src/chain.rs +++ b/linera-chain/src/chain.rs @@ -1182,16 +1182,15 @@ where } let full_names = raw_outcome .subscribe - .clone() - .into_iter() + .iter() .map(|(name, _id)| ChannelFullName { application_id, - name, + name: name.clone(), }) .collect::>(); let channels = self.channels.try_load_entries_mut(&full_names).await?; - let stream = raw_outcome.subscribe.into_iter().zip(channels); - let stream = stream::iter(stream) + let subscribe_channels = raw_outcome.subscribe.into_iter().zip(channels); + let stream = stream::iter(subscribe_channels) .map(|((name, id), mut channel)| async move { let mut result = None; let full_name = ChannelFullName { diff --git a/linera-core/src/unit_tests/wasm_worker_tests.rs b/linera-core/src/unit_tests/wasm_worker_tests.rs index b9bc02ed78c..7d2aae9ebdd 100644 --- a/linera-core/src/unit_tests/wasm_worker_tests.rs +++ b/linera-core/src/unit_tests/wasm_worker_tests.rs @@ -339,16 +339,7 @@ where let publisher_state_hash = publisher_system_state.into_hash().await; let accept_block_proposal = HashedCertificateValue::new_confirmed( BlockExecutionOutcome { - messages: vec![vec![OutgoingMessage { - destination: Destination::Recipient(creator_chain.into()), - authenticated_signer: None, - grant: Amount::ZERO, - refund_grant_to: None, - kind: MessageKind::Protected, - message: Message::System(SystemMessage::Notify { - id: creator_chain.into(), - }), - }]], + messages: vec![Vec::new()], events: vec![Vec::new()], state_hash: publisher_state_hash, oracle_responses: vec![Vec::new()], diff --git a/linera-core/src/unit_tests/worker_tests.rs b/linera-core/src/unit_tests/worker_tests.rs index 809dcde0480..6808117b0f3 100644 --- a/linera-core/src/unit_tests/worker_tests.rs +++ b/linera-core/src/unit_tests/worker_tests.rs @@ -2399,11 +2399,7 @@ where &worker, HashedCertificateValue::new_confirmed( BlockExecutionOutcome { - messages: vec![vec![direct_outgoing_message( - user_id, - MessageKind::Protected, - SystemMessage::Notify { id: user_id }, - )]], + messages: vec![Vec::new()], events: vec![Vec::new()], state_hash: SystemExecutionState { // The root chain knows both committees at the end. @@ -2489,13 +2485,11 @@ where .added_bundles .read_front(10) .await?[..], - [bundle1, bundle2, bundle3] + [bundle1, bundle2] if matches!(bundle1.messages[..], [PostedMessage { message: Message::System(SystemMessage::OpenChain(_)), .. }]) && matches!(bundle2.messages[..], [PostedMessage { message: Message::System(SystemMessage::Credit { .. }), .. - }]) && matches!(bundle3.messages[..], [PostedMessage { - message: Message::System(SystemMessage::Notify { .. }), .. }]) ); let channel_inbox = user_chain @@ -2517,8 +2511,8 @@ where &worker, HashedCertificateValue::new_confirmed( BlockExecutionOutcome { - messages: vec![Vec::new(); 4], - events: vec![Vec::new(); 4], + messages: vec![Vec::new(); 3], + events: vec![Vec::new(); 3], state_hash: SystemExecutionState { subscriptions: [ChannelSubscription { chain_id: admin_id, @@ -2534,7 +2528,7 @@ where } .into_hash() .await, - oracle_responses: vec![Vec::new(); 4], + oracle_responses: vec![Vec::new(); 3], } .with( make_first_block(user_id) @@ -2585,18 +2579,6 @@ where .to_posted(1, MessageKind::Tracked)], }, action: MessageAction::Accept, - }) - .with_incoming_bundle(IncomingBundle { - origin: Origin::chain(admin_id), - bundle: MessageBundle { - certificate_hash: certificate2.value.hash(), - height: BlockHeight::from(2), - timestamp: Timestamp::from(0), - transaction_index: 0, - messages: vec![Message::System(SystemMessage::Notify { id: user_id }) - .to_posted(0, MessageKind::Protected)], - }, - action: MessageAction::Accept, }), ), ), @@ -2633,7 +2615,7 @@ where .try_load_entry(&Origin::chain(admin_id)) .await? .expect("Missing inbox for admin chain in user chain"); - assert_eq!(inbox.next_block_height_to_receive()?, BlockHeight(3)); + assert_eq!(inbox.next_block_height_to_receive()?, BlockHeight(2)); assert_eq!(inbox.added_bundles.count(), 0); assert_eq!(inbox.removed_bundles.count(), 0); } diff --git a/linera-execution/src/system.rs b/linera-execution/src/system.rs index 02300fef99e..cff5aa144cb 100644 --- a/linera-execution/src/system.rs +++ b/linera-execution/src/system.rs @@ -247,8 +247,6 @@ pub enum SystemMessage { RegisterApplications { applications: Vec, }, - /// Does nothing. Used to debug the intended recipients of a block. - Notify { id: ChainId }, /// Requests a `RegisterApplication` message from the target chain to register the specified /// application on the sender chain. RequestApplication(UserApplicationId), @@ -281,7 +279,6 @@ impl SystemMessage { | SystemMessage::Subscribe { .. } | SystemMessage::Unsubscribe { .. } | SystemMessage::ApplicationCreated - | SystemMessage::Notify { .. } | SystemMessage::RequestApplication(_) => Box::new(iter::empty()), } } @@ -874,16 +871,6 @@ where subscription.chain_id == context.chain_id, SystemExecutionError::IncorrectChainId(subscription.chain_id) ); - // Notify the subscriber about this block, so that it is included in the - // received_log of the subscriber and correctly synchronized. - let message = RawOutgoingMessage { - destination: Destination::Recipient(id), - authenticated: false, - grant: Amount::ZERO, - kind: MessageKind::Protected, - message: SystemMessage::Notify { id }, - }; - outcome.messages.push(message); outcome.subscribe.push((subscription.name.clone(), id)); } Unsubscribe { id, subscription } => { @@ -891,14 +878,6 @@ where subscription.chain_id == context.chain_id, SystemExecutionError::IncorrectChainId(subscription.chain_id) ); - let message = RawOutgoingMessage { - destination: Destination::Recipient(id), - authenticated: false, - grant: Amount::ZERO, - kind: MessageKind::Protected, - message: SystemMessage::Notify { id }, - }; - outcome.messages.push(message); outcome.unsubscribe.push((subscription.name.clone(), id)); } BytecodePublished { transaction_index } => { @@ -951,7 +930,7 @@ where OpenChain(_) => { // This special message is executed immediately when cross-chain requests are received. } - ApplicationCreated | Notify { .. } => (), + ApplicationCreated => (), } Ok(outcome) } @@ -1061,7 +1040,7 @@ where id: ChainId, ) -> Result>, SystemExecutionError> { let mut messages = Vec::new(); - // Unsubscribe to all channels. + // Unsubscribe from all channels. self.subscriptions .for_each_index(|subscription| { let message = RawOutgoingMessage { diff --git a/linera-rpc/tests/snapshots/format__format.yaml.snap b/linera-rpc/tests/snapshots/format__format.yaml.snap index ace2ed3fab0..8aeec9011bb 100644 --- a/linera-rpc/tests/snapshots/format__format.yaml.snap +++ b/linera-rpc/tests/snapshots/format__format.yaml.snap @@ -923,11 +923,6 @@ SystemMessage: SEQ: TYPENAME: UserApplicationDescription 10: - Notify: - STRUCT: - - id: - TYPENAME: ChainId - 11: RequestApplication: NEWTYPE: TYPENAME: ApplicationId diff --git a/linera-sdk/src/test/chain.rs b/linera-sdk/src/test/chain.rs index 6f28f041aad..5ddd88df981 100644 --- a/linera-sdk/src/test/chain.rs +++ b/linera-sdk/src/test/chain.rs @@ -326,7 +326,7 @@ impl ActiveChain { }) .await; - assert_eq!(accept_certificate.outgoing_message_count(), 1); + assert_eq!(accept_certificate.outgoing_message_count(), 0); self.add_block(|block| { block.with_system_messages_from(&accept_certificate, SystemChannel::PublishedBytecodes);