Beginner tutorial error when deploying simple SUI package

i’m following this simple tutorial on the docs (Write a Sui Move Package | Sui Docs) and i can successfully run sui move build to compile my contract, but as soon as i try to publish with sui client publish --gas-budget 5000000000, i get the following error:

Successfully verified dependencies on-chain against source.
RPC call failed: ErrorObject { code: ServerError(-32000), message: "Failed to sign transaction by a quorum of validators because of locked objects: {TransactionDigest(64pTVKqATdESYRLeMzzgQYwDJXjWtHWz1NMviPLsscZD): ([(k#9997f3377818e70427ba2a2e716ef63ffdc9515913aa5f7dd7f42c8cf1e0bd1c2b43326daa10abbcb3af8d66ea995953091b9638add0d941d1df8c6355cbd3296fea2d4850a9d3044d66834c179590dd49b3464e6391629d81945943121b1316, (0xea07a7f2c5f8d21db4aeacd2ef10a3d5908c8209e82d9467de34792099de11aa, SequenceNumber(88), o#B9M5AN2gVquwVgHvZcdvgqAMZrLb6iPiFR9bZb3ocM7m)), ..., retried a conflicting transaction None, success: None", data: None }

any ideas what this error is about? how can i publish my package on devnet? thank you for your help!

5 Likes

This error happens if you try and run two transactions simultaneously (e.g. start one before the previous one finishes). If you retry running the publish transaction, without running another transaction before or at the same time, it should succeed. You may also need to acquire more gas from the faucet (or wait a day – for the epoch to roll over – for the objects to get unlocked)

When you run a transaction that involves objects that your address owns (like the gas objects) validators reserve the latest version of the object to be used by the transaction it is signing. If you try and run two transactions simultaneously and they refer to the same object, then they will compete with each other for signatures from validators. In the happy case, one of the transactions wins, and runs, and the other transaction fails to get enough signatures. In the unhappy case, both transactions can fail to get enough signatures (if both got more than a third of the validator’s signatures, then neither can get over two thirds, which is the threshold), this is called equivocation, and from that point the objects that were inputs to both transactions can’t be used for any other transactions.

At the end of the epoch (they are roughly a day long – you can check progress to the next epoch change on https://suiexplorer.com), all locks are released, so you can use the objects again, but if you haven’t had an epoch change since you last tried, you will need to acquire more gas.

3 Likes