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

amqp_witness_plugin: sign blocks as non-producer and publish over AMQP #9122

Merged
merged 4 commits into from
May 27, 2020

Conversation

spoonincode
Copy link
Contributor

Change Description

A witness is, conceptually, a node that signs a block attesting that the entire contents of the block are valid. A producer is a witness. This plugin extends the concept to a non-producing node. When the plugin is activated irreversible blocks are signed and those signatures are published to an AMQP exchange.

An AMQP server and existing exchange must be specified. The plugin is able to use any existing signature provider: a soft key specified in the config, keosd, or a Secure Enclave key. Blocks older than a specified age will not be signed -- useful for sync or replay.

Either the block’s signature digest or simply its action merkle root is reported in the message and what is signed. I believe this is appropriate to identify the block for both applications considered. A stateful application, like a light validator, will know the block signature digest it is seeking witness signatures for. A stateless application, like an application that is only inspecting action receipts, only wishes to know that the action receipt merkle proof for a block satisfies a merkle root that a witness has signed.

This plugin communicates to the AMQP server via the reliable_amqp_publisher for increased publishing reliability.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Yes big time; a new plugin and the start of more AMQP support throughout nodeos.


std::unique_ptr<reliable_amqp_publisher> rqueue;

struct amqp_witness_msg {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I really didn't want to do it because the message is so simple.... but it's probably best practice to version any struct sent

Copy link
Contributor

Choose a reason for hiding this comment

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

You could always encode future extensions in the first byte, replacing is_sig_digest.

@bytemaster bytemaster merged commit 6411547 into reliable_amqp_publisher May 27, 2020
@brianjohnson5972 brianjohnson5972 deleted the amqp_witness_plugin branch November 21, 2020 15:09
@samstickkz
Copy link

What does it exactly do ?

@spoonincode
Copy link
Contributor Author

Simply put, allows a fully validating node to sign the action merkle root of a block it fully validated and then publish that signature over AMQP for other components to consume and act upon. See #9379 for a version that places the signatures on chain instead.

This is a small building block in a larger system.

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.

5 participants