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

--output-document isn't respected for tx multisign command #2980

Closed
rootulp opened this issue Jan 4, 2024 · 2 comments · Fixed by celestiaorg/cosmos-sdk#363
Closed

--output-document isn't respected for tx multisign command #2980

rootulp opened this issue Jan 4, 2024 · 2 comments · Fixed by celestiaorg/cosmos-sdk#363
Assignees
Labels
bug Something isn't working

Comments

@rootulp
Copy link
Collaborator

rootulp commented Jan 4, 2024

Context

@adlerjohn reported a bug on Slack

Problem

Is it expected if I celestia-appd tx multisign that the --output-document flag does nothing other than create an empty file (content still gets dumped to stdout)?

Proposal

The --output-document is supposed to redirect output to a file. If output still gets dumped to stdout, this indicates a bug. Note: this may involve fixing a bug in upstream cosmos-sdk or at least our fork until it gets upstreamed.

  1. Fix the bug in celestiaorg/cosmos-sdk: fix: --output-document flag for multisign cosmos-sdk#363
  2. Bump the dep in this repo
@rootulp rootulp added bug Something isn't working investigation item tracks efforts related to an investigation. does not always require a PR to close. labels Jan 4, 2024
@rootulp rootulp self-assigned this Jan 8, 2024
@rootulp
Copy link
Collaborator Author

rootulp commented Jan 8, 2024

Reproduced the error with this snippet:

#!/bin/sh

# Stop script execution if an error is encountered
set -o errexit
# Stop script execution if an undefined variable is used
set -o nounset

# Prerequisite: prior to running this script, start a single node devnet with ./scripts/single-node.sh
CHAIN_ID="private"
KEY_NAME="validator"
KEYRING_BACKEND="test"
BROADCAST_MODE="block"

celestia-appd keys add test1
celestia-appd keys add test2
celestia-appd keys add test3
celestia-appd keys add multisig --multisig test1,test2,test3 --multisig-threshold 2

celestia-appd tx bank send $VALIDATOR $MULTISIG 100000utia --from $VALIDATOR --fees 1000utia --chain-id $CHAIN_ID --keyring-backend $KEYRING_BACKEND --broadcast-mode $BROADCAST_MODE --yes
# Uncomment the next line to verify that the multisig account received some funds
# celestia-appd query bank balances $MULTISIG

celestia-appd tx bank send $MULTISIG $VALIDATOR 1utia --from $MULTISIG --fees 1000utia --chain-id $CHAIN_ID --keyring-backend $KEYRING_BACKEND --generate-only > unsignedTx.json
celestia-appd tx sign unsignedTx.json --multisig $MULTISIG --from test1 --output-document test1sig.json --chain-id $CHAIN_ID
celestia-appd tx sign unsignedTx.json --multisig $MULTISIG --from test2 --output-document test2sig.json --chain-id $CHAIN_ID
# Uncomment the next lines to verify that the signatures were created
# cat test1sig.json | jq .
# cat test2sig.json | jq .

# BUG: this prints to stdout instead of writing to a file
celestia-appd tx multisign unsignedTx.json multisig test1sig.json test2sig.json --output-document=signedTx.json --chain-id $CHAIN_ID
celestia-appd tx multisign unsignedTx.json multisig test1sig.json test2sig.json --output-document=signedTx.json --chain-id $CHAIN_ID --generate-only

# Note: these may be helpful if you need to debug locally after running this script
# export VALIDATOR=$(celestia-appd keys show validator -a)
# export TEST1=$(celestia-appd keys show test1 -a)
# export TEST2=$(celestia-appd keys show test2 -a)
# export TEST3=$(celestia-appd keys show test3 -a)
# export MULTISIG=$(celestia-appd keys show multisig -a)

@rootulp
Copy link
Collaborator Author

rootulp commented Jan 8, 2024

@rootulp rootulp removed the investigation item tracks efforts related to an investigation. does not always require a PR to close. label Jan 8, 2024
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

Successfully merging a pull request may close this issue.

1 participant