Skip to content

Commit

Permalink
chore(unionvisor): prepare v1.0.0 alpha release (#3960)
Browse files Browse the repository at this point in the history
  • Loading branch information
PoisonPhang authored Mar 6, 2025
2 parents 7dc0b16 + b05e7d6 commit a344929
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release Component

on:
push:
tags: ['*/v[0-9]+\.[0-9]+\.[0-9]+\-rc[0-9]+', '*/v[0-9]+\.[0-9]+\.[0-9]+']
tags: ['*/v[0-9]+\.[0-9]+\.[0-9]+\-rc[0-9]+*', '*/v[0-9]+\.[0-9]+\.[0-9]+*']

jobs:
eval-tag:
Expand Down
2 changes: 1 addition & 1 deletion e2e/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
upgrades = import ./upgrades.nix {
inherit e2e pkgs;
inherit (self'.packages) unionvisor;
bundle = self'.packages.bundle-testnet-next;
bundle = self'.packages.bundle-union-1-next;
};
in
{
Expand Down
94 changes: 46 additions & 48 deletions e2e/upgrades.nix
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{
e2e,
pkgs,
unionvisor,
bundle,
# unionvisor,
# bundle,
...
}:
let
unionvisorBin = pkgs.lib.meta.getExe unionvisor;
# let
# unionvisorBin = pkgs.lib.meta.getExe unionvisor;

mkUpgradeProposal =
version: height:
pkgs.runCommand "upgrade-proposal" { } ''
mkdir -p $out
echo '{
"messages": [
{
"@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
"authority": "union10d07y265gmmuvt4z0w9aw880jnsr700js4jdcz",
"plan": {
"name": "${version}",
"height": "${toString height}",
"info": "${version}"
}
}
],
"deposit": "15000000muno",
"title": "${version}",
"summary": "Upgrade to ${version}"
}' > proposal-${version}.json
mv proposal-${version}.json $out
'';
# mkUpgradeProposal =
# version: height:
# pkgs.runCommand "upgrade-proposal" { } ''
# mkdir -p $out
# echo '{
# "messages": [
# {
# "@type": "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade",
# "authority": "union10d07y265gmmuvt4z0w9aw880jnsr700js4jdcz",
# "plan": {
# "name": "${version}",
# "height": "${toString height}",
# "info": "${version}"
# }
# }
# ],
# "deposit": "15000000muno",
# "title": "${version}",
# "summary": "Upgrade to ${version}"
# }' > proposal-${version}.json
# mv proposal-${version}.json $out
# '';

forEachNode = f: ''
${f "0"}
${f "1"}
${f "2"}
${f "3"}
'';
# forEachNode = f: ''
# ${f "0"}
# ${f "1"}
# ${f "2"}
# ${f "3"}
# '';

upgradeTo = version: height: ''
union.succeed('docker cp ${mkUpgradeProposal version height}/proposal-${version}.json devnet-union-minimal-union-minimal-0-1:/proposal-${version}.json')
# upgradeTo = version: height: ''
# union.succeed('docker cp ${mkUpgradeProposal version height}/proposal-${version}.json devnet-union-minimal-union-minimal-0-1:/proposal-${version}.json')

print('--root ./.unionvisor call --bundle ${bundle} -- tx gov submit-proposal proposal-${version}.json --from valoper-0 --keyring-backend test -y --gas auto --gas-adjustment 1.4')
print(union.succeed('docker exec devnet-union-minimal-union-minimal-0-1 ${unionvisorBin} --root ./.unionvisor call --bundle ${bundle} -- tx gov submit-proposal proposal-${version}.json --from valoper-0 --keyring-backend test -y --gas auto --gas-adjustment 1.4'))
# print('--root ./.unionvisor call --bundle ${bundle} -- tx gov submit-proposal proposal-${version}.json --from valoper-0 --keyring-backend test -y --gas auto --gas-adjustment 1.4')
# print(union.succeed('docker exec devnet-union-minimal-union-minimal-0-1 ${unionvisorBin} --root ./.unionvisor call --bundle ${bundle} -- tx gov submit-proposal proposal-${version}.json --from valoper-0 --keyring-backend test -y --gas auto --gas-adjustment 1.4'))

print(union.succeed("docker exec devnet-union-minimal-union-minimal-0-1 ${unionvisorBin} -l off --root ./.unionvisor call --bundle ${bundle} -- query gov proposal ${toString (height / 100)} --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.proposal.status == \"PROPOSAL_STATUS_VOTING_PERIOD\"'"))
union.wait_until_succeeds("[[ $(docker exec devnet-union-minimal-union-minimal-0-1 ${unionvisorBin} -l off --root ./.unionvisor call --bundle ${bundle} -- query gov proposal ${toString (height / 100)} --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.proposal.status == \"PROPOSAL_STATUS_VOTING_PERIOD\"') == true ]]", timeout=30)
# print(union.succeed("docker exec devnet-union-minimal-union-minimal-0-1 ${unionvisorBin} -l off --root ./.unionvisor call --bundle ${bundle} -- query gov proposal ${toString (height / 100)} --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.proposal.status == \"PROPOSAL_STATUS_VOTING_PERIOD\"'"))
# union.wait_until_succeeds("[[ $(docker exec devnet-union-minimal-union-minimal-0-1 ${unionvisorBin} -l off --root ./.unionvisor call --bundle ${bundle} -- query gov proposal ${toString (height / 100)} --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.proposal.status == \"PROPOSAL_STATUS_VOTING_PERIOD\"') == true ]]", timeout=30)

${forEachNode (
id:
"print(union.succeed('docker exec devnet-union-minimal-union-minimal-${id}-1 ${unionvisorBin} --root ./.unionvisor call --bundle ${bundle} -- tx gov vote ${toString (height / 100)} yes --keyring-backend test --from valoper-${id} -y'))"
)}
# ${forEachNode (
# id:
# "print(union.succeed('docker exec devnet-union-minimal-union-minimal-${id}-1 ${unionvisorBin} --root ./.unionvisor call --bundle ${bundle} -- tx gov vote ${toString (height / 100)} yes --keyring-backend test --from valoper-${id} -y'))"
# )}

union.wait_until_succeeds("[[ $(docker exec devnet-union-minimal-union-minimal-0-1 ${unionvisorBin} -l off --root ./.unionvisor call --bundle ${bundle} -- query gov proposal ${toString (height / 100)} --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.proposal.status == \"PROPOSAL_STATUS_PASSED\"') == true ]]", timeout=60)
# union.wait_until_succeeds("[[ $(docker exec devnet-union-minimal-union-minimal-0-1 ${unionvisorBin} -l off --root ./.unionvisor call --bundle ${bundle} -- query gov proposal ${toString (height / 100)} --output json | ${pkgs.lib.meta.getExe pkgs.jq} '.proposal.status == \"PROPOSAL_STATUS_PASSED\"') == true ]]", timeout=60)

union.wait_until_succeeds('[[ $(curl "http://localhost:26660/block" --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} ".result.block.header.height | tonumber > ${toString height}") == "true" ]]', timeout=120)
'';
in
# union.wait_until_succeeds('[[ $(curl "http://localhost:26660/block" --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} ".result.block.header.height | tonumber > ${toString height}") == "true" ]]', timeout=120)
# '';
# in
{
upgrade-from-genesis = e2e.mkTest {
name = "upgrade-from-genesis";
Expand All @@ -66,8 +66,6 @@ in
# Ensure the union network commits more than one block
union.wait_until_succeeds('[[ $(curl "http://localhost:26657/block" --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} ".result.block.header.height | tonumber > 1") == "true" ]]')
${upgradeTo "v0.26.0" 100}
'';

nodes = {
Expand Down
30 changes: 6 additions & 24 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,8 @@
};

# uniond versions
v0_25_0 = {
url = "github:unionlabs/union/release/uniond/v0.25.0";
flake = false;
};
v0_26_0 = {
url = "github:unionlabs/union/release/uniond/v0.26.0";
v1_0_0 = {
url = "github:unionlabs/union/release/uniond/v1.0.0";
flake = false;
};
};
Expand Down Expand Up @@ -261,7 +257,7 @@
versions = builtins.fromJSON (builtins.readFile ./versions/versions.json);

uniondBundleVersions = rec {
complete = versions.union-testnet-9.versions;
complete = versions.union-1.versions;
first = pkgs.lib.lists.head complete;
last = pkgs.lib.lists.last complete;
};
Expand Down
6 changes: 3 additions & 3 deletions networks/devnet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
};

devnet-union-minimal = mkCosmosDevnet {
node = (get-flake inputs.v0_25_0).packages.${system}.uniond;
node = (get-flake inputs.v1_0_0).packages.${system}.uniond;
chainId = "union-minimal-devnet-1";
chainName = "union-minimal";
denom = "muno";
Expand All @@ -210,13 +210,13 @@
};
extraPackages = [
self'.packages.unionvisor
self'.packages.bundle-testnet-next
self'.packages.bundle-union-1-next
];
startCommandOverwrite = ''
mkdir .unionvisor
export UNIONVISOR_ROOT=$(pwd)/.unionvisor
export UNIONVISOR_BUNDLE=${self'.packages.bundle-testnet-next}
export UNIONVISOR_BUNDLE=${self'.packages.bundle-union-1-next}
${pkgs.lib.getExe self'.packages.unionvisor} init \
--moniker union-devnet-minimal \
Expand Down
16 changes: 8 additions & 8 deletions unionvisor/unionvisor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
packages = {
inherit (unionvisorAll.packages) unionvisor;

bundle-testnet-9-image = mkUnionvisorImage self'.packages.bundle-testnet-9;
bundle-union-1-image = mkUnionvisorImage self'.packages.bundle-union-1;

bundle-testnet-9 = mkBundle {
name = "testnet-9";
bundle-union-1 = mkBundle {
name = "union-1";
versions = uniondBundleVersions.complete;
genesis = ../networks/genesis/union-testnet-9/genesis.json;
meta = {
Expand All @@ -117,10 +117,10 @@
};
};

bundle-testnet-next = mkBundle {
name = "testnet-next";
bundle-union-1-next = mkBundle {
name = "union-1-next";
versions = uniondBundleVersions.complete;
nextVersion = "v0.26.0";
nextVersion = "v1.1.0";
genesis = ../networks/genesis/union-testnet-9/genesis.json;
meta = {
binary_name = "uniond";
Expand Down Expand Up @@ -151,7 +151,7 @@
};
bundle = mkOption {
type = types.package;
default = self.packages.${pkgs.system}.bundle-testnet-9;
default = self.packages.${pkgs.system}.bundle-union-1;
};
logFormat = mkOption {
type = types.enum [
Expand All @@ -164,7 +164,7 @@
moniker = mkOption { type = types.str; };
network = mkOption {
type = types.str;
default = "union-testnet-9";
default = "union-1";
};
seeds = mkOption {
type = types.str;
Expand Down
5 changes: 5 additions & 0 deletions versions/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@
"versions": ["v0.25.0", "v0.26.0"],
"current": "v0.25.0",
"seeds": "c2bf0d5b2ad3a1df0f4e9cc32debffa239c0af90@testnet.seed.poisonphang.com:26656"
},
"union-1": {
"versions": ["v1.0.0"],
"current": "v1.0.0",
"seeds": ""
}
}

0 comments on commit a344929

Please sign in to comment.