SIMD-0431: Loader V3: Permissioned Extend Program#431
SIMD-0431: Loader V3: Permissioned Extend Program#431deanmlittle wants to merge 14 commits intosolana-foundation:mainfrom
Conversation
|
Hello deanmlittle! Welcome to the SIMD process. By opening this PR you are affirming that your SIMD has been thoroughly discussed and vetted in the SIMD discussion section. The SIMD PR section should only be used to submit a final technical specification for review. If your design / idea still needs discussion, please close this PR and create a new discussion here. This PR requires the following approvals before it can be merged:
Once all requirements are met, you can merge this PR by commenting |
|
Lgtm |
|
@0xRigel requesting your review as this pertains to multisig wallets like Squads. I know we discussed at breakpoint but worth double checking you don't foresee any issues. I think it is actually as simple as throwing a lighthouse instruction at the end to ensure the authority doesn't change. |
|
Whats the current reason for Aside from that, this looks good. We'll just have to make a few adjusments to the UI's under the hood logic for extend program. |
ACK, thanks for reviewing! There are a many dumb restrictions on LoaderV3 due to security issues that can arise as a result of problematic account midstates created during the upgrade process. Hopefully we can ship a few more fixes that would allow us to relax these constraints in the future! |
buffalojoec
left a comment
There was a problem hiding this comment.
I think this proposal could actually use a bit of fleshing out for context.
I've written a draft implementation here: anza-xyz/agave#9859
The first major issue I found is that we'd actually need to break the
ExtendProgram instruction's accounts list beyond just requiring a signature.
The authority is actually not a member of the required accounts for
ExtendProgram. We would need to add it.
For this reason, I'm actually considering SIMD-0164 as a preferred solution. We
would introduce a new instruction with a new accounts list and deprecate the
old one.
Since callers will have to modify their code anyway in order to support the
ExtendProgram instruction after this feature, are we certain changing the
existing instruction is cleaner? It seems like maybe not.
Additionally, this proposal can probably add more details about some of the
deliberation that occurred in SIMD-0164. After all, it's going to be the exact
same design, just a different rollout strategy.
There was a bit of discussion about how this change affects multisigs. However,
in SIMD-0164 and also here in this proposal (via ack by @0xRigel) these
concerns were curtailed. We can probably at least mention how this affects
multisigs in one of the lower sections of the SIMD.
@Lichtso also added context to SIMD-0164 about already-deployed, possibly
frozen programs. This proposal will have the same issues.
We probably have to add that ExtendProgram will be accessible via CPI as a
result of this proposal's feature activation. If we don't, self-upgrading
programs won't be able to invoke ExtendProgram via CPI with their PDA
signers.
I am of the opinion that simply modifying the existing instruction makes more sense for several reasons:
Thus 164 is actually doing more work to achieve the same outcome. For that reason, I do not think 164 is a better solution. |
I re-read SIMD-0164 any yes you are right, it does not mention the old one being disabled, but that would be my intention. Can update that SIMD.
It is not about displaying error messages but preventing unauthorized access from others. Currently |
|
I believe I have addressed all outstanding feedback. It is really just a matter of making the decision of whether we go with #164 or #431. As we would be throwing a missing signer error either way, I find no justification to pollute our Enum with an additional instruction when we can simply modify the existing one to achieve the same result. |
OK, I can appreciate these points. I did some digging, and it seems like we've used both methods, but it depends on what we've historically done with the previous wire format. For example, with System's With ALT, we relaxed signer requirements for So, since we don't wish to support the old version (as @deanmlittle said above) and we will break the program's interface either way (as I said in the second block of this comment), this proposal does in fact appear to be cleaner to me. |
SIMD-0431: flesh out detailed design
Clarify security considerations and alternatives in the proposal.
| constraints of ABI V1, in the case that a multisig upgrade authority wishes to | ||
| extend the program data account by greater than 10KiB, it will either need to | ||
| create multiple resize proposals, or atomically set its authority to a | ||
| top-level signer and reclaim it in the same transaction. The `ExtendProgram` |
There was a problem hiding this comment.
| top-level signer and reclaim it in the same transaction. The `ExtendProgram` | |
| top-level signer and extend it in the same transaction. The `ExtendProgram` |
think this is what you meant here?
There was a problem hiding this comment.
That line means reclaim the authority after extending at top-level with the temporary authority.
|
The only reason why If we make it permissioned self upgrading programs would have to use the transient (but atomic) authority shuffle pattern to sign In that sense neither SIMD-0431 nor SIMD-0164 are needed, we can just disable |
The authority shuffle is very clunky, and I agree with you that if we do have to shuffle, why not just combine this into upgrade directly? Upon reevaluating our options, I think I actually have an even better solution to this. I think we should instead:
By doing so, Extend can remain "permissionless" as it is today, so none of our workflows change, but it can piggyback on the safety of the |
Only top-level instructions are known ahead of time. For self upgrading programs the By then it becomes very similar to the retract-modify-redeploy-workflow in the early designs of loader-v4. With the difference being that loader-v4 explicitly persisted the retracted state in the program account, while this dirty flag here would be implicit and only exist during the transaction. |
Ahh yeah, you're right. Though I suppose we could go the other way and have the upgrade instruction introspect for the |
No description provided.