Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

amqp_trx_plugin - transaction in, transaction_trace out #9181

Merged
merged 67 commits into from
Jun 22, 2020

Conversation

heifner
Copy link
Contributor

@heifner heifner commented Jun 4, 2020

Change Description

New plugins: amqp_trx_plugin & amqp_trace_plugin

  • amqp_trx_plugin
    • Consumes from AMQP 'trx' queue for speculative execution
    • If amqp_trace_plugin enabled then errors are reported via the amqp_trace_plugin. Errors include: too many trx in progress and signature issues.

Binary fc::pack format:

// consume message types
using transaction_msg = fc::static_variant<chain::packed_transaction_v0, chain::packed_transaction>;
  • amqp_trace_plugin
    • Publishes transaction trace results to 'trace' queue with CorrelationID set to transaction id.

Binary fc::pack format:

// publish message types
struct transaction_trace_exception {
   int64_t error_code; ///< fc::exception code()
   std::string error_message;
};
using transaction_trace_msg = fc::static_variant<transaction_trace_exception, chain::transaction_trace>;

Change Type

Select ONE

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

eosio::amqp_trx_plugin options

  • amqp-trx-address
    • AMQP address: Format: amqp://USER:PASSWORD@ADDRESS:PORT
      Will consume from 'trx' queue

eosio::amqp_trace_plugin options

  • amqp-trace-address
    • AMQP address: Format: amqp://USER:PASSWORD@ADDRESS:PORT
      Will publish to 'trace' queue.
  • amqp-trace-exchange
    • Existing AMQP exchange to send transaction trace messages.

heifner and others added 24 commits May 18, 2020 11:47
@spoonincode
Copy link
Contributor

I wonder if the more AMQPy way of doing this would be instead of the amqp-trx-exchange config, leveraging the reply-to field of a message. If you have multiple callers this allows you to send the responses back to the individual caller. I'm guessing it's not a huge problem for us in this case though since a submitter likely knows if a response was intended for itself or someone else because it's expecting a particular trxid.

@swatanabe-b1
Copy link
Contributor

If we use reply-to then we'd still need somewhere to publish transaction traces when amqp-trx-publish-all-traces is on.

plugins/amqp_trx_plugin/amqp_trx_plugin.cpp Outdated Show resolved Hide resolved
plugins/amqp_trx_plugin/amqp_trx_plugin.cpp Outdated Show resolved Hide resolved
programs/cleos/main.cpp Outdated Show resolved Hide resolved
.cicd/build.sh Outdated Show resolved Hide resolved
programs/cleos/main.cpp Outdated Show resolved Hide resolved
@heifner heifner requested a review from swatanabe-b1 June 17, 2020 20:06
heifner added 3 commits June 18, 2020 12:55
…posted tasks so the http request to verify the amqp_trx_plugin trx can run before the amqp_trx_plugin trx. Add waitForTransBlock for calls via amqp.
@heifner heifner requested a review from swatanabe-b1 June 19, 2020 13:40
Copy link
Contributor

@swatanabe-b1 swatanabe-b1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBC

@heifner heifner requested a review from swatanabe-b1 June 22, 2020 13:09
stop_promise.get_future().wait();

thread_pool_.stop();
handler_.reset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is scary, because it leaves the TcpConnection holding a dangling pointer, but it's safe (for now) because the first thing that ~TcpConnection does is to clear its handler.

@heifner heifner merged commit 80e249c into develop-boxed Jun 22, 2020
@heifner heifner deleted the rabbitmq-trx-dev branch June 22, 2020 16:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants