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
New TMSP request type BroadcastTx? #208
Comments
not sure I understand. what's the use case? when a transaction is received via HTTP (the standard way for users to communicate with daemons these days), it is run through the CheckTx msg of TMSP. if its valid, and will be added to the mempool and gossipped to peers, becoming eligible to be included in a block. if its included in a block, it will be executed via AppendTx. What would ProposeTx do? |
Use case is that one of the TMSP apps (running independently on the tendermint nodes) wishes to _initiate _ a transaction. In that case, it would be nice not having to introduce a HTTP client dependency in the TMSP application, as well as it feels more natural to just use the protocol already in use. So ProposeTx (in lack of a better word) would act similarly as the HTTP RPC method.. Just via TMSP instead. |
Ah yes, I've dwelt on this before. the current design is such that all messages are initiated from the tendermint side, which is why we have no support for something like this yet. but you're right, perhaps a third connection, which allows the app to send transactions to the core without going through HTTP is a good idea. Thanks! Are you on our slack? |
Yes, I think maybe a 3rd connection (which could be optional, i.e. a listener in the tendermint node?) would be cleaner.. So that the request/response pattern also makes sense.. TMSP app as a client send request ("ProposeTx") and receives a response. Currently testing tendermint/tmsp against a C++ app (using boost/asio/protobuf), seems very promising.. Nice work :-) I am not on slack.. Let me know how to jump onboard. |
Awesome! Either give me your email or email me at ethan@tendermint.com and I'll invite you. |
Transactions for the same or different blockchains? Can you provide a more detailed use case? |
I'll summarize that we discussed earlier and the benefits I see.
More specifically, I suggest to add a TMSP listener to the tendermint core, that will accept a connection from the TMSP application and accept BroadcastTx requests. I do not suggest to implement the full HTTP RPC feature set for TMSP, but restrict it merely to broadcasting transaction. To me it seems the HTTP RPCs that are related to management/monitoring should stay HTTP. |
Ideally, this could be solved by providing a GRPC interface for BroadcastTx alongside #212 |
Another use case for this is for when one wants to use a Tendermint node in a 'slave' or 'harnessed' mode to some master gateway, which handles external requests. For us the ideal situation is that we would talk exclusively to Tendermint over a private socket connection (using TMSP). Not only to receive Tendermint API callbacks on, but also to push transactions through as an alternative to the HTTP RPC, which we would like to disable in this case. The reason being, as well as some minor efficiency issues is that we don't want our Tendermint node to accept any requests originating from other entities that happen to be on the same network. We can simply permission a Unix socket to do this. There are other workarounds we could use, but it would be cleaner to support a private 1-to-1 bidirectional connection for our use case. |
I'm confused by this because thought only requests from the known validators and participants are accepted? |
Only known validators can propose blocks, but if we're talking about tendermint alone, I think anyone can push transactions, from the wiki:
Also I think any checking that does occur is done by checking signatures, which is a different layer to connection level authentication (I think we want both) |
you can run the tendermint rpc over a private unix socket! is that not sufficient? pushing txs over tmsp in the other direction is non-trivial and somewhat counter intuitive. what if you need other information from tendermint core? maybe you want to know about the network, or the current state of consensus, or otherwise. do you expect to get all that information via tmsp as well? this is what the rpc is good for, and you can run it on a private unix socket no problem, or just bind to localhost so only other things on that machine can access. or use docker networking. many options here. |
I can run the RPC over a private unix socket... how would I configure this? |
in the tendermint config file you can specify the rpc_laddr. just set it to the socket file you want to use. then connect over that from erisdb. |
To me the best important part of the proposal is not so much to run everything over a single connection or in one "direction" (connection wise) or even the security implications of doing so. My primary reasoning for the proposal is that that it feels very unnatural to have a separate communication channel (well, protocol actually) for something that is required to do anything meaningful - propose a new transaction. It should be possible using the same mechanism as check/appendtx, so either TMSP or the gRPC. Actuallly implementing gRPC interface now and I think I will put on "Boy George - The Crying Game" once time comes to pull in a 3rd party HTTP/WebSocket library in C++ just to broadcast TXs. |
btw, why isn't just binding to localhost sufficient? |
lol martin. would you instead put on "Pharel - Happy" if we move the rpc lib to use grpc as well?! that's something we can defntly do, once there's time ... |
Yeah, it seems a hassle (for me and you guys) to provide X number of different ways of talking to tendermint core. So moving the RPC stuff to gRPC would be great - it seems to do a fairly good job at it. |
Lmao |
Ethan was kind enough to implement this in grpc branch. See #221 for a few additional changes to build successfully (+ fix bug in gRPC/Protobuf somewhere). To build uses the steps from README.md (git clone + glide install), not the "go get" approach. |
You can't go get this? |
I don't believe so. Doing a git clone + glide install will ensure that the latest gRPC + Protobuf dependencies are pulled in.. See the PR. I haven't tested the go get method, but it appears to be obsoleted judging from README.md. I have opened https://github.com/tendermint/tendermint.github.io/issues/4 to update the tutorials. |
Seems the main need here has been addressed with broadcast_tx via grpc. Closing this for now. |
* Upgrade to Go 1.19 on v0.37.x Signed-off-by: Thane Thomson <connect@thanethomson.com> * Run proto-gen with the right go version * Updating the net dependency * Force a specific go version for vul-check. Should be reverted to not specifying the patch number. * Use the latest patch release of 1.19 * Revert "Use the latest patch release of 1.19" This reverts commit 95b96e85284e8c2bc040e605a73aca2abaae6d01. Revert "Force a specific go version for vul-check. Should be reverted to not specifying the patch number." This reverts commit 6ea165fd9794f69996a29c369fac28169682304e. * Adding missing update to 1.19 * Forcing go-vulcheck to use 1.19.6, since it is not picking it by setting just 1.19. This hould be reverted later. --------- Signed-off-by: Thane Thomson <connect@thanethomson.com> Co-authored-by: lasarojc <lasaro@informal.systems>
It would be very useful to be able to propose transactions via TMSP, as it seems a bit unnatural having to resort to HTTP to accomplish this.
Maybe a separate connection could be established for this in addition to mempool/consensus?
The text was updated successfully, but these errors were encountered: