Open leighmcculloch opened 11 months ago
The same problem exists when bumping a WASM. WASM is only ever stored in persistent storage. The CLI requires durability to be specified. It actually allows temporary to be specified and ignores it and bumps the persistent.
With the latest changes on main
, it looks like we do not support the bump
command anymore. What would be the equivalent functionality, and are we still experiencing this issue?
./target/debug/soroban contract --help
Tools for smart contract developers
Usage: soroban contract <COMMAND>
Commands:
bindings Generate code client bindings for a contract
build Build a contract from source
extend Extend the time to live ledger of a contract-data ledger entry
deploy Deploy a contract
fetch Fetch a contract's Wasm binary
inspect Inspect a WASM file listing contract functions, meta, etc
install Install a WASM file to the ledger without creating a contract instance
invoke Invoke a contract function
optimize Optimize a WASM file
read Print the current value of a contract-data ledger entry
restore Restore an evicted value for a contract-data legder entry
For reference, my CLI version:
./target/debug/soroban version
soroban 20.0.0-rc4 (v20.0.0-rc4-42-g7f8ad60b9921b43871b2a5ec7e4d9494b909446f)
soroban-env 20.0.0-rc2 (2674d867d7c6aa4212abab05ff30e5804ff1db90)
soroban-env interface version 85899345989
stellar-xdr 20.0.0-rc1 (9c97e4fa909a0b6455547a4f4a95800696b2a69a)
xdr curr (6a620d160aab22609c982d54578ff6a63bfcdc01)
Bump was renamed to extend in:
I am applying to this issue via OnlyDust platform.
With over four years in blockchain and backend development, I’ve worked across different ecosystems, handling everything from smart contract design to on-chain interactions and protocol integration. I focus on building secure, scalable, and reliable blockchain applications, managing both on-chain and off-chain infrastructure.
I'd review the logic causing the issue, explore alternative solutions, and wrap up with thorough testing to ensure the fix works across different scenarios
Hi @leighmcculloch and @janewang I am applying to this issue via OnlyDust platform.
My name is Koxy. I'm a blockchain Rust developer and Stellar ecosystem contributor. As an SCF Pathfinder and contributor to Stellar documentation, I have hands-on experience with both Rust and the Stellar platform.
My background in open-source development and familiarity with Stellar's architecture positions me well to address the timing issues in Soroban CLI tests.
I'm eager to implement immediate solutions while collaborating with the team on long-term improvements to enhance Soroban CLI's reliability.
To approach this problem with the Soroban CLI's contract bump command, I would:
Investigate: First, I'd review the current implementation of the contract bump
command, focusing on how it handles durability and storage.
Confirm Behavior: Verify the issue by reproducing it in different environments to ensure it's consistent.
Analyze Requirements: Determine if durability is actually necessary for bumping contract instances, given that they're always stored in persistent storage.
Propose Changes: Modify the CLI code to: a) Remove the mandatory durability flag for contract instance bumps. b) Default to persistent storage for contract instances. c) Improve error messaging if temporary storage is accidentally specified.
Implement: Make the necessary code changes, ensuring backward compatibility if possible.
Test Thoroughly: Create comprehensive tests covering various scenarios, including edge cases.
Update Documentation: Revise CLI documentation and help messages to reflect the changes.
Submit PR: Create a pull request with detailed explanations of the changes and their rationale.
Collaborate: Work with maintainers to address any feedback and iterate on the solution as needed.
I am applying to this issue via OnlyDust platform.
I have a solid background in JavaScript and TypeScript development, particularly in building and maintaining command-line interfaces. My experience includes debugging and resolving issues related to contract interactions in blockchain environments.
I would analyze the bump command implementation to understand why the durability requirement is enforced. After confirming that a contract instance is always stored in persistent storage, I’d modify the code to remove the durability requirement. Additionally, I would enhance error handling to provide clearer messages for accidental temporary durability specifications.
Hi @janewang @stellarsaur I just worked on this issue. Kindly help review. This is my pull request.
@ElliotFriend pls help review this as well. This is an issue I worked on from ODhack.
https://github.com/stellar/stellar-cli/pull/1639#issuecomment-2391896434
What version are you using?
What did you do?
What did you expect to see?
Successful bump of contract instance.
What did you see instead?
Error message saying that durability must be specified.
Discussion
The
contract bump
subcommand when executed with only a contract ID and no storage key, will bump the contract instance. The contract instance is always stored in persistent storage, so there's no need to require that durability be specified.Additionally, if someone does accidentally specify temporary, the error message is not trivial to understand. So the application can lead a developer down a path that is confusing.