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

fix: add storage item for feature control #2382

Merged
merged 41 commits into from
Jan 23, 2024

Conversation

felixfaisal
Copy link
Member

@felixfaisal felixfaisal commented Jan 5, 2024

This PR updates the code to make use of storage item instead of feature-guard for skip-scheduled-enclave-check

  • Generate Weights for new extrinsic
    So I initially thought that I would need to benchmark this new extrinsic, but I also see that not all extrinsics are benchmarked, and I'm using the same weights as one of the extrinsics, I think the operation of this extrinsic fairly simple as it performs a single write, So I also don't think we need to perform actually benchmarking as there is no worst case complexity.
  • Unit test to test this PR
    So I've updated the unit tests to make use of the storage item instead of feature guards.

I'm actually not sure if this PR does all the necessary changes 😅

  • So we can also do the same skip-ias-dev but I want to do it another PR and not in this
  • We have to update deploy.sh however I'm not sure if we have to Alice as root in production environment or we should manually call this extrinsic

Copy link

linear bot commented Jan 5, 2024

@felixfaisal felixfaisal marked this pull request as ready for review January 10, 2024 07:22
@felixfaisal felixfaisal requested review from Kailai-Wang, BillyWooo and a team January 10, 2024 07:22
…hub.com:litentry/litentry-parachain into p-356-prefer-runtime-control-over-feature-guard
Copy link
Collaborator

@Kailai-Wang Kailai-Wang left a comment

Choose a reason for hiding this comment

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

Thanks!

We have to update deploy.sh however I'm not sure if we have to Alice as root in production environment or we should manually call this extrinsic

In prod we have parachains already running, so we have to either rely on the default value of this storage, or set it manually (which is hard for automation)

pallets/teerex/src/lib.rs Outdated Show resolved Hide resolved
pallets/teerex/src/lib.rs Outdated Show resolved Hide resolved
pallets/teerex/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@Kailai-Wang Kailai-Wang left a comment

Choose a reason for hiding this comment

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

Looks good now! Only a small thing

pallets/teerex/src/lib.rs Outdated Show resolved Hide resolved
@kziemianek
Copy link
Member

What do you think about letting primary validateer (first worker to register in teerex's enclave registry) to set scheduled mrenclave to it's actual mrenclave in dev ?

Would we still need skip-scheduled-enclave-check feature/fag ?

@Kailai-Wang
Copy link
Collaborator

What do you think about letting primary validateer (first worker to register in teerex's enclave registry) to set scheduled mrenclave to it's actual mrenclave in dev ?

Would we still need skip-scheduled-enclave-check feature/fag ?

We could do that but it will still require scheduled-enclave-check for subsequent registration. So it saves the step to set the first / genesis mrenclave from external

@kziemianek
Copy link
Member

What do you think about letting primary validateer (first worker to register in teerex's enclave registry) to set scheduled mrenclave to it's actual mrenclave in dev ?
Would we still need skip-scheduled-enclave-check feature/fag ?

We could do that but it will still require scheduled-enclave-check for subsequent registration. So it saves the step to set the first / genesis mrenclave from external

You mean if code changes ... hmm maybe we can override it everytime.

@felixfaisal
Copy link
Member Author

So I made a few changes

  • Instead of calling an extrinsic during local-setup, I've included this in the genesis spec for rococo-dev chain
  • This was because I had a few CI problems, and I felt this was also better than calling an extrinsic during the launch.

Copy link
Collaborator

@Kailai-Wang Kailai-Wang left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! Just one small thing

scripts/launch-standalone.sh Outdated Show resolved Hide resolved
@felixfaisal felixfaisal enabled auto-merge (squash) January 22, 2024 13:39
@Kailai-Wang
Copy link
Collaborator

Hmm there seems to be CI error

@felixfaisal felixfaisal merged commit b62e965 into dev Jan 23, 2024
32 checks passed
@felixfaisal felixfaisal deleted the p-356-prefer-runtime-control-over-feature-guard branch January 24, 2024 06:26
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.

4 participants