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

Refactor teerex/sidechain pallet into teebag #2459

Merged
merged 13 commits into from
Feb 2, 2024

Conversation

Kailai-Wang
Copy link
Collaborator

@Kailai-Wang Kailai-Wang commented Feb 1, 2024

Context

This PR uses a new pallet teebag to replace teerex + sidechain pallet.

It uses the name teebag because enclave is like a teabag and the pallet is used to manage the teabag.

Additionally:

  • it removes the feature skip-ias-verify and changes it to runtime control
  • it merges the original teerex and sidechain pallets (version before MS-RSL licence) into one and rewrite/update it - it still has a mixed licence header tho, especially for the parts that I hardly made any changes
  • it adds worker_type to allow multiple worker types
  • it removes heartbeat for now - we'll need to think about how to deal with it, plus we have the enclave removal extrinsic
  • it revamps the Enclave structure, the map uses the T::AccountId as the key, because that's (the only identifier?) guaranteed to be different for each worker and has a native parachain connection
  • it moves sgx-verify from crate to mod
  • it unifies the tests with and without ias-verify

Some follow-up TODOs - I'll create issues:

  • let workers connect to pallet-teebag (while keeping teerex for state reference)
  • benchmarking / weights
  • remove teerex/sidechain pallet usage in runtime and worker
  • runtime upgrade to include the changes, including state migration to clear the teerex state

But before I continue I'd like to see reviews about this refactoring

@Kailai-Wang Kailai-Wang self-assigned this Feb 1, 2024
Copy link

linear bot commented Feb 1, 2024

Copy link
Member

@felixfaisal felixfaisal left a comment

Choose a reason for hiding this comment

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

Thanks @Kailai-Wang ,In terms of the refactor itself, I don't see any concerns, I don't know much about the attestation process, So from my side it looks good.

@Kailai-Wang Kailai-Wang requested review from zhouhuitian and a team February 2, 2024 07:54
pallets/teebag/src/lib.rs Show resolved Hide resolved
pallets/teebag/src/lib.rs Show resolved Hide resolved
pallets/teebag/src/lib.rs Outdated Show resolved Hide resolved
pallets/teebag/src/lib.rs Show resolved Hide resolved
pallets/teebag/src/lib.rs Show resolved Hide resolved
pallets/teebag/src/lib.rs Show resolved Hide resolved
pallets/teebag/src/tests.rs Show resolved Hide resolved
pallets/teebag/src/tests.rs Show resolved Hide resolved
pallets/teebag/src/lib.rs Show resolved Hide resolved
@Kailai-Wang Kailai-Wang enabled auto-merge (squash) February 2, 2024 17:08
@Kailai-Wang Kailai-Wang merged commit 04016d2 into dev Feb 2, 2024
34 checks passed
@Kailai-Wang Kailai-Wang deleted the p-443-refactor-teerexsidechain-pallet branch February 2, 2024 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants