Commit 3691e8a
feat(build): dual-cluster Cargo features for compile-time program ID
Apply Pattern D from lazorkit-protocol PR #9: the embedded program ID
is now chosen by `--features mainnet` or `--features devnet`, with a
`compile_error!` if neither (or both) is set. Prevents accidental
cross-cluster deploys — a binary compiled with one ID malfunctions if
deployed to the other cluster's slot.
Mainnet feature embeds LazorjRFNavitUaBu5m3WaNPjU1maipvSW2rZfAFAKi —
the SAME program ID as lazorkit-protocol. program-v2 (foundation,
no-fee build) occupies that mainnet slot for the duration of the
foundation contract; at contract end the upgrade authority swaps the
binary at the same slot to lazorkit-protocol's commercial build.
dApp integrators keep one stable program ID through the transition.
Devnet feature keeps program-v2's existing FLb7fyAtkfA4TSa2uYcAT8QKHd2pkoMHgmqfnXFXo7ao.
Build verification:
cargo build-sbf --features mainnet → sha differs from devnet
cargo build-sbf --features devnet → sha differs from mainnet
cargo build-sbf → fails with compile_error
cargo build-sbf --features mainnet --features devnet → fails
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 55c8e9d commit 3691e8a
4 files changed
Lines changed: 38 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
14 | 29 | | |
15 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
16 | 39 | | |
17 | 40 | | |
18 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
9 | 17 | | |
10 | 18 | | |
11 | 19 | | |
| |||
This file was deleted.
0 commit comments