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

StandardSubscription #339

Merged
merged 6 commits into from
Jan 17, 2025
Merged

StandardSubscription #339

merged 6 commits into from
Jan 17, 2025

Conversation

cygnusv
Copy link
Member

@cygnusv cygnusv commented Jan 15, 2025

Type of PR:

  • Bugfix
  • Feature
  • Documentation
  • Other

Required reviews:

  • 1
  • 2
  • 3

What this does:

  • Generalizes BqETHSubscription to StandardSubscription
  • New subscription parameters (see https://docs.taco.build/fees/mainnet-fees)
  • GlobalAllowList is now upgradeable
  • Deployed new GlobalAllowList and new StandardSusbcription to Polygon Mainnet (including proxies and ProxyAdmins)
  • Some updates to mainnet registry (there's some caveats that @derekpierre raised but that we don't need to decide now)

Issues fixed/closed:

  • Fixes #...

Why it's needed:

Explain how this PR fits in the greater context of the NuCypher Network.
E.g., if this PR address a nucypher/productdev issue, let reviewers know!

Notes for reviewers:

What should reviewers focus on?
Is there a particular commit/function/section of your PR that requires more attention from reviewers?

@derekpierre
Copy link
Member

derekpierre commented Jan 15, 2025

Since the name of the subscription contract has changed:

Maybe it makes sense to add a subscriptions folder to house subscription deployments for adopters.

@@ -1796,813 +1796,6 @@
}
},
"137": {
"BqETHSubscription": {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to save this entry in a separate bqeth.json file for deployment tracking purposes (with the rename of course), or is that tracked already somewhere else? Basically what you did for the marlin deployment in new-subscription-mainnet.json.

@@ -0,0 +1,1039 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Should we rename to marlin.json or something analogous?

Copy link
Member

Choose a reason for hiding this comment

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

Also, do we need GlobalAllowList in this file since it is already tracked in mainnet.json? I guess it is a remnant from the fact that the deployment included a fresh deployment of GlobalAllowList - but for the purposes of the subscription registry tracking for marlin, isn't really needed.

@@ -0,0 +1,65 @@
deployment:
Copy link
Member

Choose a reason for hiding this comment

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

Should we call this file marlin-subscruption.yml?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not necessarily, there's nothing in here that's specific to them. It's just the updated fees and parameters for every potential new subscription. In this case, we include as well logic to deploy a new GlobalAllowList (coincidentally, this happened with BqETH too) but that can be removed when we deploy another new subscription.

Copy link
Member

Choose a reason for hiding this comment

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

I guess we really did two separate actions in one script:

  • deploy a new global allow list contract (only needed this time, but not unless there are future changes to global allow list).
  • deploy a new subscription contract based on parameters.

Moving forward, a "new subscription" would only use the 2nd part with some potential tweaks to the values eg. duration. Just trying to think about our code maintenance moving forward - this params file and the associated script would need to remove the global allow list component the next time we do a subscription.

Not something to be done for this PR but some follow-up reorg can be done afterward eg.

  • separate params/script for updating global allow list implementation
  • update "new subscription files" to not include anything with global allow list so that is more of a base that can be used for other adopters.

@@ -91,6 +91,20 @@ def global_allow_list(project, deployer, coordinator):
return contract


@pytest.fixture()
def upgradeable_global_allow_list(project, deployer, coordinator, oz_dependency):
Copy link
Member

Choose a reason for hiding this comment

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

Do we envision using an upgradeable global allow list moving forward by default? If so, should we just update the original global_allow_list fixture to use a proxied instance?

Copy link
Member

Choose a reason for hiding this comment

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

I'd keep original global allow list intact and transform this upgradeable to the managed allow list after it will be ready.
wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

If so, should we just update the original global_allow_list fixture to use a proxied instance?

In tests I keep both versions and parametrize the test.

Copy link
Member

Choose a reason for hiding this comment

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

In tests I keep both versions and parametrize the test.

Yep, just thinking that we don't really need both since the testing of either is the same, but not an issue if you want to keep both.

From the test's perspective, whether proxied or not doesn't functionally matter - but a proxied contract is what is deployed so we would match what is deployed.

We duplicate this fixture in other places too which we should proxy:

There is an issue for cleaning up duplicated fixtures across nucypher-contracts, and this can be addressed then - #284

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, let's address that as part of #284

Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

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

My comments are more related to code/artifact organization, but the contracts/scripts updates look good.

@cygnusv
Copy link
Member Author

cygnusv commented Jan 16, 2025

Let's address artifacts reorganization in a subsequent PR. I don't have enough clarity of what's the best way moving forward, particularly since I think there's reliance from code in nucypher (see nucypher/nucypher#3503) and nucypher-contracts (e.g. https://github.com/nucypher/nucypher-contracts/blob/main/scripts/manage_subscription.py) on the presence of specific entries in the registry. To be clear, I'm not advocating to keep these in the registry (I also agree that the registry should only be used to keep protocol specific contracts), but these dependencies should be removed first.

Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

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

🎸

@cygnusv cygnusv marked this pull request as ready for review January 16, 2025 16:32
@cygnusv cygnusv merged commit 6c6b618 into nucypher:main Jan 17, 2025
2 checks passed
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.

3 participants