|
| 1 | +# Major Release Upgrade Scenarios: |
| 2 | +# 1. Proposal & Voting: |
| 3 | +# - A major release upgrade is proposed for a future block height. |
| 4 | +# - All nodes vote in favor of the proposal. |
| 5 | + |
| 6 | +# 2. Early Upgrade: |
| 7 | +# - Node 0 is prematurely upgraded to the major release. |
| 8 | +# - It's verified that this node panics due to the early upgrade. |
| 9 | + |
| 10 | +# 3. Target Block Height: |
| 11 | +# - The network reaches the proposed upgrade block height. |
| 12 | +# - Non-upgraded nodes (1, 2, and 3) panic, indicating the need for the upgrade. |
| 13 | +# - An "UPGRADE NEEDED" log message is expected on these nodes. |
| 14 | + |
| 15 | +# 4. Post-Upgrade Behavior: |
| 16 | +# - Nodes 1, 2, and 3 are upgraded to the major release and resume normal operation. |
| 17 | +# - Node 0, which was prematurely upgraded, is downgraded to sync with the network. |
| 18 | +# - Once synced, Node 0 also panics at the upgrade height and logs the "UPGRADE NEEDED" message. |
| 19 | +# - Finally, Node 0 is upgraded to the major release and resumes normal operation. |
| 20 | + |
| 21 | +# 5. Final State: |
| 22 | +# - All nodes are verified to be running smoothly post-upgrade. |
| 23 | + |
| 24 | + |
| 25 | +- name: Test Major Release Upgrade |
| 26 | + inputs: |
| 27 | + - cmd: echo "v2.0.0" |
| 28 | + env: VERSION |
| 29 | + # PASS PROPOSAL FOR MAJOR UPGRADE |
| 30 | + # Get block for 30s from now |
| 31 | + - cmd: proposal_target_height.sh 30 |
| 32 | + env: TARGET_HEIGHT |
| 33 | + node: sei-node-0 |
| 34 | + |
| 35 | + # Submit the software upgrade proposal |
| 36 | + - cmd: proposal_submit.sh $TARGET_HEIGHT major $VERSION |
| 37 | + env: PROPOSAL_ID |
| 38 | + node: sei-node-0 |
| 39 | + |
| 40 | + # Vote with all nodes |
| 41 | + - cmd: proposal_vote.sh $PROPOSAL_ID |
| 42 | + node: sei-node-0 |
| 43 | + - cmd: proposal_vote.sh $PROPOSAL_ID |
| 44 | + node: sei-node-1 |
| 45 | + - cmd: proposal_vote.sh $PROPOSAL_ID |
| 46 | + node: sei-node-2 |
| 47 | + - cmd: proposal_vote.sh $PROPOSAL_ID |
| 48 | + node: sei-node-3 |
| 49 | + |
| 50 | + # Wait for the proposal to pass |
| 51 | + - cmd: proposal_wait_for_pass.sh $PROPOSAL_ID |
| 52 | + node: sei-node-0 |
| 53 | + |
| 54 | + # EXECUTE UPGRADE SCENARIOS |
| 55 | + # Confirm no panic before upgrade and block height |
| 56 | + - cmd: verify_running.sh |
| 57 | + node: sei-node-0 |
| 58 | + env: RUNNING_BEFORE_UPGRADE_NODE_0 |
| 59 | + - cmd: verify_running.sh |
| 60 | + node: sei-node-1 |
| 61 | + env: RUNNING_BEFORE_UPGRADE_NODE_1 |
| 62 | + - cmd: verify_running.sh |
| 63 | + node: sei-node-2 |
| 64 | + env: RUNNING_BEFORE_UPGRADE_NODE_2 |
| 65 | + - cmd: verify_running.sh |
| 66 | + node: sei-node-3 |
| 67 | + env: RUNNING_BEFORE_UPGRADE_NODE_3 |
| 68 | + |
| 69 | + # Upgrade to major release (node 0) |
| 70 | + - cmd: seid_upgrade.sh $VERSION |
| 71 | + node: sei-node-0 |
| 72 | + |
| 73 | + # Confirm the node is not running because it upgraded too early |
| 74 | + - cmd: verify_panic.sh $TARGET_HEIGHT |
| 75 | + node: sei-node-0 |
| 76 | + env: PANIC_AFTER_EARLY_UPGRADE_NODE_0 |
| 77 | + |
| 78 | + # Wait for the target height (non-panicked nodes) |
| 79 | + - cmd: wait_for_height.sh $TARGET_HEIGHT |
| 80 | + node: sei-node-1 |
| 81 | + - cmd: wait_for_height.sh $TARGET_HEIGHT |
| 82 | + node: sei-node-2 |
| 83 | + - cmd: wait_for_height.sh $TARGET_HEIGHT |
| 84 | + node: sei-node-3 |
| 85 | + |
| 86 | + # Confirm panic and UPGRADE NEEDED log message for non-upgraded node |
| 87 | + - cmd: verify_panic.sh $TARGET_HEIGHT |
| 88 | + node: sei-node-2 |
| 89 | + env: PANIC_AT_BLOCK_HEIGHT_NODE_2 |
| 90 | + - cmd: verify_panic.sh $TARGET_HEIGHT |
| 91 | + node: sei-node-3 |
| 92 | + env: PANIC_AT_BLOCK_HEIGHT_NODE_3 |
| 93 | + |
| 94 | + # Upgrade all nodes to major release |
| 95 | + - cmd: seid_upgrade.sh $VERSION |
| 96 | + node: sei-node-1 |
| 97 | + - cmd: seid_upgrade.sh $VERSION |
| 98 | + node: sei-node-2 |
| 99 | + - cmd: seid_upgrade.sh $VERSION |
| 100 | + node: sei-node-3 |
| 101 | + |
| 102 | + # Downgrade node 0 so that it can sync the rest of the blocks |
| 103 | + - cmd: seid_downgrade.sh |
| 104 | + node: sei-node-0 |
| 105 | + |
| 106 | + # Confirm nodes are running after upgrade |
| 107 | + - cmd: verify_running.sh |
| 108 | + node: sei-node-1 |
| 109 | + env: RUNNING_UPGRADED_NODE_1 |
| 110 | + - cmd: verify_running.sh |
| 111 | + node: sei-node-2 |
| 112 | + env: RUNNING_UPGRADED_NODE_2 |
| 113 | + - cmd: verify_running.sh |
| 114 | + node: sei-node-3 |
| 115 | + env: RUNNING_UPGRADED_NODE_3 |
| 116 | + |
| 117 | + # Wait for the target height (on node 0, catching up) |
| 118 | + - cmd: wait_for_height.sh $TARGET_HEIGHT |
| 119 | + node: sei-node-0 |
| 120 | + |
| 121 | + # Confirm node 0 has now panicked and logged |
| 122 | + - cmd: verify_panic.sh $TARGET_HEIGHT |
| 123 | + node: sei-node-0 |
| 124 | + env: PANIC_AT_BLOCK_HEIGHT_NODE_0 |
| 125 | + - cmd: verify_upgrade_needed_log.sh $TARGET_HEIGHT $VERSION |
| 126 | + node: sei-node-0 |
| 127 | + env: LOG_AT_BLOCK_HEIGHT_NODE_0 |
| 128 | + |
| 129 | + # Upgrade node 0 now that it has caught up |
| 130 | + - cmd: seid_upgrade.sh $VERSION |
| 131 | + node: sei-node-0 |
| 132 | + |
| 133 | + # node 0 should be running now |
| 134 | + - cmd: verify_running.sh |
| 135 | + node: sei-node-0 |
| 136 | + env: RUNNING_UPGRADED_NODE_0 |
| 137 | + |
| 138 | + verifiers: |
| 139 | + # Nodes are running before upgrade |
| 140 | + - type: eval |
| 141 | + expr: RUNNING_BEFORE_UPGRADE_NODE_0 == "PASS" |
| 142 | + - type: eval |
| 143 | + expr: RUNNING_BEFORE_UPGRADE_NODE_1 == "PASS" |
| 144 | + - type: eval |
| 145 | + expr: RUNNING_BEFORE_UPGRADE_NODE_2 == "PASS" |
| 146 | + - type: eval |
| 147 | + expr: RUNNING_BEFORE_UPGRADE_NODE_3 == "PASS" |
| 148 | + |
| 149 | + # Upgraded nodes panic because they were upgraded too early |
| 150 | + - type: eval |
| 151 | + expr: PANIC_AFTER_EARLY_UPGRADE_NODE_0 == "PASS" |
| 152 | + |
| 153 | + # At least one node should panic and print the upgrade-needed log message |
| 154 | + # The other will possibly hang on block-1 because of missing peers (due to race) |
| 155 | + - type: eval |
| 156 | + expr: PANIC_AT_BLOCK_HEIGHT_NODE_2 == "PASS" |
| 157 | + - type: eval |
| 158 | + expr: PANIC_AT_BLOCK_HEIGHT_NODE_3 == "PASS" |
| 159 | + |
| 160 | + # After upgrade, all nodes are running |
| 161 | + - type: eval |
| 162 | + expr: RUNNING_UPGRADED_NODE_1 == "PASS" |
| 163 | + - type: eval |
| 164 | + expr: RUNNING_UPGRADED_NODE_2 == "PASS" |
| 165 | + - type: eval |
| 166 | + expr: RUNNING_UPGRADED_NODE_3 == "PASS" |
| 167 | + |
| 168 | + # After downgrade and restart, node 0 panics at height |
| 169 | + - type: eval |
| 170 | + expr: PANIC_AT_BLOCK_HEIGHT_NODE_0 == "PASS" |
| 171 | + - type: eval |
| 172 | + expr: LOG_AT_BLOCK_HEIGHT_NODE_0 == "PASS" |
| 173 | + |
| 174 | + # After upgrade, node 0 is running |
| 175 | + - type: eval |
| 176 | + expr: RUNNING_UPGRADED_NODE_0 == "PASS" |
0 commit comments