Skip to content

Conversation

@promag
Copy link
Contributor

@promag promag commented Apr 27, 2015

This pull request adds support for transactions hitting the memory pool notifications. It is similar to -blocknotify and -walletnotify.

Useful when bitcoind is configured without wallet support and one wants to be notified as soon as the transaction arrives.

@sipa
Copy link
Member

sipa commented Apr 27, 2015 via email

@promag
Copy link
Contributor Author

promag commented Apr 27, 2015

I think RPC pooling is not the way to go. Having an incremental notification is definitely the best option.

I also think having a script-execution mechanism is not that good, but it is the existing solution, therefore I just followed the same implementation.

As discussed in #1974, I would also prefer a named pipe. This way it should be easier to integrate with different MQs other than zeromq.

@jgarzik
Copy link
Contributor

jgarzik commented Apr 27, 2015

Yes, we really just need to add a notification socket for local listeners that need high volume data like this. It also solves related problems such as notification storms during tx storms etc.

@sipa
Copy link
Member

sipa commented Apr 27, 2015 via email

@promag
Copy link
Contributor Author

promag commented Apr 27, 2015

In the case of staying with script-execution, bitcoind could just fork once when starting and then write to stdin of each script (instead of script arguments).

@jgarzik
Copy link
Contributor

jgarzik commented Apr 27, 2015

Sure; piping a high volume stream of events to a single program is reasonable as well. The point is to avoid initiating fresh executions of a script upon each new event.

This is the same problem as CGI per-hit execution in the mid-1990s. There is a large menu of solutions from which to choose.

@promag
Copy link
Contributor Author

promag commented Apr 27, 2015

Piping sounds the best for me as a low term, cheap solution. It has no external dependency, can handle script crash (a plugin like system can't) and allows great integration in 3rd infrastructures.

@jgarzik
Copy link
Contributor

jgarzik commented Apr 28, 2015

Sockets are the easiest, least complex solution. Getting pipes to work correctly on all platforms is not easy.

@promag
Copy link
Contributor Author

promag commented Apr 28, 2015

In the case of using sockets, should bitcoind listen/accept connections or connect to a given host:port?

@jgarzik
Copy link
Contributor

jgarzik commented Apr 28, 2015

@promag The standard pattern is a listen socket for bitcoind. Processes attach to a localhost port and receive events. If that process dies, the socket automatically closes. The admin is responsible for installing whatever watchdog processes.

@jonasschnelli
Copy link
Contributor

I think ZMQ could be the long term perspective of these *notify features (especially for rapid I/O stuff like mempool).

ZMQ supports asynchronous I/O over sockets. It runs on POSIX bases OSs and windows.
The wallet (process) separation could also be done over ZMQ.
IMO it would make more sense to continue at #5303 instead of adding -mempoolnotify.

@jgarzik
Copy link
Contributor

jgarzik commented Apr 28, 2015

@jonasschnelli Agreed and #5303 does that.

However, sockets do not require a library so sometimes that is chosen.

@laanwj laanwj added the Feature label Apr 29, 2015
@jgarzik
Copy link
Contributor

jgarzik commented May 2, 2015

Closing. Consensus is to NAK as-is, as execution storms etc. are possible.

However, it is OK to provide this event signal via some other means, such as zmq or socket.

@jgarzik jgarzik closed this May 2, 2015
@promag
Copy link
Contributor Author

promag commented May 4, 2015

Noticed another PR similar to this one #5328

@promag promag mentioned this pull request May 4, 2015
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants