-
Notifications
You must be signed in to change notification settings - Fork 273
Description
Describe the bug
Unable to re-enable stateful precompile after disabling it in Avalanche Network Runner
To Reproduce
- Start a local network with 3 nodes using the following configuration:
POST {{base_url}}/v1/control/start
{
"numNodes": 3,
"globalNodeConfig": "{\"warp-api-enabled\": true}",
"logLevel": "DEBUG",
"blockchainSpecs": [
{
"vm_name": "subnetevm",
"genesis": "/subnet-evm-fork/precompile/contracts/imd5/genesis.json"
}
]
}
Build few blocks
- Successfully disable the IMD5 precompile on a node using:
restart all nodes one by one
jsonPOST {{base_url}}/v1/control/restartnode
{
"name": "node3",
"logLevel": "DEBUG",
"upgradeConfigs": {
"2KqCbpLniLb7Q6mMFGn6fAtkpYG8kH57CdDzZzZdxau4ZwvzRM": "{\"precompileUpgrades\":[{\"imd5Config\":{\"blockTimestamp\":1744375200,\"disable\":true}}]}"
}
}
Build few blocks
- Attempt to re-enable the same precompile with a different timestamp and version:
restart all nodes one by one
jsonPOST {{base_url}}/v1/control/restartnode
{
"name": "node3",
"logLevel": "DEBUG",
"upgradeConfigs": {
"2KqCbpLniLb7Q6mMFGn6fAtkpYG8kH57CdDzZzZdxau4ZwvzRM": "{\"precompileUpgrades\":[{\"imd5Config\":{\"blockTimestamp\":1744375350,\"version\":\"v2\",\"disable\":false}}]}"
}
}
Expected behavior
The node should restart successfully with the IMD5 precompile re-enabled with the new version.
Actual Behavior
The health check fails with the following error in main.log:
[04-11|15:41:32.804] ERROR chains/manager.go:403 error creating chain {"subnetID": "GEieSy2doZ96bpMo5CuHPaX1LvaxpKZ9C72L22j94t6YyUb6X", "chainID": "2KqCbpLniLb7Q6mMFGn6fAtkpYG8kH57CdDzZzZdxau4ZwvzRM", "chainAlias": "2KqCbpLniLb7Q6mMFGn6fAtkpYG8kH57CdDzZzZdxau4ZwvzRM", "vmID": "srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy", "error": "error while creating new snowman vm rpc error: code = Unknown desc = failed to verify genesis: invalid precompile upgrades: PrecompileUpgrade (imd5Config) at [0]: disable should be [true]"}
Logs
main.log
2KqCbpLniLb7Q6mMFGn6fAtkpYG8kH57CdDzZzZdxau4ZwvzRM.log
Operating System
macOS 15.4 (24E248)
Environment Information
Avalanche Network Runner
Subnet-EVM fork with IMD5 precompile
Local development environment
code repository with custom precompile
https://github.com/vasylNaumenko/subnet-evm/tree/custom_precompile