Creating or modifying upgrade.json
Hands-on exercise: Append upgrade entries to re-enable the allowlists and set your wallet as admin.
Objectives
By the end of this exercise, you will be able to:
- Append new
precompileUpgradesentries (without modifying old ones). - Re-enable
txAllowListConfigandcontractDeployerAllowListConfig. - Set your wallet address as
adminAddressesfor both precompiles.
Prerequisites
Before starting this exercise, ensure you have:
- Completed the de-activation section and confirmed both precompiles are currently inactive.
- Access to the chain config directory:
~/.avalanchego/configs/chains/<YOUR_BLOCKCHAIN_ID>/
- Your wallet address (EVM
0x...) that you want to set as the admin.
Instructions
Step 1: Compute new (future) activation timestamps
Inside the validator container, compute two future timestamps. These must be:
- In the future relative to chain head
- Greater than any timestamps you already used in
upgrade.json
NOW=$(date +%s)
T1=$((NOW + 600))
T2=$((NOW + 601))
echo $T1
echo $T2Step 2: Append re-activation entries (do not edit old upgrades)
Go to your chain config directory and open upgrade.json:
cd ~/.avalanchego/configs/chains/<YOUR_BLOCKCHAIN_ID>
cat upgrade.jsonYour file should already contain the two disable entries you added earlier. Keep them exactly as-is, and append two new entries that re-enable the precompiles with adminAddresses:
{
"precompileUpgrades": [
{
"txAllowListConfig": {
"blockTimestamp": 1700000000,
"disable": true
}
},
{
"contractDeployerAllowListConfig": {
"blockTimestamp": 1700000001,
"disable": true
}
},
{
"txAllowListConfig": {
"blockTimestamp": 1700001000,
"adminAddresses": ["0x...YOUR_WALLET_ADDRESS..."]
}
},
{
"contractDeployerAllowListConfig": {
"blockTimestamp": 1700001001,
"adminAddresses": ["0x...YOUR_WALLET_ADDRESS..."]
}
}
]
}Replace:
1700001000/1700001001with the timestamps you computed in Step 10x...YOUR_WALLET_ADDRESS...with your actual EVM address
Once an upgrade activates, precompileUpgrades must remain append-only. Do not modify or remove older entries, or the node may refuse to start.
Step 3: Sanity check
Confirm your file contains four entries (two disables + two enables) and that timestamps are strictly increasing:
cat upgrade.jsonExpected Output
Your upgrade.json includes the earlier disable upgrades and now also includes two new enable upgrades with your wallet set as admin.
upgrade.json updated (append-only)Verification
To verify you've completed this exercise successfully:
- Both new entries include
adminAddresseswith your wallet address. - All
blockTimestampvalues are in increasing order and in the future.
Troubleshooting
Issue: I accidentally edited old upgrade entries
Problem: After an upgrade activates, changing old entries can prevent startup.
Solution: Restore the exact previous entries if possible, then only append new upgrades moving forward.
Next Steps
Next, restart your Docker validator container so the node loads the updated upgrade.json.
Is this guide helpful?