stellar / stellar-cli

CLI for Stellar developers
Apache License 2.0
72 stars 70 forks source link

soroban-cli: prevents deployment of contracts built with an rc sdk to any network and not just public network #1077

Closed leighmcculloch closed 11 months ago

leighmcculloch commented 1 year ago

What version are you using?

$ soroban version
soroban 20.0.0-rc.4.2 (v20.0.0-rc.4.1-4-g4e9a48756b96e4e1a070105bad202f39901139ad-dirty)
soroban-env 20.0.0-rc2 (8c63bff68a15d79aca3a705ee6916a68db57b7e6)
soroban-env interface version 85899345977
stellar-xdr 20.0.0-rc1 (d5ce0c9e7aa83461773a6e81662067f35d39e4c1)
xdr curr (9ac02641139e6717924fdad716f6e958d0168491)

What did you do?

$ docker run --rm -i -p 8000:8000 stellar/quickstart:testing --testnet --enable-soroban-rpc
$ export SOROBAN_RPC_URL=http://localhost:8000/soroban/rpc
$ export SOROBAN_NETWORK_PASSPHRASE='Test SDF Network ; September 2015'
$ soroban config identity fund
$ soroban contract install --wasm out/contract.optimized.wasm

What did you expect to see?

I expected the contract to deploy, because I'm submitting the contract to a test network, not a public network.

What did you see instead?

error: the deployed smart contract out/contract.optimized.wasm was built with Soroban Rust SDK v20.0.0-rc2#0992413f9b05e5bfb1f872bce99e89d9129b2e61, a release candidate version not intended for use with the Stellar Public Network. To deploy anyway, use --ignore-checks

Discussion

The error message is confusing because it explicitly says it won't let me deploy to the Stellar Public Network, which is a specific network. However, it appears to display message for any network I'm connected to, including a local or test network.

Looking at the code it looks like it displays this error message for any network: https://github.com/stellar/soroban-tools/blob/c68d03cd8f0588263e9a47b93ed8b2dc28d32f2f/cmd/soroban-cli/src/commands/contract/install.rs#L77-L85

Which was introduced in:

Either the error message shouldn't specify the Stellar Public Network, or the error message should only be displayed for when the Network Passphrase is configured to be Public Global Stellar Network ; September 2015. The latter would be my preference because blocking folks from deploying release candidates to a local or test network doesn't seem like it would be of significant benefit.

stellarsaur commented 11 months ago

Agreed that we should only display this error/warning for the public network.