Skip to content

feat(cli): Add feature flag and CLI parameters for Nano Contracts #941

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

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

msbrogli
Copy link
Member

@msbrogli msbrogli commented Feb 6, 2024

Motivation

Add a feature flag and CLI parameters to run a localnet with NanoContracts enabled. These changes are temporary but they are useful to allow beta testers to experiment with Nano Contracts.

The activation of Nano Contracts for both mainnet and testnet will occur through the Feature Activation. The proper configuration will take place in a future PR.

Acceptance Criteria

  1. Add a protection to prevent enabling Nano Contracts on any network except nano-testnet.
  2. Add the CLI parameters --nano-testnet that will run the full node on a localnet.
  3. Set nano-testnet to use the same version bytes as the testnet but different genesis.
  4. Add feature flag ENABLE_NANO_CONTRACTS which is disabled by default except on the nano-testnet.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@msbrogli msbrogli requested a review from jansegre as a code owner February 6, 2024 21:51
@msbrogli msbrogli self-assigned this Feb 6, 2024
@msbrogli msbrogli added the enhancement New feature or request label Feb 6, 2024
@msbrogli msbrogli force-pushed the feat/nano-feature-flag branch 2 times, most recently from 157bd88 to b50a1b7 Compare February 7, 2024 23:54
@msbrogli msbrogli changed the title feat(nano): Add the feature flag ENABLE_NANO_CONTRACTS feat(cli): Add feature flag and CLI parameters for Nano Contracts Feb 8, 2024
@msbrogli msbrogli force-pushed the feat/nano-feature-flag branch from b50a1b7 to 2df861a Compare February 8, 2024 00:33
@msbrogli msbrogli force-pushed the feat/nano-feature-flag branch from 2df861a to a9baf64 Compare February 8, 2024 05:34
jansegre
jansegre previously approved these changes Feb 8, 2024
Copy link
Member

@jansegre jansegre 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 to me, just looks like some tests that check for the settings have to be updated. Also, nano_testnet.yml does not have a .py module counterpart, I think it's fine tho, I'll open a PR to remove those (done, #942), since they have been deprecated for a while now.

@msbrogli
Copy link
Member Author

msbrogli commented Feb 9, 2024

Looks good to me, just looks like some tests that check for the settings have to be updated. Also, nano_testnet.yml does not have a .py module counterpart, I think it's fine tho, I'll open a PR to remove those (done, #942), since they have been deprecated for a while now.

Fixed!

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (3ce172f) 85.34% compared to head (a7cf1ba) 85.31%.

Files Patch % Lines
hathor/conf/settings.py 50.00% 4 Missing and 1 partial ⚠️
hathor/builder/cli_builder.py 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #941      +/-   ##
==========================================
- Coverage   85.34%   85.31%   -0.04%     
==========================================
  Files         290      291       +1     
  Lines       22511    22526      +15     
  Branches     3388     3391       +3     
==========================================
+ Hits        19212    19217       +5     
- Misses       2628     2634       +6     
- Partials      671      675       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@msbrogli msbrogli merged commit a7cf1ba into master Feb 9, 2024
@msbrogli msbrogli deleted the feat/nano-feature-flag branch February 9, 2024 21:24
@jansegre jansegre mentioned this pull request Feb 15, 2024
2 tasks
@jansegre jansegre mentioned this pull request Feb 26, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants