You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: build/contract-integrations/multigov/deploy-to-evm.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
-
title: MultiGov Deployment
3
-
description: Set up and deploy MultiGov locally with step-by-step instructions for configuring, compiling, and deploying smart contracts across chains.
2
+
title: MultiGov Deployment to EVM
3
+
description: Set up and deploy MultiGov to EVM locally with step-by-step instructions for configuring, compiling, and deploying smart contracts across chains.
4
4
---
5
5
6
-
# Deployment
6
+
# Deploy MultiGov on EVM
7
7
8
-
This guide provodes instructions to set up and deploy the MultiGov governance system locally. Before diving into the technical deployment, ensure that MultiGov is the right fit for your project’s governance needs by following the steps for the [integration process](/docs/build/contract-integrations/multigov/){target=\_blank}.
8
+
This guide provides instructions on how to set up and deploy the MultiGov governance system locally. Before diving into the technical deployment, ensure that MultiGov is the right fit for your project's governance needs by following the steps for the [integration process](/docs/build/contract-integrations/multigov/){target=\_blank}.
9
9
10
10
Once your project is approved through the intake process and you’ve collaborated with the Tally team to tailor MultiGov to your requirements, use this guide to configure, compile, and deploy the necessary smart contracts across your desired blockchain networks. This deployment will enable decentralized governance across your hub and spoke chains.
11
11
@@ -34,7 +34,7 @@ For developers looking to set up a local MultiGov environment:
34
34
```bash
35
35
cp .env.example .env
36
36
```
37
-
Edit `.env` with your specific [configuration](/docs/build/contract-integrations/multigov/deployment/#configuration){target=\_blank}
37
+
Edit `.env` with your specific [configuration](/docs/build/contract-integrations/multigov/deploy-to-evm/#configuration)
description: Learn how to deploy the MultiGov Staking Program on Solana, including setup, funding, deployment, and configuration steps.
4
+
---
5
+
6
+
# Deploy MultiGov on Solana
7
+
8
+
This guide provides instructions on how to set up and deploy the **MultiGov Staking Program** on Solana. Before proceeding with the deployment, ensure that MultiGov aligns with your project's governance needs by reviewing the system [architecture](/docs/learn/governance/architecture/){target=\_blank}.
9
+
10
+
Once your project setup is complete, follow this guide to configure, compile, and deploy the necessary Solana programs and supporting accounts. This deployment enables decentralized governance participation on Solana as a spoke chain within the MultiGov system.
11
+
12
+
## Prerequisites
13
+
14
+
To deploy MultiGov on Solana, ensure you have the following installed:
To create a verifiable build of the MultiGov Staking Program, run the following command:
31
+
32
+
```bash
33
+
./scripts/build_verifiable_staking_program.sh
34
+
```
35
+
36
+
Once the build is complete, the compiled artifacts will be available in the `target` folder.
37
+
38
+
## Set Up the Deployer Account
39
+
40
+
For a successful deployment, you need a funded deployer account on Solana. This account will store the program and execute deployment transactions.
41
+
42
+
In this section, you will create a new keypair, check the account balance, and ensure it has enough SOL tokens to cover deployment costs. If needed, you can fund the account using different methods before deploying.
43
+
44
+
### Generate a New Keypair
45
+
46
+
To create a new keypair and save it to a file, run the following command:
47
+
48
+
```bash
49
+
solana-keygen new --outfile ./app/keypairs/deployer.json
50
+
```
51
+
52
+
### Check the Deployer Account Address
53
+
54
+
To retrieve the public address of the newly created keypair, run the following command:
55
+
56
+
```bash
57
+
solana address -k ./app/keypairs/deployer.json
58
+
```
59
+
60
+
### Check the Deployer Account Balance
61
+
62
+
To verify the current balance of the deployer account, run the following command:
63
+
64
+
```bash
65
+
solana balance -k ./app/keypairs/deployer.json
66
+
```
67
+
68
+
!!! important
69
+
When deploying the MultiGov Staking Program, the deployer account must have enough SOL to cover deployment costs and transaction fees.
70
+
71
+
- 7.60219224 SOL for deployment costs
72
+
- 0.00542 SOL for transaction fees
73
+
74
+
### Fund the Deployer Account
75
+
76
+
If the account does not have enough SOL, use one of the following methods to add funds.
77
+
78
+
- **Transfer SOL from another account** - if you already have SOL in another account, transfer it using a wallet (Phantom, Solflare, etc.) or in the terminal
79
+
80
+
```bash
81
+
solana transfer <deployer_account_address><amount> --from /path/to/funder.json
82
+
```
83
+
84
+
- **Request an airdrop (devnet only)** - if deploying to devnet, you can request free SOL
85
+
86
+
```bash
87
+
solana airdrop 2 -k ./app/keypairs/deployer.json
88
+
```
89
+
90
+
- **Use a Solana faucet (devnet only)** - you can use online faucets to receive 10 free SOL
With the deployer account set up and funded, you can deploy the MultiGov Staking Program to the Solana blockchain. This step involves deploying the program, verifying the deployment, and ensuring the necessary storage and metadata are correctly configured. Once the IDL is initialized, the program will be ready for further setup and interaction.
97
+
98
+
### Deploy the Program
99
+
100
+
Deploy the MultiGov Staking Program using **Anchor**:
The final step after deploying the MultiGov Staking Program is configuring it for proper operation. This includes running a series of deployment scripts to initialize key components and set important governance parameters. These steps ensure that staking, governance, and cross-chain communication functionas expected.
133
+
134
+
### Run Deployment Scripts
135
+
136
+
After deploying the program and initializing the IDL, execute the following scripts **in order** to set up the staking environment and necessary accounts.
137
+
138
+
1. Initialize the MultiGov Staking Program with default settings:
139
+
140
+
```bash
141
+
npx ts-node app/deploy/01_init_staking.ts
142
+
```
143
+
144
+
2. Create an Account Lookup Table (ALT) to optimize transaction processing:
When deploying MultiGov on Solana, several key parameters need to be set. Here are the most important configuration points:
177
+
178
+
- `maxCheckpointsAccountLimit` ++"u64"++ - the maximum number of checkpoints an account can have. For example, `654998` is used in production, while`15` might be used for testing
179
+
- `hubChainId``u16` - the chain ID of the hub network where proposals are primarily managed. For example, `10002`for Sepolia testnet
180
+
- `hubProposalMetadata` ++"[u8; 20]"++ - an array of bytes representing the address of the Hub Proposal Metadata contract on Ethereum. This is used to identify proposals from the hub
181
+
- `voteWeightWindowLength` ++"u64"++ - specifies the length of the checkpoint window in seconds in which the minimum voting weight is taken. The window ends at the vote start fora proposal and begins at the vote start minus the vote weight window. The vote weight window helps solve problems such as manipulating votesin a chain
182
+
- `votingTokenMint` ++"Pubkey"++ - the mint address of the token used for voting
183
+
- `governanceAuthority` ++"Pubkey"++ - the account's public key with the authority to govern the staking system. The `governanceAuthority` should not be the default Pubkey, as this would indicate an uninitialized or incorrectly configured setup
184
+
- `vestingAdmin` ++"Pubkey"++ - the account's public key for managing vesting operations. The `vestingAdmin` should not be the default Pubkey, as this would indicate an uninitialized or incorrectly configured setup
185
+
- `hubDispatcher` ++"Pubkey"++ - the Solana public key derived from an Ethereum address on the hub chain that dispatches messages to the spoke chains. This is crucial for ensuring that only authorized messages from the hub are executed on the spoke
- :octicons-rocket-16:{ .lg .middle } **Deploy to EVM**
22
22
23
23
---
24
24
25
-
Set up and deploy MultiGov locally with step-by-step instructions for configuring, compiling, and deploying smart contracts across chains.
25
+
Set up and deploy MultiGov on EVM with step-by-step instructions for configuring, compiling, and deploying smart contracts across chains.
26
26
27
-
[:custom-arrow: Discover how to deploy MultiGov](/docs/build/contract-integrations/multigov/deployment/)
27
+
[:custom-arrow: Discover how to deploy MultiGov](/docs/build/contract-integrations/multigov/deploy-to-evm/)
28
+
29
+
- :octicons-rocket-16:{ .lg .middle } **Deploy to Solana**
30
+
31
+
---
32
+
33
+
Set up and deploy the MultiGov Staking Program on Solana with step-by-step instructions for configuring, funding, deploying, and initializing the program.
34
+
35
+
[:custom-arrow: Discover how to deploy MultiGov on Solana](/docs/build/contract-integrations/multigov/deploy-to-solana/)
28
36
29
37
- :octicons-file-code-16:{ .lg .middle } **Upgrade MultiGov on EVM**
Copy file name to clipboardexpand all lines: learn/governance/architecture.md
+76-17
Original file line number
Diff line number
Diff line change
@@ -27,28 +27,87 @@ Spoke chains handle local voting, forward votes to the hub, and execute approved
27
27
-**`SpokeVoteAggregator`** - collects votes on the spoke chain and forwards them to the hub
28
28
-**`SpokeMessageExecutor`** - receives and executes approved proposals from the hub
29
29
-**`SpokeMetadataCollector`** - fetches proposal metadata from the hub for spoke chain voters
30
-
-**`SpokeAirlock`** - acts as governance's "admin" on the spoke, has permissions and its treasury
30
+
-**`SpokeAirlock`** - acts as governance's "admin" on the spoke, has permissions, and its treasury
31
+
32
+
### Spoke Solana Staking Program
33
+
34
+
The Spoke Solana Staking Program handles local voting from users who have staked W tokens or are vested in the program, forwards votes to the hub, and executes approved proposals from the hub for decentralized governance.
35
+
36
+
The program implements its functionality through instructions, using specialized PDA accounts where data is stored. Below are the key accounts in the program:
37
+
38
+
-**`GlobalConfig`** - global program configuration
39
+
-**`StakeAccountMetadata`** - stores user's staking information
40
+
-**`CustodyAuthority`** - PDA account managing custody and overseeing token operations related to stake accounts
41
+
-**`StakeAccountCustody`** - token account associated with a stake account for securely storing staked tokens
42
+
-**`CheckpointData`** - tracks delegation history
43
+
-**`SpokeMetadataCollector`** - collects and updates proposal metadata from the hub chain
44
+
-**`GuardianSignatures`** - stores guardian signatures for message verification
45
+
-**`ProposalData`** - stores data about a specific proposal, including votes and start time
46
+
-**`ProposalVotersWeightCast`** - tracks individual voter's weight for a proposal
47
+
-**`SpokeMessageExecutor`** - processes messages from a spoke chain via the Wormhole protocol
48
+
-**`SpokeAirlock`** - manages PDA signing and seed validation for secure instruction execution
49
+
-**`VestingBalance`** - stores total vesting balance and related staking information of a vester
50
+
-**`VestingConfig`** - defines vesting configuration, including mint and admin details
51
+
-**`Vesting`** - represents individual vesting allocations with maturation data
52
+
-**`VoteWeightWindowLengths`** - tracks lengths of vote weight windows
53
+
54
+
Each account is implemented as a Solana PDA (Program Derived Address) and utilizes Anchor's account framework for serialization and management.
31
55
32
56
## System Workflow
33
57
34
-
The MultiGov system workflow details the step-by-step process for creating, voting on and executing governance proposals across connected chains, from proposal creation to final cross-chain execution.
58
+
The MultiGov system workflow details the step-by-step process for creating, voting on, and executing governance proposals across connected chains, from proposal creation to final cross-chain execution.
59
+
60
+
### EVM Governance Workflow
61
+
62
+
The EVM-based MultiGov workflow follows these steps:
63
+
64
+
1.**Proposal creation**:
65
+
1. A user creates a proposal through the `HubEvmSpokeAggregateProposer`, which checks eligibility across chains, or directly on the `HubGovernor` via the `propose` method
66
+
2. The proposal is submitted to the `HubGovernor` if the user meets the proposal threshold
67
+
2.**Proposal metadata distribution**:
68
+
1.`HubProposalMetadata` creates a custom view method to be queried for use in the `SpokeMetadataCollector`
69
+
2.`SpokeMetadataCollector` on each spoke chain queries `HubProposalMetadata` for proposal details
70
+
3.**Voting process**:
71
+
1. Users on spoke chains vote through their respective `SpokeVoteAggregators`
72
+
2.`SpokeVoteAggregators` send aggregated votes to the `HubVotePool` via Wormhole
73
+
3.`HubVotePool` submits the aggregated votes to the `HubGovernor`
74
+
4.**Vote tallying and proposal execution**:
75
+
1.`HubGovernor` tallies votes from all chains
76
+
2. If a quorum is reached and there are more for votes than against votes, the vote passes and is queued for execution
77
+
3. After the timelock delay, the proposal can be executed on the hub chain
78
+
4. For cross-chain actions, a proposal should call the `dispatch` method in the `HubMessageDispatcher`, which sends execution messages to the relevant spoke chains
79
+
5.`SpokeMessageExecutors` on each spoke chain receive and execute the approved actions through their respective `SpokeAirlocks`
80
+
81
+
### Solana Governance Workflow
82
+
83
+
The Solana-based MultiGov workflow follows these steps:
35
84
36
85
1.**Proposal creation**:
37
-
- A user creates a proposal through the `HubEvmSpokeAggregateProposer`, which checks eligibility across chains, or directly on the `HubGovernor` via the `propose` method
38
-
- The proposal is submitted to the `HubGovernor` if the user meets the proposal threshold
39
-
1.**Proposal metadata distribution**:
40
-
-`HubProposalMetadata` creates a custom view method to be queried for use in the `SpokeMetadataCollector`
41
-
-`SpokeMetadataCollector` on each spoke chain queries `HubProposalMetadata` for proposal details
42
-
1.**Voting process**:
43
-
- Users on spoke chains vote through their respective `SpokeVoteAggregators`
44
-
-`SpokeVoteAggregators` send aggregated votes to the `HubVotePool` via Wormhole
45
-
-`HubVotePool` submits the aggregated votes to the `HubGovernor`
46
-
1.**Vote tallying and proposal execution**:
47
-
-`HubGovernor` tallies votes from all chains
48
-
- If a quorum is reached and there are more for votes than against votes, the vote passes and is queued for execution
49
-
- After the timelock delay, the proposal can be executed on the hub chain
50
-
- For cross-chain actions, a proposal should call the `dispatch` method in the `HubMessageDispatcher`, which sends execution messages to the relevant spoke chains
51
-
-`SpokeMessageExecutors` on each spoke chain receive and execute the approved actions through their respective `SpokeAirlocks`
86
+
1. A user creates a proposal on `HubGovernor` by calling the `propose` method, provided they meet the proposal threshold
87
+
2. For the proposal to be executed on the Solana blockchain, a `SolanaPayload` must be generated and included in the `calldata` parameter of the `propose` function
88
+
3. The `SolanaPayload` contains encoded details specifying which instructions will be executed and which Solana program is responsible for execution
89
+
90
+
2.**Proposal metadata distribution**:
91
+
1. A user queries `getProposalMetadata` from `HubProposalMetadata` via the Wormhole query system to create a proposal on the **Spoke Solana Chain Staking Program**
92
+
2. The retrieved metadata is used in the `AddProposal` instruction in the Solana program
93
+
3. The proposal data is verified to ensure it matches the expected format
94
+
4. Guardian signatures are posted using the `PostSignatures` instruction
95
+
5. Once validated, the proposal is stored on-chain
96
+
97
+
3.**Voting process**:
98
+
1. Users vote on proposals stored in the `ProposalData` account on Solana
99
+
2. The `CastVote` instruction records their choice (`for_votes`, `against_votes`, or `abstain_votes`)
100
+
3. Eligibility and vote weight are verified using historical voter checkpoint data
101
+
4. A **Query Wormhole** request retrieves vote data from a Solana PDA
102
+
5. The signed response from Wormhole guardians is submitted to the `HubVotePool` on Ethereum for verification
103
+
6. The `crossChainVote` function in `HubVotePool` processes the validated response and forwards the aggregated vote data to the `HubGovernor` to finalize the decision
104
+
105
+
4.**Vote tallying and proposal execution**:
106
+
1.`HubGovernor` tallies votes from all chains
107
+
2. If a quorum is reached with more **for votes** than **against votes**, the proposal passes and is queued for execution
108
+
3. After the timelock delay, the proposal can be executed either on the hub chain or another chain
109
+
4. For cross-chain execution involving Solana, the proposal calls the `dispatch` method in `HubSolanaMessageDispatcher`, which sends execution messages to Solana
110
+
5. On Solana, the `ReceiveMessage` instruction processes the approved message, and the `SpokeAirlock` executes the corresponding instructions
Copy file name to clipboardexpand all lines: learn/governance/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Discover everything you need to know about MultiGov, Wormhole's cross-chain gove
23
23
24
24
---
25
25
26
-
Discover an overview of MultiGov's hub-and-spoke architecture, including how it enables cross-chain governance by coordinating decision-making across blockchain.
26
+
Discover MultiGov's hub-and-spoke architecture, enabling EVM and Solana cross-chain governance through coordinated decision-making.
27
27
28
28
[:custom-arrow: Learn about MultiGov architecture](/docs/learn/governance/architecture/)
0 commit comments