Skip to content

Commit 20021d3

Browse files
Martinh/multigov upgrade sol (#274)
* update sections name for different platforms * update file name [platform] * create new page for solana upgrade * rename file detailing [platform] * update link to new file * introduction * Key Considerations for Upgrade section * upgrading multigov on solana steps * grammarly check * remove spaces * consitency update * update index with new page on solana * llm check * refactors key consideration bullet list * llm check * removes example admonitions * llms * Update build/contract-integrations/multigov/upgrade-evm.md Co-authored-by: Dawn Kelly <83190195+dawnkelly09@users.noreply.github.com> * Update build/contract-integrations/multigov/upgrade-solana.md Co-authored-by: Dawn Kelly <83190195+dawnkelly09@users.noreply.github.com> * llm check --------- Co-authored-by: DAWN KELLY <dawnkelly09@gmail.com> Co-authored-by: Dawn Kelly <83190195+dawnkelly09@users.noreply.github.com>
1 parent 913a206 commit 20021d3

File tree

5 files changed

+170
-15
lines changed

5 files changed

+170
-15
lines changed

build/contract-integrations/multigov/.pages

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ nav:
33
- index.md
44
- 'Deploy to EVM': 'deploy-to-evm.md'
55
- 'Deploy to Solana': 'deploy-to-solana.md'
6-
- 'Upgrade Contracts': 'upgrade.md'
6+
- 'Upgrade Contracts on EVM': 'upgrade-evm.md'
7+
- 'Upgrade Contracts on Solana': 'upgrade-solana.md'
78
- 'Technical FAQs': 'faq.md'

build/contract-integrations/multigov/index.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,21 @@ Take the following steps to get started with a MultiGov integration:
3434

3535
[:custom-arrow: Discover how to deploy MultiGov on Solana](/docs/build/contract-integrations/multigov/deploy-to-solana/)
3636

37-
- :octicons-file-code-16:{ .lg .middle } **Upgrade Contracts**
37+
- :octicons-file-code-16:{ .lg .middle } **Upgrade MultiGov on EVM**
3838

3939
---
4040

4141
Learn the process and key considerations for upgrading MultiGov contracts, ensuring system integrity and careful planning across cross-chain components.
4242

43-
[:custom-arrow: Discover how to upgrade MultiGov](/docs/build/contract-integrations/multigov/upgrade/)
43+
[:custom-arrow: Discover how to upgrade MultiGov](/docs/build/contract-integrations/multigov/upgrade-evm/)
44+
45+
- :octicons-file-code-16:{ .lg .middle } **Upgrade MultiGov on Solana**
46+
47+
---
48+
49+
Learn how to upgrade the MultiGov Staking Program on Solana, including updating the program binary, IDL, and more.
50+
51+
[:custom-arrow: Discover how to upgrade MultiGov on Solana](/docs/build/contract-integrations/multigov/upgrade-solana/)
4452

4553
- :octicons-question-16:{ .lg .middle } **Technical FAQs**
4654

build/contract-integrations/multigov/upgrade.md build/contract-integrations/multigov/upgrade-evm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: Upgrading MultiGov
3-
description: Learn the process and key considerations for upgrading MultiGov, ensuring system integrity and careful planning across cross-chain components.
2+
title: Upgrading MultiGov on EVM
3+
description: Learn the process and key considerations for upgrading MultiGov on EVM, ensuring system integrity and careful planning across cross-chain components.
44
---
55

6-
# Upgrade MultiGov Contracts
6+
# Upgrade MultiGov Contracts on EVM
77

8-
MultiGov is designed to be flexible but stable. Upgrades should be rare and carefully considered due to the system's complexity and cross-chain nature. When upgrades are necessary, they must be meticulously planned and executed to ensure system integrity and continuity.
8+
MultiGov is designed to be flexible but stable. Due to the system's complexity and cross-chain nature, upgrades should be rare and carefully considered. When upgrades are necessary, they must be meticulously planned and executed to ensure system integrity and continuity.
99

1010
## Key Considerations for Upgrades
1111

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Upgrading MultiGov on Solana
3+
description: Learn the process and key considerations for upgrading MultiGov on Solana, ensuring system integrity and careful planning across cross-chain components.
4+
---
5+
6+
# Upgrade MultiGov Contracts on Solana
7+
8+
The MultiGov Staking Program on Solana is designed to be upgradeable while maintaining stability. Upgrades introduce improvements, bug fixes, and new features but must be carefully planned and executed to prevent disruptions.
9+
10+
This guide covers the key considerations and step-by-step process for upgrading the MultiGov Staking Program, including updating the program binary, Interface Description Language (IDL), and `HubProposalMetadata` while ensuring cross-chain compatibility.
11+
12+
## Key Considerations for Upgrades
13+
14+
- **Program upgradeability** - you can upgrade the MultiGov Staking Program on Solana using the `anchor upgrade` command
15+
- You need the program's new bytecode (`.so` file) and an updated IDL file to reflect any changes in the program's interface to complete an upgrade
16+
- The program's authority (deployer) must execute the upgrade
17+
18+
- **`HubProposalMetadata`** - can be updated without redeploying the entire program. You can do this by invoking the `updateHubProposalMetadata` instruction
19+
- You must carefully validate updates to `HubProposalMetadata` to ensure compatibility with the existing system
20+
21+
- **Cross-chain compatibility** - ensure any changes to the Solana program do not break compatibility with the Ethereum-based `HubGovernor`
22+
- Test upgrades thoroughly on devnet before deploying to mainnet
23+
24+
## Upgrade the MultiGov Program
25+
26+
Follow these steps to upgrade the MultiGov Staking Program on Solana.
27+
28+
1. **Prepare the new program binary** - build the updated program using the provided script
29+
30+
```bash
31+
./scripts/build_verifiable_staking_program.sh
32+
```
33+
34+
The new program binary will be located at:
35+
36+
```bash
37+
target/deploy/staking.so
38+
```
39+
40+
2. **Upgrade the program** - use the anchor upgrade command to deploy the new program binary
41+
42+
```bash
43+
anchor upgrade --program-id INSERT_PROGRAM_ID --provider.cluster INSERT_CLUSTER_URL INSERT_PATH_TO_PROGRAM_BINARY
44+
```
45+
46+
Your completed anchor upgrade command should resemble the following:
47+
```bash
48+
anchor upgrade --program-id DgCSKsLDXXufYeEkvf21YSX5DMnFK89xans5WdSsUbeY --provider.cluster https://api.devnet.solana.com ./target/deploy/staking.so
49+
```
50+
51+
3. **Update the IDL** - after upgrading the program, update the IDL to reflect any changes in the program's interface
52+
53+
```bash
54+
anchor idl upgrade INSERT_PROGRAM_ID --filepath INSERT_PATH_TO_IDL_FILE
55+
```
56+
57+
Your completed IDL upgrade command should resemble the following:
58+
```bash
59+
anchor idl upgrade --provider.cluster https://api.devnet.solana.com --filepath ./target/idl/staking.json DgCSKsLDXXufYeEkvf21YSX5DMnFK89xans5WdSsUbeY
60+
```
61+
62+
4. **Update `HubProposalMetadata`** - if `HubProposalMetadata` requires an update, run the following script to invoke the `updateHubProposalMetadata` instruction and apply the changes
63+
64+
```bash
65+
npx ts-node app/deploy/07_update_HubProposalMetadata.ts
66+
```
67+

llms.txt

+87-8
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Doc-Page: https://wormhole.com/docs/build/contract-integrations/multigov/deploy-
3333
Doc-Page: https://wormhole.com/docs/build/contract-integrations/multigov/deploy-to-solana/
3434
Doc-Page: https://wormhole.com/docs/build/contract-integrations/multigov/faq/
3535
Doc-Page: https://wormhole.com/docs/build/contract-integrations/multigov/
36-
Doc-Page: https://wormhole.com/docs/build/contract-integrations/multigov/upgrade/
36+
Doc-Page: https://wormhole.com/docs/build/contract-integrations/multigov/upgrade-evm/
37+
Doc-Page: https://wormhole.com/docs/build/contract-integrations/multigov/upgrade-solana/
3738
Doc-Page: https://wormhole.com/docs/build/contract-integrations/native-token-transfers/cli-commands/
3839
Doc-Page: https://wormhole.com/docs/build/contract-integrations/native-token-transfers/configuration/access-control/
3940
Doc-Page: https://wormhole.com/docs/build/contract-integrations/native-token-transfers/configuration/
@@ -9292,13 +9293,21 @@ Take the following steps to get started with a MultiGov integration:
92929293

92939294
[:custom-arrow: Discover how to deploy MultiGov on Solana](/docs/build/contract-integrations/multigov/deploy-to-solana/)
92949295

9295-
- :octicons-file-code-16:{ .lg .middle } **Upgrade Contracts**
9296+
- :octicons-file-code-16:{ .lg .middle } **Upgrade MultiGov on EVM**
92969297

92979298
---
92989299

92999300
Learn the process and key considerations for upgrading MultiGov contracts, ensuring system integrity and careful planning across cross-chain components.
93009301

9301-
[:custom-arrow: Discover how to upgrade MultiGov](/docs/build/contract-integrations/multigov/upgrade/)
9302+
[:custom-arrow: Discover how to upgrade MultiGov](/docs/build/contract-integrations/multigov/upgrade-evm/)
9303+
9304+
- :octicons-file-code-16:{ .lg .middle } **Upgrade MultiGov on Solana**
9305+
9306+
---
9307+
9308+
Learn how to upgrade the MultiGov Staking Program on Solana, including updating the program binary, IDL, and more.
9309+
9310+
[:custom-arrow: Discover how to upgrade MultiGov on Solana](/docs/build/contract-integrations/multigov/upgrade-solana/)
93029311

93039312
- :octicons-question-16:{ .lg .middle } **Technical FAQs**
93049313

@@ -9333,16 +9342,16 @@ Take the following steps to get started with a MultiGov integration:
93339342
</div>
93349343
--- END CONTENT ---
93359344

9336-
Doc-Content: https://wormhole.com/docs/build/contract-integrations/multigov/upgrade/
9345+
Doc-Content: https://wormhole.com/docs/build/contract-integrations/multigov/upgrade-evm/
93379346
--- BEGIN CONTENT ---
93389347
---
9339-
title: Upgrading MultiGov
9340-
description: Learn the process and key considerations for upgrading MultiGov, ensuring system integrity and careful planning across cross-chain components.
9348+
title: Upgrading MultiGov on EVM
9349+
description: Learn the process and key considerations for upgrading MultiGov on EVM, ensuring system integrity and careful planning across cross-chain components.
93419350
---
93429351

9343-
# Upgrade MultiGov Contracts
9352+
# Upgrade MultiGov Contracts on EVM
93449353

9345-
MultiGov is designed to be flexible but stable. Upgrades should be rare and carefully considered due to the system's complexity and cross-chain nature. When upgrades are necessary, they must be meticulously planned and executed to ensure system integrity and continuity.
9354+
MultiGov is designed to be flexible but stable. Due to the system's complexity and cross-chain nature, upgrades should be rare and carefully considered. When upgrades are necessary, they must be meticulously planned and executed to ensure system integrity and continuity.
93469355

93479356
## Key Considerations for Upgrades
93489357

@@ -9402,6 +9411,76 @@ MultiGov is designed to be flexible but stable. Upgrades should be rare and care
94029411
- Always test upgrades extensively on testnets before implementing in production
94039412
--- END CONTENT ---
94049413

9414+
Doc-Content: https://wormhole.com/docs/build/contract-integrations/multigov/upgrade-solana/
9415+
--- BEGIN CONTENT ---
9416+
---
9417+
title: Upgrading MultiGov on Solana
9418+
description: Learn the process and key considerations for upgrading MultiGov on Solana, ensuring system integrity and careful planning across cross-chain components.
9419+
---
9420+
9421+
# Upgrade MultiGov Contracts on Solana
9422+
9423+
The MultiGov Staking Program on Solana is designed to be upgradeable while maintaining stability. Upgrades introduce improvements, bug fixes, and new features but must be carefully planned and executed to prevent disruptions.
9424+
9425+
This guide covers the key considerations and step-by-step process for upgrading the MultiGov Staking Program, including updating the program binary, Interface Description Language (IDL), and `HubProposalMetadata` while ensuring cross-chain compatibility.
9426+
9427+
## Key Considerations for Upgrades
9428+
9429+
- **Program upgradeability** - you can upgrade the MultiGov Staking Program on Solana using the `anchor upgrade` command
9430+
- You need the program's new bytecode (`.so` file) and an updated IDL file to reflect any changes in the program's interface to complete an upgrade
9431+
- The program's authority (deployer) must execute the upgrade
9432+
9433+
- **`HubProposalMetadata`** - can be updated without redeploying the entire program. You can do this by invoking the `updateHubProposalMetadata` instruction
9434+
- You must carefully validate updates to `HubProposalMetadata` to ensure compatibility with the existing system
9435+
9436+
- **Cross-chain compatibility** - ensure any changes to the Solana program do not break compatibility with the Ethereum-based `HubGovernor`
9437+
- Test upgrades thoroughly on devnet before deploying to mainnet
9438+
9439+
## Upgrade the MultiGov Program
9440+
9441+
Follow these steps to upgrade the MultiGov Staking Program on Solana.
9442+
9443+
1. **Prepare the new program binary** - build the updated program using the provided script
9444+
9445+
```bash
9446+
./scripts/build_verifiable_staking_program.sh
9447+
```
9448+
9449+
The new program binary will be located at:
9450+
9451+
```bash
9452+
target/deploy/staking.so
9453+
```
9454+
9455+
2. **Upgrade the program** - use the anchor upgrade command to deploy the new program binary
9456+
9457+
```bash
9458+
anchor upgrade --program-id INSERT_PROGRAM_ID --provider.cluster INSERT_CLUSTER_URL INSERT_PATH_TO_PROGRAM_BINARY
9459+
```
9460+
9461+
Your completed anchor upgrade command should resemble the following:
9462+
```bash
9463+
anchor upgrade --program-id DgCSKsLDXXufYeEkvf21YSX5DMnFK89xans5WdSsUbeY --provider.cluster https://api.devnet.solana.com ./target/deploy/staking.so
9464+
```
9465+
9466+
3. **Update the IDL** - after upgrading the program, update the IDL to reflect any changes in the program's interface
9467+
9468+
```bash
9469+
anchor idl upgrade INSERT_PROGRAM_ID --filepath INSERT_PATH_TO_IDL_FILE
9470+
```
9471+
9472+
Your completed IDL upgrade command should resemble the following:
9473+
```bash
9474+
anchor idl upgrade --provider.cluster https://api.devnet.solana.com --filepath ./target/idl/staking.json DgCSKsLDXXufYeEkvf21YSX5DMnFK89xans5WdSsUbeY
9475+
```
9476+
9477+
4. **Update `HubProposalMetadata`** - if `HubProposalMetadata` requires an update, run the following script to invoke the `updateHubProposalMetadata` instruction and apply the changes
9478+
9479+
```bash
9480+
npx ts-node app/deploy/07_update_HubProposalMetadata.ts
9481+
```
9482+
--- END CONTENT ---
9483+
94059484
Doc-Content: https://wormhole.com/docs/build/contract-integrations/native-token-transfers/cli-commands/
94069485
--- BEGIN CONTENT ---
94079486
---

0 commit comments

Comments
 (0)