You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cosmwasm_3_0 missing from BuiltInCapabilities(), contracts using RawRange get rejected on store #2578
I was trying out WasmQuery::RawRange on a local wasmd v0.70.5 chain and the contract wouldn't store:
failed to execute message; message index: 0: Error calling the VM: Error during static Wasm validation:
Wasm contract requires unavailable capabilities: {"cosmwasm_3_0"}: create wasm contract failed
The contract is just built with cosmwasm-std = { version = "=3.0.11", features = ["cosmwasm_3_0", "iterator"] }. Since RawRange sits behind the cosmwasm_3_0 feature, the contract exports requires_cosmwasm_3_0, and BuiltInCapabilities() stops at cosmwasm_2_2 / ibc2.
The query itself is already implemented in wasmd (#2263, query_plugins.go), so it looks like the capability just never got added when that landed. cosmwasm_2_1 and cosmwasm_2_2 were both added alongside their features.
To double check, I added "cosmwasm_3_0" to BuiltInCapabilities() and ran the same thing again: store, instantiate, then a smart query where the contract does a RawRange over its own storage. All of it works and I get the keys back (k1=one, k2=two, k3=three). So it's only the missing capability.
Looks like it's been like this since v0.61.0, and it's the same on v0.61.x, v0.70.x and main. Neutron already works around it by appending it in their app (app.go#L802). Chains using the built-in list as is, like Juno, would reject these contracts.
Also a bit annoying: the store tx passes CheckTx and only fails in DeliverTx, so the user pays for a tx that can't succeed.
The fix should just be adding "cosmwasm_3_0" to BuiltInCapabilities() and updating the expected lists in keeper_test.go and tests/integration/module_test.go. With that, the x/wasm and integration tests pass for me. It changes which uploads succeed, though, so I guess it needs to go with a chain upgrade. Not sure if you'd want it backported to 0.61 / 0.70 or just on main.
Activity