Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls to productions chains result in error #1291

Closed
SkymanOne opened this issue Aug 21, 2023 · 9 comments
Closed

Calls to productions chains result in error #1291

SkymanOne opened this issue Aug 21, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@SkymanOne
Copy link
Contributor

Upon work on #1290 I run into the issue that I can not submit instantiate extrinsic to the production chains. Astar and Shiden throw HTTP version error:

cargo contract instantiate --suri //Alice --url wss://rpc.astar.network --args false -x
ERROR: Rpc error: RPC error: Networking or low-level protocol error: Error in the WebSocket handshake: http version was not 1.1

When trying to upload & instantiate on Aleph Zero Main/Test-net cargo-contract fails to decode events:

ERROR: Could not decode `ContractResult::events`:
	Could not decode variant byte for `Option`:
		Not enough data to fill buffer


Caused by:
    0: Could not decode variant byte for `Option`:
       	Not enough data to fill buffer

    1: Not enough data to fill buffer
@SkymanOne SkymanOne added the bug Something isn't working label Aug 21, 2023
@ascjones
Copy link
Collaborator

Is this cargo-contract master you are using?

@ascjones
Copy link
Collaborator

EventRecord added the events field: https://github.com/paritytech/substrate/blob/7aacdf1755e63ba2b1aa3ace65aea063db421230/frame/contracts/primitives/src/lib.rs#L83.

So cargo-contract is expecting to decode that field, at the very least a 0 for None. Most likely the AZERO chain uses a legacy version of pallet-contracts which does not have this field.

Have you tried cargo-contract 3.0.1?

@ascjones
Copy link
Collaborator

ascjones commented Aug 22, 2023

Currently cargo-contract master is only guaranteed to work with the latest substrate-contracts-node release.

Although we should aim to support different versions of pallet-contracts: see #1168

@SkymanOne
Copy link
Contributor Author

Is this cargo-contract master you are using?

Yes

@DaddyDillZero
Copy link

Anyone knows the fix to this? For my case, it was working well with Aleph's testnet but not mainnet.

@ascjones
Copy link
Collaborator

ascjones commented Dec 4, 2023

Possibly the testnet is running with a more recent version of pallet_contracts and the mainnet has an older, incompatible version?

@DaddyDillZero
Copy link

Possibly the testnet is running with a more recent version of pallet_contracts and the mainnet has an older, incompatible version?

So do I have to downgrade my cargo contract version for it to work? But if that's the case, then no one previously could call contracts through CLI?

@SkymanOne
Copy link
Contributor Author

So do I have to downgrade my cargo contract version for it to work? But if that's the case, then no one previously could call contracts through CLI?

Yes, you do need to downgrade since en/decoding is handled differently

@smiasojed
Copy link
Collaborator

smiasojed commented Feb 27, 2024

With the PR #1399 we support multiple pallet_contracts versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants