0

I just trying demo from https://github.com/stellar/soroban-examples

After download, cd into "increment" project.

It build , deploy and run success

[12:20:33] ubuntu@wang /mnt/volume2/coding/stellar_/soroban-examples/increment [main]
(increment) ❱❱❱ soroban contract invoke \
  --id CD22GTHMWRIRVYJI55CAGSYGTMA6KTBESNU7D4NAEDBNUJIT47JSNYMU \
  --source alice \
  --network testnet \
  -- \
  increment
1

But, if I make a small change on increment/src/lib.rs file, change count += 1; to count += 2;, then it throw error xdr value invalid, but will success if try more times.

(increment) ❱❱❱ soroban contract deploy \
>   --wasm target/wasm32-unknown-unknown/release/soroban_increment_contract.wasm \
>   --source alice \
>   --network testnet
error: xdr processing error: xdr value invalid

Hower, I alway got xdr value invalid error when running invoke

(increment) ❱❱❱ soroban contract invoke \
  --id CAYX5EUZQEN2EH2XV7VNA7WUHOPRODXGAN6C4LRHGSX7DFEH7QJGRGS7 \
  --source alice \
  --network testnet \
  -- \
  increment
error: xdr processing error: xdr value invalid
(increment) ❱❱❱ soroban contract invoke \
  --id CAYX5EUZQEN2EH2XV7VNA7WUHOPRODXGAN6C4LRHGSX7DFEH7QJGRGS7 \
  --source alice \
  --network testnet \
  -- \
  --help
error: xdr processing error: xdr value invalid

my enviroment info:

(increment) ❱❱❱ rustc --version
rustc 1.78.0 (9b00956e5 2024-04-29)

[16:47:01] ubuntu@wang /mnt/volume2/coding/stellar/soroban-examples/increment [main]
(increment) ❱❱❱ soroban --version
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)

[16:47:39] ubuntu@wang /mnt/volume2/coding/stellar/soroban-examples/increment [main]
(increment) ❱❱❱ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/ubuntu/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu
solana

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (overridden by '/mnt/volume2/coding/stellar/soroban-examples/rust-toolchain.toml')
rustc 1.78.0 (9b00956e5 2024-04-29)

[16:47:58] ubuntu@wang /mnt/volume2/coding/stellar/soroban-examples/increment [main]
(increment) ❱❱❱ cat ../rust-toolchain.toml
[toolchain]
channel = "stable"
targets = ["wasm32-unknown-unknown"]
components = ["rustc", "cargo", "rustfmt", "clippy", "rust-src"]

My colleague also try on his macBook and got the same issue as me.

1 Answer 1

2

I encountered same error when using soroban-cli v20.3.4. The issue went away after I re-build same contract with most recent version of soroban-cli listed in https://github.com/stellar/stellar-cli/releases.

$ cargo install --locked --version 21.0.0-rc.1 soroban-cli
1
  • This Fixed it for me also!
    – Dr Pi
    Commented Jun 12 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.