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

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

Closed
Melbourneandrew opened this issue May 30, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Melbourneandrew
Copy link

Also detailed in this stack exchange post

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

@Melbourneandrew Melbourneandrew added the bug Something isn't working label May 30, 2024
@leighmcculloch
Copy link
Member

leighmcculloch commented May 30, 2024

Hi! Thanks for reporting this issue. It looks like in your example that the transaction is being submitted to testnet which is currently running XDR v21, however the CLI in use is v20.

You'll need to install the CLI v21 with:

cargo install --locked stellar-cli --version 21.0.0-rc.1

@Melbourneandrew
Copy link
Author

Melbourneandrew commented May 30, 2024

I am still encountering this error :(

I have run

cargo install --locked stellar-cli --version 21.0.0-rc.1

and

cargo install --locked stellar-xdr --version 21.0.1 --features="cli"

Running cargo install --list shows

soroban-cli v20.3.4:
    soroban
stellar-cli v21.0.0-rc.1:
    stellar
stellar-xdr v21.0.1:
    stellar-xdr

But running soroban version shows

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)

@leighmcculloch
Copy link
Member

leighmcculloch commented May 30, 2024

Ah install the last Soroban CLI with:

cargo install --locked soroban-cli --version 21.0.0-rc.1

We're renaming it to stellar-cli and I gave you the install command for it but you are running the Soroban command.

@Melbourneandrew
Copy link
Author

I got it working using this command provided to me by the great dev relations folks at the Consensus Agenda hackathon!
Shout out to @Julian-dev28 and @kalepail!

cargo install --git https://github.com/stellar/stellar-cli soroban-cli

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

2 participants