Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add channel_read_with_downgrade to SDK #1837

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

ipetr0v
Copy link
Contributor

@ipetr0v ipetr0v commented Jan 11, 2021

This change adds:

  • channel_read_with_downgrade to ABI and SDK
  • channel_try_read_message_with_downgrade to Runtime

Ref #1736

@google-cla google-cla bot added the cla: yes label Jan 11, 2021
@ipetr0v ipetr0v marked this pull request as ready for review January 12, 2021 13:45
@ipetr0v
Copy link
Contributor Author

ipetr0v commented Jan 12, 2021

Also adding tests, but they require signing modules in abitest.
Not sure if it's ok to sign them, or abitest supposed to be IFC free.

This might probably be necessary for other IFC tests (for example, since we don't have channel_write_with_downgrade tests yet).

@ipetr0v
Copy link
Contributor Author

ipetr0v commented Jan 12, 2021

Added tests but disabled them, because they (as well as any IFC test) require working reproducibility #865

@@ -153,6 +161,11 @@ impl<T: Decodable> ReceiverExt<T> for Receiver<T> {
}
}

fn receive_with_downgrade(&self) -> Result<T, OakError> {
self.wait()?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there not be a wait_with_downgrade? Knowing that a message has become available leaks information as well, so a node should not be able to wait on a channel from which it cannot read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented it in #1839 (will add after the merge)
Will add a TODO in this PR

examples/abitest/README.md Outdated Show resolved Hide resolved
oak_runtime/src/node/wasm/mod.rs Outdated Show resolved Hide resolved
examples/abitest/backend_module.sign Outdated Show resolved Hide resolved
examples/abitest/module_0/rust/src/lib.rs Outdated Show resolved Hide resolved
Update deps

Update deps

Update SDK

Update experimental

Update runtime

Add test

Update after review

Delete base64

Close channels

Update hashes

Update hashes

Update deny

Update deny

Fix consts
@ipetr0v ipetr0v merged commit 61ecb0b into project-oak:main Feb 9, 2021
@ipetr0v ipetr0v deleted the channel_read_with_downgrade branch February 9, 2021 16:34
@github-actions
Copy link

github-actions bot commented Feb 9, 2021

Reproducibility Index:

8c72eaa14887bd90799f215faf0641d497b0e0007d9853289a7e3dfbc177ed5f  ./examples/abitest/bin/abitest_0_frontend.wasm
ba8998cfb93ef6f5eaa56f2c68f252cbb52314a0fe218e11bee9ca67906e0cc9  ./examples/abitest/bin/abitest_1_backend.wasm
108864ffe7e2e478429dd29ea832b34ff59d2ad311f5b2cb8355767614172919  ./examples/aggregator/bin/aggregator.wasm
a507ddc9397f99732c5f2a93b0cc67329ec75ec93cca1c1764b735e0551c1ce6  ./examples/chat/bin/chat.wasm
6c998f3e14e09638d9fe7ea35cd8fde0242ffeb8fcda6976632bfc0e689421e9  ./examples/hello_world/bin/hello_world.wasm
18c1587164a465bfb060b51092419a81e341be58807624f35053291121eee922  ./examples/hello_world/bin/translator.wasm
ddd753b53270d23ca0717a2bbcb404ecd91cdb81f0d3918a856d0b383ce8f479  ./examples/http_server/bin/http_server.wasm
19c63f06e2648dfbd3aa57b6c866edaa5a9e33971b9e6082f3607e8b9bff4c97  ./examples/injection/bin/injection.wasm
bd603a81ca1d3c51504116803753b148b24e0363f883a4719d85aff4620c231a  ./examples/private_set_intersection/bin/private_set_intersection.wasm
40a1795df36da525d78d872bba92685fb78adaaf509d86e6d6edf310c86af348  ./examples/private_set_intersection/bin/private_set_intersection_handler.wasm
18c1587164a465bfb060b51092419a81e341be58807624f35053291121eee922  ./examples/translator/bin/translator.wasm
d35e7c4f85d875ef443b75097e1ef39d025e8df334a60ca5d5cfdde4d0cac1b9  ./examples/trusted_database/bin/trusted_database.wasm
e1eb866a74cc93179ae4df2a3069c01429b1b247f3685ff87d024cdc2e79b002  ./oak_loader/bin/oak_loader

Reproducibility Index diff:

diff --git a/reproducibility_index b/reproducibility_index
index bd99181..ebaa1c6 100644
--- a/reproducibility_index
+++ b/reproducibility_index
@@ -1,13 +1,13 @@
-6f651fd0da154010969d3dbac57a7880c2ed2a91d8246484c7247be7c4db4667  ./examples/abitest/bin/abitest_0_frontend.wasm
-f7ac0a621db5c53b3f86f77238f4df1ed5c6af09a63bf674a746678f2cb0644c  ./examples/abitest/bin/abitest_1_backend.wasm
-9c108f615413aa114e68438d0f902b502e6c1c5e7d4fe7bb8bc7b750d4def60e  ./examples/aggregator/bin/aggregator.wasm
-3105aacfdb98ef516ec58497acfb72a3af591a67faffd6c2a2aa7df98409e68d  ./examples/chat/bin/chat.wasm
-1a8257aed76024e8a5c1f400a9657402b46ace69fc26bb4849f87c38ea2b2e96  ./examples/hello_world/bin/hello_world.wasm
-8c97d83fe6aa157dbbb01b0931e206bc4d9da058adfc2e0df46a7d1979c495c2  ./examples/hello_world/bin/translator.wasm
-00dc476d438a40e46fd5827bfc9e553d1074d3224117f4cb47057f099cb1ca56  ./examples/http_server/bin/http_server.wasm
-b43a49ae8e06e165e282ed877050f1ab61ac84ffed8d04011c5dfbd9ea79b5e6  ./examples/injection/bin/injection.wasm
-3d525c7bf98f76a3ac545ecd14722d900a804c91c69f04afd33b2e41a7e8a32a  ./examples/private_set_intersection/bin/private_set_intersection.wasm
-e7baa8bbf76625baa88769d8a31e250886ad5ab527a7af0f0474400b278e5530  ./examples/private_set_intersection/bin/private_set_intersection_handler.wasm
-8c97d83fe6aa157dbbb01b0931e206bc4d9da058adfc2e0df46a7d1979c495c2  ./examples/translator/bin/translator.wasm
-281511f222523d02d7a369d6b00c8f4e80d3ad6754af29a04e8b4864fbc1a2bc  ./examples/trusted_database/bin/trusted_database.wasm
-a9e4ba0d9ee51cefc87c386bd95cd21120511199884f97694f7c6715c47e6348  ./oak_loader/bin/oak_loader
+8c72eaa14887bd90799f215faf0641d497b0e0007d9853289a7e3dfbc177ed5f  ./examples/abitest/bin/abitest_0_frontend.wasm
+ba8998cfb93ef6f5eaa56f2c68f252cbb52314a0fe218e11bee9ca67906e0cc9  ./examples/abitest/bin/abitest_1_backend.wasm
+108864ffe7e2e478429dd29ea832b34ff59d2ad311f5b2cb8355767614172919  ./examples/aggregator/bin/aggregator.wasm
+a507ddc9397f99732c5f2a93b0cc67329ec75ec93cca1c1764b735e0551c1ce6  ./examples/chat/bin/chat.wasm
+6c998f3e14e09638d9fe7ea35cd8fde0242ffeb8fcda6976632bfc0e689421e9  ./examples/hello_world/bin/hello_world.wasm
+18c1587164a465bfb060b51092419a81e341be58807624f35053291121eee922  ./examples/hello_world/bin/translator.wasm
+ddd753b53270d23ca0717a2bbcb404ecd91cdb81f0d3918a856d0b383ce8f479  ./examples/http_server/bin/http_server.wasm
+19c63f06e2648dfbd3aa57b6c866edaa5a9e33971b9e6082f3607e8b9bff4c97  ./examples/injection/bin/injection.wasm
+bd603a81ca1d3c51504116803753b148b24e0363f883a4719d85aff4620c231a  ./examples/private_set_intersection/bin/private_set_intersection.wasm
+40a1795df36da525d78d872bba92685fb78adaaf509d86e6d6edf310c86af348  ./examples/private_set_intersection/bin/private_set_intersection_handler.wasm
+18c1587164a465bfb060b51092419a81e341be58807624f35053291121eee922  ./examples/translator/bin/translator.wasm
+d35e7c4f85d875ef443b75097e1ef39d025e8df334a60ca5d5cfdde4d0cac1b9  ./examples/trusted_database/bin/trusted_database.wasm
+e1eb866a74cc93179ae4df2a3069c01429b1b247f3685ff87d024cdc2e79b002  ./oak_loader/bin/oak_loader

@@ -49,6 +49,9 @@ pub extern "C" fn wait_on_channels() {
pub extern "C" fn channel_read() {
panic!("stub function invoked!");
}
pub extern "C" fn channel_read_with_downgrade() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing the #[no_mangle] so doesn't work as a stub, btw.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in #1839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants