-
Notifications
You must be signed in to change notification settings - Fork 20
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
Resume tee-worker #1050
Resume tee-worker #1050
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job locating the problem.
While there might still be some small problems with reconnection, I'm thinking if we can add tests for it? These tests are actually very important.
We'd need to test:
- parentchain disconnected and reconnected, the workers (both primary and non-primary validateers can still continue
- primary validateers can stop and resume
- non-primary validateers can stop and resume
After we have the tests we can submit a PR to upstream
Looks like still some CI issues? |
None, | ||
) { | ||
Ok(Some(value)) => { | ||
if value.mr_enclave.to_vec() == mrenclave && value.url == trusted_url { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's almost guaranteed that we'll fall into the !found
branch if we are worker-2, as the trusted_url
is different. I don't understand why we still need to register the enclave in this case, but it's the same logic as the original code
Update: we might have some problems in the |
I had updated the |
CI looks good! I think we can merge this one and submit a PR to |
Maybe let's merge this PR and write tests in another PR? @zhizming-zhong |
Of course, after conflicts are resolved and the CI is passed, this PR will be merged into dev branch |
530df53
to
93de6fd
Compare
notice !!! |
Codecov Report
@@ Coverage Diff @@
## dev #1050 +/- ##
==========================================
- Coverage 20.69% 20.62% -0.07%
==========================================
Files 217 217
Lines 9031 9060 +29
==========================================
Hits 1869 1869
- Misses 7162 7191 +29
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks
resolves: #999
resolves: #997This PR:
For #999
We should change the
read_or_init_parachain_validator
function in core/parentchain/light-client/src/io.rs.In this function, the state is cleared every time, so we should rewrite the state after init.
https://github.com/litentry/litentry-parachain/blob/09784f1d74f3882f22062579178ea3041e8daeed/tee-worker/core/parentchain/light-client/src/io.rs#L79-L84
Enclave will be registered each time when tee-worker run. So we shoud check if enclave is already registered each time.
https://github.com/litentry/litentry-parachain/blob/09784f1d74f3882f22062579178ea3041e8daeed/tee-worker/service/src/main.rs#L444-L446
Strongly recommended to manually execute the command to confirm
For #997
substrate-api-client uses library ws, which is difficult to implement reconnection mechanism. So I decided to use tungstenite instead of ws.
To check implementation, see at: https://github.com/litentry/substrate-api-client/tree/new-tungstenite-polkadot-v0.9.29