stellar / soroban-examples

Example Soroban Contracts
Apache License 2.0
57 stars 60 forks source link

Contract deploying and invoking result in `xdr processing error: xdr value invalid` whenever anything is changed slightly from examples #311

Closed Melbourneandrew closed 3 months ago

Melbourneandrew commented 3 months ago

Also detailed in this stack exchange post

Note: I am currently competing in the Consensus Agenda hackathon and building for the Stellar track. I am posting this across many repos because I'm on a time crunch!

What version are you using?

soroban 20.3.4 (f30a47fc58ace4437b0252919420838550481420) soroban-env 20.3.0 (befdf4b2b6061bd6da20b0f93d539d6ad8d8be22) soroban-env interface version 85899345920 stellar-xdr 20.1.0 (8b9d623ef40423a8462442b86997155f2c04d3a1) xdr curr (b96148cd4acc372cc9af17b909ffe4b12c43ecb6)

What did you do?

Clone an example / setup hello world with soroban contract init ./ --with-example increment

Running through the following commands with the code unedited results in expected behavior. Changing something as slight as count+=1 to count+=2 results in the error.

soroban contract build
soroban contract install \
  --network testnet \
  --source alice \
  --wasm target/wasm32-unknown-unknown/release/soroban_increment_contract.wasm
soroban contract deploy \
  --wasm-hash <output previous command> \
  --source alice \
  --network testnet

(error occurs here but if you run the deploy command again, it goes through and returns a C address)

soroban contract invoke \
  --id <output from previous command> \
  --source alice \
  --network testnet \
  -- \
  increment

Error occurs here no matter how many times you run the command

> xdr processing error: xdr value invalid

What did you expect to see?

The result of the increment routine being called.

What did you see instead?

xdr processing error: xdr value invalid

leighmcculloch commented 3 months ago

Duplicate of https://github.com/stellar/rs-soroban-sdk/issues/1276