Skip to content

Gate Initialize by Hardcoded Deployer Address - #191

Merged
kaze-cow merged 11 commits into
mainfrom
kaze/sc-438-gate-initialize-with-the-program-upgrade-authority-2
Oct 9, 2026
Merged

kaze-cow merged 11 commits into
mainfrom
kaze/sc-438-gate-initialize-with-the-program-upgrade-authority-2

Conversation

@kaze-cow

@kaze-cow kaze-cow commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Make it so that only a hardcoded address defined in the program can call Initialize.

Motivation

Its technically possible that after program deployment, someone could come in and call Initialize, setting their own data and permissions, prior to us being able to do so. This, and could cause us to lose the ability to use a deployment address that we want to use. To prevent this from happening, we need some access control.

Other considerations

It was also previously considered in #187 to use the BPF Upgradalbe loader's upgrade authority. In honesty this is probably the best way to go as the deployer would always be matched up with whoever actually pushed up the program, but we are in a hurry and this option is much simpler and works almost as well.

In the case that the program is accidentally deployed with the wrong DEPLOYER set, it is possible for the upgrade authority to redeploy the program with the correct DEPLOYER and try again, so the consequences of a mistaken deployment are low.

@linear-code

linear-code Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

SC-438

…thority-2' of github.com:cowprotocol/solana-programs into kaze/sc-438-gate-initialize-with-the-program-upgrade-authority-2
@kaze-cow
kaze-cow marked this pull request as ready for review October 9, 2026 07:40
@kaze-cow
kaze-cow requested a review from a team as a code owner October 9, 2026 07:40
@kaze-cow kaze-cow changed the title gate initialize 2 Gate Initialize by Hardcoded Deployer Address Oct 9, 2026

@fedgiac fedgiac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. Main suggested change is that I don't like the name deployer because there's nothing in the code that really needs for this to be the actual deployer, it's just our own conventions leading to this. I suggest initializer everywhere instead.

Comment thread interface/src/instruction/initialize.rs
Comment thread programs/settlement/idl/client/js/tests/fixtures.ts
Comment thread programs/settlement/src/processor/initialize.rs Outdated
Comment thread programs/settlement/tests/common/mod.rs Outdated
Comment thread programs/settlement/tests/common/mod.rs Outdated
Comment thread programs/settlement/tests/common/state.rs Outdated
Comment thread bench-report.json
kaze-cow and others added 6 commits October 9, 2026 19:18
Co-authored-by: Federico Giacon <58218759+fedgiac@users.noreply.github.com>
Co-authored-by: Federico Giacon <58218759+fedgiac@users.noreply.github.com>
…thority-2' of github.com:cowprotocol/solana-programs into kaze/sc-438-gate-initialize-with-the-program-upgrade-authority-2
@kaze-cow
kaze-cow requested a review from fedgiac October 9, 2026 10:46

@fedgiac fedgiac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

@kaze-cow
kaze-cow merged commit 354bd28 into main Oct 9, 2026
18 of 19 checks passed
@kaze-cow
kaze-cow deleted the kaze/sc-438-gate-initialize-with-the-program-upgrade-authority-2 branch October 9, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants