Add notes on how to release (#537)

This commit is contained in:
Christian Kamm 2023-04-13 12:57:58 +02:00 committed by GitHub
parent b07857c696
commit 1fe83c5f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 17 deletions

62
RELEASING.md Normal file
View File

@ -0,0 +1,62 @@
# Mango v4 release steps
- Setup and info
- $KEY as a path to a keypair (needs around 20 SOL for the buffer)
- $RPC_URL as a url to an RPC node
- 4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg is the address of the Mango v4 Program
- FP4PxqHTVzeG2c6eZd7974F9WvKUSdBeduUK3rjYyvBw is the address of the Mango v4 Program Governance
- Check out the latest version of the `dev` branch
- Update the changelog
git log program-v0.11.0..HEAD -- programs/mango-v4/
- Make sure the version is bumped in programs/mango-v4/Cargo.toml
- Update the idl ./update-local-idl.sh
- Run the tests to double check
- Tag and push
- Do a verifiable build
cargo run -p anchor-cli -- build --verifiable --solana-version 1.14.13 -- --features enable-gpl
(or wait for github to finish and create the release)
- Get the checksum of the verifiable build binary
sha256sum target/verifiable/mango_v4.so
to compare it with the one from github.
- Create the program buffer
solana -k $KEY -u $RPC_URL program write-buffer target/verifiable/mango_v4.so
Save the returned address as $PROGRAM_BUFFER
- Set new buffer authority
solana -k $KEY -u $RPC_URL program set-buffer-authority --new-buffer-authority FP4PxqHTVzeG2c6eZd7974F9WvKUSdBeduUK3rjYyvBw $PROGRAM_BUFFER
- Create IDL buffer
cargo run -p anchor-cli -- idl write-buffer --provider.cluster $RPC_URL --provider.wallet $KEY --filepath target/idl/mango_v4_no_docs.json 4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg
Save the returned address as $IDL_BUFFER
- Set IDL buffer authority
cargo run -p anchor-cli -- idl set-authority --provider.cluster $RPC_URL --provider.wallet $KEY --program-id 4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg --new-authority FP4PxqHTVzeG2c6eZd7974F9WvKUSdBeduUK3rjYyvBw $IDL_BUFFER
- Make a gist for the proposal description, ideally based on previous upgrade proposals
- Go to the DAO proposal website and make a proposal:
- Upgrade program with the new buffer, set the spill address to the address of $KEY
- Upgrade idl with the new buffer
- Bump the version to the next one, update idl and push

View File

@ -1,17 +0,0 @@
#!/usr/bin/env bash
set -ex pipefail
WALLET_WITH_FUNDS=~/.config/solana/mango-mainnet-1.json
PROGRAM_ID=4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg
# build program
cargo run -p anchor-cli -- \
build --verifiable --solana-version 1.14.13 -- \
--features enable-gpl
# publish the buffer
solana --url $MB_CLUSTER_URL -k $WALLET_WITH_FUNDS \
program write-buffer \
--buffer-authority FP4PxqHTVzeG2c6eZd7974F9WvKUSdBeduUK3rjYyvBw \
target/verifiable/mango_v4.so