Open forgetso opened 1 year ago
Are you using substrate-contracts-node
? If so, what version is it.
We also released ink! 4 release candidate which you should use now.
I can successfully deploy with substrate contracts node.
This deploy failure relates to building the following substrate version:
commit 1cc97dd30537997ff4c9827beb2ef0cac9c49063 (HEAD -> polkadot-v0.9.34, upstream/polkadot-v0.9.34)
➜ substrate git:(polkadot-v0.9.34) ✗ ./target/release/substrate --version
substrate 3.0.0-dev-1cc97dd3053
I'd like to test against this as well because substrate contracts node is in instant seal mode and its useful to test against 6s block times as well.
Thanks for the hint about inkv4 release candidate.
@forgetso any updates here?
Hi @HCastano, building the contract with the latest ink release candidate makes no difference when deploying. The same error message appears.
This time I was using the latest cargo contract release candidate built and installed locally.
cargo contract --version
cargo-contract-contract 2.0.0-rc.1-0a98d16-x86_64-unknown-linux-gnu
Substrate version is unchanged.
@forgetso can you update your Substrate node to the polkadot-v0.9.37
branch and try again? Also, ink! 4.0 and cargo-contract
2.0 are out, so you should update to those as well.
If that doesn't help can you share the contract you're trying to deploy so we can try and reproduce it on our end?
Hi, I upgraded cargo contract to version 2 using
cargo install cargo-contract --version 2.0.0
cargo contract --version
cargo-contract-contract 2.0.0-unknown-x86_64-unknown-linux-gnu
I upgraded substrate to branch polkadot-v0.9.37
./target/release/substrate --version
substrate 3.0.0-dev-f38bd6671d4
The contract builds with cargo contract but deploying still fails when deploying to the substrate node. Dry run succeeds.
RUST_LOG=info cargo contract instantiate --args 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 1000000000000 1000000000000 --constructor "default" --suri "//Alice" --value 20000000000000 --url "ws://localhost:9944"
Dry-running default (skip with --skip-dry-run)
Success! Gas required estimated at Weight(ref_time: 512696930, proof_size: 0)
Confirm transaction details: (skip with --skip-confirm)
Constructor default
Args 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 1000000000000 1000000000000
Gas limit Weight(ref_time: 512696930, proof_size: 0)
Submit? (Y/n): Y
ERROR: Rpc error: RPC error: RPC call failed: ErrorObject { code: ServerError(1002), message: "Verification Error: Runtime error: Execution failed: Runtime panicked: Bad input data provided to validate_transaction: Could not decode `ChargeAssetTxPayment::asset_id`:\n\tunexpected first byte decoding Option\n", data: Some(RawValue("RuntimeApi(\"Execution failed: Runtime panicked: Bad input data provided to validate_transaction: Could not decode `ChargeAssetTxPayment::asset_id`:\\n\\tunexpected first byte decoding Option\\n\")")) }
The contract is here. Use the linked branch.
Can confirm this issue still exists with polkadot-v0.9.39
branch.
(base) ➜ substrate git:(polkadot-v0.9.39) ✗ ./target/release/substrate --version
substrate 3.0.0-dev-1837f423b49
The contract does deploy with polkadot apps.
This looks to be an instance of https://github.com/paritytech/cargo-contract/issues/524.
So it works for substrate-contracts-node
because it uses PlainTip
, but not for the substrate node-runtime
Cargo contract version:
cargo-contract-contract 2.0.0-rc-unknown-x86_64-unknown-linux-gnu
Substrate node:
Version: 3.0.0-dev-1cc97dd3053
The contract was built with inkv4. From the toml:
Dry run seems to work:
I can see the error is something to do with
ChargeAssetTxPayment
. Could the issue be the proof size is set to0
?Here is the stack from the substrate node: