-
Notifications
You must be signed in to change notification settings - Fork 39
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
Set subnet owner explicitly + OwnableFacet for Gateway, SA, Registry #785
Changes from 1 commit
b718ddb
3e2360d
c0264a0
bc031d8
5b1d4f3
7b9189d
f2b97c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,7 @@ contract RegisterSubnetFacet is ReentrancyGuard { | |
}); | ||
|
||
// slither-disable-next-line reentrancy-benign | ||
subnetAddr = address(new SubnetActorDiamond(diamondCut, _params)); | ||
subnetAddr = address(new SubnetActorDiamond(diamondCut, _params, msg.sender)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the registry will set it to the sender, which seems reasonable, however my impression was that the creator should be able to specify a multisig address if they wanted to, so the power over the federated weights aren't in one hand. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe registry should also accept it as a parameter? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand that requires modifying the Rust code as well, so I'll defer to others for what to do here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd keep it the way this PR proposes. In a monolithic permissioning model, it's highly conventional in smart contracts that the creator of X becomes the first owner and full controller of X; the creator can be the multisig. My bet is that we will want a finer-grained permissioning model going forward (e.g. perms for relaying, checkpointing submission, upgrades, lifecycle actions, etc.), so it's not worth to introduce something adhoc here now. One thing we should do is add the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a |
||
|
||
//nonces start with 1, similar to eip 161 | ||
++s.userNonces[msg.sender]; | ||
|
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.
Why not add it to the constructor params?
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.
Initially I thought this way will draw much more attention to this parameter as it's perhaps the single most important parameter. Then, from a practical point of view, it will not break a lot of existing code, it's gentler on
ipc
and unit tests.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.
Hm, but it seems to go against the grain of it, doesn't it? To have all parameters, plus this on the side?
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.
The owner indeed tends to be a "meta" parameter as it governs the contracts themselves, not the logic of the subnet. We should rename
ConstructorParams
toSubnetConfig
(as it represents the subnet configuration and it's not the totality of the constructor params) to make it clearer down the line.That said, I would move the owner to the 2nd place to have all contract metadata params leading, then followed by the subnet config.