cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.17k stars 3.57k forks source link

[Feature]: Bring back block inclusion flag for txs #18927

Closed faboweb closed 8 months ago

faboweb commented 8 months ago

Summary

Before you could -b block so the tx send via the CLI would wait for the tx to be included and then return the result. This got removed.

Problem Definition

Having shell scripts around the CLI got a lot more complex because of this removal.

Proposed Feature

Bring back the same feature as there was before.

tac0turtle commented 8 months ago

Hey, this was removed due to block being made for testing and having bled into production. Unfortunately, we wont be adding it back. We recommend using a js library like cosmjs to make your life easier or using a wallet

faboweb commented 8 months ago

Can you elaborate why it is an issue having this feature? Other teams (Osmosis) also complained. It feels like a very simple feature to have with high impact.

ValarDragon commented 8 months ago

Would really appreciate this being added back as well. This automates the most common setup flow, and works great under the happy path

julienrbrt commented 8 months ago

I believe Crypto.com added a command that would do pretty much the same thing.

alexanderbez commented 8 months ago

The command/usage is faulty because often times you'd get an RPC error since block inclusion can take much longer than the RPC timeouts. In testing environments, this can be easily controlled to an extent, but in practical environments, it's not really reliable.

julienrbrt commented 8 months ago

Found the command alternative from cdc: https://github.com/cosmos/cosmos-sdk/pull/17274

faboweb commented 8 months ago

The command/usage is faulty because often times you'd get an RPC error since block inclusion can take much longer than the RPC timeouts. In testing environments, this can be easily controlled to an extent, but in practical environments, it's not really reliable.

Can't you handle RPC timeout and block inclusion separately? So instead of waiting, keep polling?

faboweb commented 8 months ago

Found the command alternative from cdc: #17274

This looks cool. This only got added recently? Can't find the command in latest Osmosis.

alexanderbez commented 8 months ago

The command/usage is faulty because often times you'd get an RPC error since block inclusion can take much longer than the RPC timeouts. In testing environments, this can be easily controlled to an extent, but in practical environments, it's not really reliable.

Can't you handle RPC timeout and block inclusion separately? So instead of waiting, keep polling?

No because broadcasting txs happens via CometBFT's BroadcastTx RPC method -- this will inevitably timeout. The only thing you can do is Broadcast (sync or async) + Poll/Wait, which you can write a tool for. There's also a command @julienrbrt linked.

julienrbrt commented 8 months ago

Found the command alternative from cdc: #17274

This looks cool. This only got added recently? Can't find the command in latest Osmosis.

Should be available from v0.47.5. Maybe osmosis didn't add it to their app.