-
Notifications
You must be signed in to change notification settings - Fork 72
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
stellar tx build --meta
creates multiple entries
#1694
Comments
I'm not able to reproduce the behaviour described above:
|
@Ifropc Could you share a full set of commands you're running to reproduce the issue? |
@leighmcculloch can you try running build command in the same setup multiple times? |
See above, the output is me running the build command multiple times. If that isn't what you were doing can you share an example? |
^ Tried on a different machine just in case |
I can check on this issue when I have time especially if it's not reproducible 🤔 |
Thanks for making an issue @Ifropc - I heard you mention something about this in the demo yesterday, and wanted to reach out to check on it. I may be incorrect with this, but the way my mental model works is that each time we run I can try to repro it as well, and am happy to dig into it a bit on Monday. |
I tried to reproduce this issue this morning, and wasn't able to. Here's what I did. @Ifropc lmk if you want another set of eyes while you dig into this - happy to help out! ➜ stellar contract build --meta example-key=example-value --meta hello=goodbye --out-dir /tmp
⚠️ A new release of stellar-cli is available: 21.5.0 -> 21.5.3
cargo rustc --manifest-path=contracts/hello-world/Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
Finished `release` profile [optimized] target(s) in 0.16s
➜ stellar contract build --meta example-key=example-value --meta hello=goodbye --out-dir /tmp
⚠️ A new release of stellar-cli is available: 21.5.0 -> 21.5.3
cargo rustc --manifest-path=contracts/hello-world/Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
Finished `release` profile [optimized] target(s) in 0.14s
➜ stellar contract build --meta example-key=example-value --meta hello=goodbye --out-dir /tmp
⚠️ A new release of stellar-cli is available: 21.5.0 -> 21.5.3
cargo rustc --manifest-path=contracts/hello-world/Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
Finished `release` profile [optimized] target(s) in 0.15s
➜ stellar contract build --meta example-key=example-value --meta hello=goodbye --meta hola=adios --out-dir /tmp
⚠️ A new release of stellar-cli is available: 21.5.0 -> 21.5.3
cargo rustc --manifest-path=contracts/hello-world/Cargo.toml --crate-type=cdylib --target=wasm32-unknown-unknown --release
Finished `release` profile [optimized] target(s) in 0.17s
➜ stellar contract deploy --source alice --network testnet --wasm /tmp/hello_world.wasm
⚠️ A new release of stellar-cli is available: 21.5.0 -> 21.5.3
ℹ️ Simulating install transaction…
🌎 Submitting install transaction…
ℹ️ Signing transaction: 8d8cbb6f5aa1c2e2734fdaa10fe95bce653d7cf13bc7753797b929c3a6ff1502
ℹ️ Using wasm hash 804f2cdefc544178b9d3041bd6a0e7201a9a1a7c0c6216b480ac1d8466ff6314
ℹ️ Simulating deploy transaction…
🌎 Submitting deploy transaction…
ℹ️ Transaction hash is 27ca2fdecfcf680c244f3748d6d52f45b98d6683249b6fe2266d518a1794822d
🔗 https://stellar.expert/explorer/testnet/tx/27ca2fdecfcf680c244f3748d6d52f45b98d6683249b6fe2266d518a1794822d
ℹ️ Signing transaction: 27ca2fdecfcf680c244f3748d6d52f45b98d6683249b6fe2266d518a1794822d
🔗 https://stellar.expert/explorer/testnet/contract/CDM3XH2NHXHJDA3WYGMLK3J7BSLIDEW25SUASUG2LO3N2TUPKC32XUJE
✅ Deployed!
CDM3XH2NHXHJDA3WYGMLK3J7BSLIDEW25SUASUG2LO3N2TUPKC32XUJE
➜ stellar contract info meta --id CDM3XH2NHXHJDA3WYGMLK3J7BSLIDEW25SUASUG2LO3N2TUPKC32XUJE --network testnet
⚠️ A new release of stellar-cli is available: 21.5.0 -> 21.5.3
Contract meta:
• rsver: 1.81.0 (Rust version)
• rssdkver: 21.7.6#c6cca8f8cf75618c24ceb5d9ffdfe735486ae1e9 (Soroban SDK version and it's commit hash)
• example-key: example-value
• hello: goodbye
• hola: adios |
@Ifropc could you share a Dockerfile that demonstrates the issue? |
@leighmcculloch I'll get back to this issue a bit later and will try to reproduce it locally again and dig a bit more into it. Will see if it can be reproduced in the docker |
@leighmcculloch @Ifropc I was able to reproduce this bug in a docker container.
and then to run:
and once in the docker container:
|
I think that I have a fix that should work, that I'll get pushed up today. However, I am still uncertain why this behaves differently on MacOS vs Linux - I'll keep digging in on that today too, but would love another set of eyes on that. |
For some more context
|
What version are you using?
Latest main
What did you do?
Run the same command multiple times:
What did you expect to see?
Only one meta with
example-key: example-value
is present in the contractWhat did you see instead?
Every time command is executed new meta is appended:
(Here I ran the same command with the same out-dir 4 times: as you can see every time we append a new meta to the file, on top of an existing one)
The simplest solution would be to delete existing wasm file. Because we append new
contractmetav0
to an existing file, if the file already exists we will do just that -- append it to a "dirty" WASMThe text was updated successfully, but these errors were encountered: