-
Notifications
You must be signed in to change notification settings - Fork 42
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
Subnet registry to deploy upgradeable subnet actors #822
Conversation
…t generated flatly in the typechain/factories folder
… the registry deploys have the diamondcut and diamondLoupe Factes on them.
…ved to json and allow subnet actor upgrades to pass in the contract address
@@ -20,7 +20,7 @@ upgrade-gw-diamond: | |||
./ops/upgrade-gw-diamond.sh $(NETWORK) | |||
|
|||
upgrade-sa-diamond: | |||
./ops/upgrade-sa-diamond.sh $(NETWORK) | |||
./ops/upgrade-sa-diamond.sh $(NETWORK) $(SUBNET_ACTOR_ADDRESS) | |||
|
|||
upgrade-sr-diamond: |
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.
Hi @snissn, just a quick question for upgrading subnet-registry
, if the subnet actor code has updated, and an we want the registry to deploy new version of SubnetActor
, after an upgrade of SubnetRegistry, will the registry start deploying the newer version of the Subnet Actor?
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.
Hey will! The answer should be yes. Using the upgrade code to upgrade src/subnetregistry/RegisterSubnetFacet.sol
in the registry should change the deploy path for new subnets.
EthFacet { | ||
name: "DiamondLoupeFacet", | ||
abi: ia::diamond_loupe_facet::DIAMONDLOUPEFACET_ABI.to_owned(), | ||
}, | ||
EthFacet { | ||
name: "DiamondCutFacet", | ||
abi: ia::diamond_cut_facet::DIAMONDCUTFACET_ABI.to_owned(), | ||
}, | ||
EthFacet { | ||
name: "OwnershipFacet", | ||
abi: ia::ownership_facet::OWNERSHIPFACET_ABI.to_owned(), | ||
}, |
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.
We were missing these facets from the gateway. Although the owner address will be f01 (Init actor), as that's the actor that creates the gateway and the registry during genesis:
from: init::INIT_ACTOR_ADDR, // asserted by the constructor |
Which means that we anyway can't upgrade the gateway and registry actors inside a subnet without a hard fork.
295202b
to
c16789e
Compare
Change subnet registry so that subnet actors the registry deploys have the diamondcut and diamondLoupe Factes on them
Blocker: ENG-29 RegisterSubnetFacet diamond constructor missing Loupe and DiamondCut
newSubnetActor
SubnetRegistryDiamond.sol
for 2 more facetsconstructorParams
bytes4[] subnetActorDiamondCutSelectors;
bytes4[] subnetActorLoupeSelectors;
address diamondCutFacet;
address loupeFacet;
./lib/LibSubnetRegistryStorage.sol
address SUBNET_ACTOR_DIAMOND_CUT_FACET;
address SUBNET_ACTOR_LOUPE_FACET;
bytes4[] subnetActorDiamondCutSelectors;
bytes4[] subnetActorLoupeSelectors;
deploy-registry.ts
needs to deploy DiamondCut and Loupe facetsUpgrade Code
subnet.actor-{address.}json
Testing plan
ipc-cli subnet create --parent /r1337 --min-validators 3 --min-validator-stake 1 --bottomup-check-period 30 --permission-mode collateral --supply-source-kind native --from 0xAddress
ipc/contracts$ make upgrade-sa-diamond SUBNET_ACTOR_ADDRESS=0xed27b8e0f2f382195d1a71d55edccb9acccb6daf
subnet.actor-0xed27b8e0f2f382195d1a71d55edccb9acccb6daf.json
and archive that information for the future because subsequent upgrades from this make file will expect that to be there