-
Couldn't load subscription status.
- Fork 18
Check mrenclave and scheduled height before produce blocks(fix #1295) #1416
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
Conversation
194335b to
0eb69b7
Compare
|
Looks like the TEE tests failed. |
|
It was closed because it was wrongly connected to another PR... |
|
Yea this PR #1462 wasn't linked to any issue. It's always a good practice to link the issue that will be fixed by a PR |
8a8adda to
b691f65
Compare
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.
I didn't go very details - only skimmed through the logic in tee-worker/sidechain/consensus/aura/src/block_importer.rs.
I'm not sure why the check logic happens inside a block importer rather than the block proposer. Maybe the argument is we need to import all missing blocks before producing a block but I'm not sure if there's any subtle synchronisation issue.
The scheduled enclave is something we get from parentchain syncing, not from sidechain state. In that sense I think we don't have to rely on the (imported) sidechain block to do this.
Additionally, is get_next_scheduled_enclave correctly implemented?
I think we need such functionality, given a sidechain_block_number, the function should return the expected MRENCALVE. For example, by syncing the parentchain blocks we know that:
| sidechain_block_number | expected_MRENCLAVE |
|---|---|
| 0 | A |
| 20 | B |
| 25 | C |
so:
for input 19 - it should return A => It means we are going to generate block number 19 and we have to check if our MRENCLAVE is equal to A
for input 20 -> it should return B
for input 26 -> it should return C
and so on.
tee-worker/sidechain/consensus/common/src/block_production_suspension.rs
Outdated
Show resolved
Hide resolved
|
And yes - having a feature branch in the same repo would be beneficial for the reviewers to check the code locally :) |
* build_assertion error propagate to parachain (#1456) * AssertionBuildFail: add more details * handle errors in on_success method * emit event when vc is non-exists * remove event * remove VCNotExist from Event * Fix benchmarking pallet-teerex (#1460) * remove tee-dev from node default feature * only rococo has tee-dev * remove sccache in docker * missing RUN * update Dockerfile * sleep for 1 second before the event websocket reconnect(fix #1416) (#1462) * debug: Sync of Moonbeam upstream debug (#1450) * debug: change of test * debug: fix benchmark * Fix the panic from WeightInfo in CI (#1466) * update comment * update runner tag * minor update, cleanup history data * fix errors in teeracle * [benchmarking bot] Auto commit generated weights files (#1465) Co-authored-by: Kailai-Wang <[email protected]> * using pallet weights --------- Co-authored-by: BillyWooo <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Kailai-Wang <[email protected]> * build_assertion error case test (#1463) * error verify * batch call of identity * batch call of vc * format code * delete useless code * verify error identity * create error identities * delete useless code * delete useless code * add comment&delete useless code * format code * txs types * step error vc * catch dispatchError * revoke error test * requestVc error * change assert log * fix merge errors * add checkFailReason * check fail reason * move nonce out loop * format code * change test flow(only use A1 trigger error event) * format code * IDGraph adjustment (#1478) * only keep idgraph for verified event * add get_id_graph_with_max_len * add tee pallets unittests * adjust idgraph and prettier * use context.api for better naming * remove empty lines --------- Co-authored-by: Zhouhui Tian <[email protected]> Co-authored-by: Kai <[email protected]> Co-authored-by: Linfeng.Yuan <[email protected]> Co-authored-by: BillyWooo <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Kailai-Wang <[email protected]> Co-authored-by: Verin1005 <[email protected]>
|
Superseded by #1579 |
block_height >= scheduled block heightblock_height == scheduled block height, migrationresolve #1295