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 ws support for DI server #2604

Merged
merged 15 commits into from
Mar 21, 2024
Merged

Conversation

Kailai-Wang
Copy link
Collaborator

Context

As topic. It defines a MaybeServerTlsStream struct to wrap up the plain and rustls stream.

Whether launching a ws or wss server will depend on the value of command line arg --trusted-external-address or --T. Although it's called "external", I reckon it makes little sense when launching an "external" wss server while expecting a ws connection internally in our case. If this value is not present, wss will be used as fallback.

Similarly, --untrusted-external-address will fallback to ws.

Now CI uses ws by default.

I can see a potential refactoring of URL management, e.g. use Url by default, better stucture of "internal" and "external" addresses - but it's out of scope of this PR.

@Kailai-Wang Kailai-Wang added the C1-noteworthy Non-breaking change but is worth noticing for client label Mar 20, 2024
@Kailai-Wang Kailai-Wang self-assigned this Mar 20, 2024
Copy link

linear bot commented Mar 20, 2024

@Kailai-Wang
Copy link
Collaborator Author

cc @BillyWooo @felixfaisal - once merged and deployed, we need to review the -T setting

Copy link
Member

@kziemianek kziemianek left a comment

Choose a reason for hiding this comment

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

Should we adjust usage of cli ?

Looks like link_identity fails after this change

kziemianek@kziemianek:~/projects/litentry/litentry-parachain/tee-worker/bin$ ./litentry-cli trusted -d link-identity did:litentry:substrate:0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 did:litentry:evm:0x0D9bFD1f18f5f4FD08247DC54aD3528909c4b3E9 bsc,ethereum
[2024-03-21T11:34:53.433Z ERROR ws::handler] WS Error <Io(Custom { kind: Other, error: "unexpected EOF" })>
thread 'main' panicked at 'Unable to retrieve MRENCLAVE from endpoint: MspcReceiver(RecvError)', cli/src/trusted_command_utils.rs:88:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@Kailai-Wang
Copy link
Collaborator Author

Should we adjust usage of cli ?

Looks like link_identity fails after this change

kziemianek@kziemianek:~/projects/litentry/litentry-parachain/tee-worker/bin$ ./litentry-cli trusted -d link-identity did:litentry:substrate:0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48 did:litentry:evm:0x0D9bFD1f18f5f4FD08247DC54aD3528909c4b3E9 bsc,ethereum
[2024-03-21T11:34:53.433Z ERROR ws::handler] WS Error <Io(Custom { kind: Other, error: "unexpected EOF" })>
thread 'main' panicked at 'Unable to retrieve MRENCLAVE from endpoint: MspcReceiver(RecvError)', cli/src/trusted_command_utils.rs:88:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Thanks!
Now the CLI should use ws by default

@Kailai-Wang Kailai-Wang merged commit 6e45b49 into dev Mar 21, 2024
24 of 26 checks passed
@Kailai-Wang Kailai-Wang deleted the p-399-add-ws-support-for-di-server branch March 21, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-noteworthy Non-breaking change but is worth noticing for client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants