wasmd: During migration from legacy 20 byte address a 'no history for address' error occurs
In testing 0.23 on a testnet with existing contract instance an error is thrown due to the way kvstore addresses are generated. Addresses are based on the current 32 byte length form, unfortunately some contracts were established with the prior 20 byte address form which is incompatible with this approach.
The above line always presumes the length will be 32 and it fails because it can’t delete the history here:
This occurred during testing on Provenance (using wasmd 0.23) with the following:
provenanced tx wasm migrate \
tp15qkf84uddc0zjpkjrn64rln75w40plrtcq4kp3 \
111 \
'{}' \
--chain-id pio-testnet-1 \
--node tcp://rpc-0.test.provenance.io:26657 \
[ ... ]
Error: rpc error: code = InvalidArgument desc = recovered: no history for tp15qkf84uddc0zjpkjrn64rln75w40plrtcq4kp3
stack:
goroutine 764913 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x65
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 19 (19 by maintainers)
Commits related to this issue
- fix: bump wasmd to v0.24 bring back support to 20bytes long contract address (see: https://github.com/CosmWasm/wasmd/issues/758) — committed to fetchai/fetchd by daeMOn63 5 years ago
- feat: upgrade fetchd to dorado version (ECO-965) (#198) * feat: upgrade fetchd to dorado version Dependencies: - bump cosmos-sdk to v0.45.1 - bump tendermint to v0.34.16 - bump wasmd to v0.23... — committed to fetchai/fetchd by daeMOn63 5 years ago
@channa-figure / @iramiller would you put in a PR to wasmd with your solution? On the current Juno testnet we’ve moved off our fork and onto mainline wasmd, so we can test a point release/pre-release as well if it’s in this repo. Otherwise a bit of faff to change to your fork, test, then change back to mainline 🙂
I agree with @iramiller that we should support both and new addresses are 32 bytes
We have a fork with this change which we are running now on our testnet for evaluation… it would be straight forward to contribute this solution… in addition if this solution needs to develop further we are interested in helping out cosmwasm with testing these changes and we would want to see those included in our network before we cut our next release.
Addresses are stored in many places and we cannot change them. Wasmd upgrades must work with immutable contracts.
They don’t want 20 bytes. They want 32, but want backwards support for 20 bytes. Note that various components in the sdk (notably ibc) choked on 32 bytes addresses when Provenance and Juno made these choices.
It is more complex for wasmd, but it is needed complexity and part of the follow up from our decision to move to 32 byte contract addresses (which I think everyone on this thread commented on and supported). I agree with @iramiller that we need to support this on the sdk side.
I also know that Alex is very busy with Tgrade work right now, but I would ask if there is interest in an external PR to add this as this is a critical fix needed for both your chains.
The contract address is well known and used in several frontend applications… so while we could programmatically shift the state to a new 32 byte address that would break the application dependencies above the blockchain if we modify it. In this case there is a consortium of banks that all agreed on it. Certainly do able but the ask is to avoid that because these kinds of changes take more time than they should.
My fears about not supporting the 32 byte form are not well defined but are based on suspicions that future applications over IBC/interchain may see difficulties. By removing the constraint that the address will be 32 in length then existing ones continue to work and all future ones can be the proper 32 byte form.