Skip to content

[Draft] RUES Node Events

Mr. Seppia edited this page Jul 19, 2024 · 3 revisions

This document outlines the events generated by a Rusk Node, which are not initiated by contract, in accordance with the RUES specifications.

These events are categorized based on the component of the target.

Blocks

Target's element: block hash in hex format (see Content-Location on the events below)

on/blocks/accepted

Emitted when a block is accepted.

List of headers

Name Description
Content-Location e.g. /on/blocks:488a0419e03013a48823f017be790d01d39557478670c9a173099a06da3d739e/accepted
Content-Type application/json
Content-Length The length of the payload in octets (8-bit bytes).

Payload example

{
  "header": {
    "gasLimit": 5000000000,
    "hash": "488a0419e03013a48823f017be790d01d39557478670c9a173099a06da3d739e",
    "height": 1963,
    "iteration": 0,
    "prevBlockHash": "619e835b9bded6fc4ed39fd5dd9cedf9a61b3e9c54ee1b15b8067766b3215e52",
    "seed": "afa035b209e5f12080f671dcad2cee56679e6d8689e91776abb4487dc4e72cc1b21c0c044869a7ab87a60ed050e9fb6c",
    "stateHash": "ccdc3b146fd05ddb872fe3531253bc9f327ee55063e812c7c09b5166be6978d7",
    "eventHash": "7d8796eb6615b90c7c218e36055ee723f9cb3521353ef278bdd50df641b3cdcc",
    "timestamp": 1720792561,
    "txRoot": "0000000000000000000000000000000000000000000000000000000000000000",
    "version": 0
    "label": "final"
  },
  "transactions": [
    "fe2ffdcdd27be82fc850bc269ff87fb8e72cf0cd4368e49fe947afeb48167f08"
  ]
}

on/blocks/statechange

Emitted when a block's state change (e.g. become confirmed, finalized, or reverted).

List of headers

Name Description
Content-Location e.g. /on/blocks:488a0419e03013a48823f017be790d01d39557478670c9a173099a06da3d739e/statechange
Content-Type application/json
Content-Length The length of the payload in octets (8-bit bytes).

Payload example

{
  "state": "confirmed",
  "atHeight": 100
}

Transactions

Target's element: transaction hash in hex format (see Content-Location on the events below)

on/transactions/included

Emitted when a transaction is included in mempool.

List of headers

Name Description
Content-Location e.g. /on/transactions:fe2ffdcdd27be82fc850bc269ff87fb8e72cf0cd4368e49fe947afeb48167f08/included
Content-Type application/json
Content-Length The length of the payload in octets (8-bit bytes).

Payload example

{
    "skeleton": {
        "root": "5652abab22a71939a2d0a485411a5be1abc4e39e6d6494031774ffd4c35d8d5d",
        "nullifiers": [
            "c735c883379886aec04e2a769c72e57c89dc42a93dbd2b312e353784ab973456"
        ],
        "max_fee": 1000000000,
        "deposit": 30000,
        "outputs": [
            {
                "encrypted_data": [
                    "c934c6feb4eced632dbd3e9f97d529e530a84491a1b2b6d619b371c0dab46a52",
                    "a5ffce0dbf8fdbd7c06dcc446a2cd3c4806c596b2731cbdd74d4cbaaeaacc56a",
                    "14372a88ac77f9cae521438f0baf1711f010d26a03e0b9b8797b7e1db6667d3a"
                ],
                "nonce": "dfa1a6083501ac99de9ae784e8734541c417ceb396516a96e0ab38d23cd8b838",
                "note_type": 1,
                "stealth_address": "RF2rhjf8Viv1Cn7rmhvdkYQJb9byMsuF1uuoa2rfTHfnUUPj9xxVdcg9ryLsDBNrP27U2SHk7wwT2qU1xqYcuqN",
                "value_commitment": [
                    "c0b9fa836966b9ee6b6600b1067383a491bbe0742a9c2029bff2a8b89dd3703a",
                    "94a38fa38123ed9e639f7efcdba92e9699edfb8fdc068f16a257a76ad452a605"
                ],
                "sender": {
                    "encrypted": [
                        [
                            "0dc13357d8821a5ce9893586aedadfff8b6338495ed9c2029602be507c0c4411",
                            "c2830b9c9f3580b44a6c085dd13ed2b096e9b3685efe17ec57e780df904d6334"
                        ],
                        [
                            "0dc13357d8821a5ce9893586aedadfff8b6338495ed9c2029602be507c0c4411",
                            "c2830b9c9f3580b44a6c085dd13ed2b096e9b3685efe17ec57e780df904d6334"
                        ]
                    ]
                }
            },
            {
                "encrypted_data": [
                    "c934c6feb4eced632dbd3e9f97d529e530a84491a1b2b6d619b371c0dab46a52",
                    "a5ffce0dbf8fdbd7c06dcc446a2cd3c4806c596b2731cbdd74d4cbaaeaacc56a",
                    "14372a88ac77f9cae521438f0baf1711f010d26a03e0b9b8797b7e1db6667d3a"
                ],
                "nonce": "dfa1a6083501ac99de9ae784e8734541c417ceb396516a96e0ab38d23cd8b838",
                "note_type": 1,
                "stealth_address": "RF2rhjf8Viv1Cn7rmhvdkYQJb9byMsuF1uuoa2rfTHfnUUPj9xxVdcg9ryLsDBNrP27U2SHk7wwT2qU1xqYcuqN",
                "value_commitment": [
                    "c0b9fa836966b9ee6b6600b1067383a491bbe0742a9c2029bff2a8b89dd3703a",
                    "94a38fa38123ed9e639f7efcdba92e9699edfb8fdc068f16a257a76ad452a605"
                ],
                "sender": {
                    "contract": "3MUw6nf27LcoFhR5spL1Fr7KPQMYLBiwHd9fykeqCMw9SLXyofBM7GNNpuFGPPdz5zugS93SE3RtS2PT6JFrKH47"
                }
            }
        ]
    },
    "call": {
        "contract_id": "02000000000000000000000",
        "fn_name": "stake",
        "fn_args": "...omissis byte array..."
    },
    "fee": {
        "gas_limit": 500000000,
        "gas_price": 2,
        "stealth_address": "33YyPMbYEJmPtrdzJqPKyMHh7S84qqZeLQiWe3njrW9cAFvtXWQfpXC5nVY1WyMLnpwgZnWCWeJmHmFrDZNwBFoi"
    },
    "proof": "...omissis byte array..."
}

on/transactions/removed

Emitted when a transaction is removed from mempool.

List of headers

Name Description
Content-Location e.g. /on/transactions:fe2ffdcdd27be82fc850bc269ff87fb8e72cf0cd4368e49fe947afeb48167f08/removed
Content-Type application/json
Content-Length The length of the payload in octets (8-bit bytes).

Payload example

N/A

on/transactions/executed

Emitted when a transaction is executed (included in a block)

List of headers

Name Description
Content-Location e.g. /on/transactions:fe2ffdcdd27be82fc850bc269ff87fb8e72cf0cd4368e49fe947afeb48167f08/executed
Content-Type application/json
Content-Length The length of the payload in octets (8-bit bytes).

Payload example

{
    "err": "optional_error",
    "gasSpent": 300000,
    "blockHash": "5652abab22a71939a2d0a485411a5be1abc4e39e6d6494031774ffd4c35d8d5d",
    "blockHeight": 10000,
    "blockTimestamp": 1231234414,
    "tx": {
        "skeleton": {
            "root": "5652abab22a71939a2d0a485411a5be1abc4e39e6d6494031774ffd4c35d8d5d",
            "nullifiers": [
                "c735c883379886aec04e2a769c72e57c89dc42a93dbd2b312e353784ab973456"
            ],
            "max_fee": 1000000000,
            "deposit": 30000,
            "outputs": [
                {
                    "encrypted_data": [
                        "c934c6feb4eced632dbd3e9f97d529e530a84491a1b2b6d619b371c0dab46a52",
                        "a5ffce0dbf8fdbd7c06dcc446a2cd3c4806c596b2731cbdd74d4cbaaeaacc56a",
                        "14372a88ac77f9cae521438f0baf1711f010d26a03e0b9b8797b7e1db6667d3a"
                    ],
                    "nonce": "dfa1a6083501ac99de9ae784e8734541c417ceb396516a96e0ab38d23cd8b838",
                    "note_type": 1,
                    "stealth_address": "RF2rhjf8Viv1Cn7rmhvdkYQJb9byMsuF1uuoa2rfTHfnUUPj9xxVdcg9ryLsDBNrP27U2SHk7wwT2qU1xqYcuqN",
                    "value_commitment": [
                        "c0b9fa836966b9ee6b6600b1067383a491bbe0742a9c2029bff2a8b89dd3703a",
                        "94a38fa38123ed9e639f7efcdba92e9699edfb8fdc068f16a257a76ad452a605"
                    ],
                    "sender": {
                        "encrypted": [
                            [
                                "0dc13357d8821a5ce9893586aedadfff8b6338495ed9c2029602be507c0c4411",
                                "c2830b9c9f3580b44a6c085dd13ed2b096e9b3685efe17ec57e780df904d6334"
                            ],
                            [
                                "0dc13357d8821a5ce9893586aedadfff8b6338495ed9c2029602be507c0c4411",
                                "c2830b9c9f3580b44a6c085dd13ed2b096e9b3685efe17ec57e780df904d6334"
                            ]
                        ]
                    }
                },
                {
                    "encrypted_data": [
                        "c934c6feb4eced632dbd3e9f97d529e530a84491a1b2b6d619b371c0dab46a52",
                        "a5ffce0dbf8fdbd7c06dcc446a2cd3c4806c596b2731cbdd74d4cbaaeaacc56a",
                        "14372a88ac77f9cae521438f0baf1711f010d26a03e0b9b8797b7e1db6667d3a"
                    ],
                    "nonce": "dfa1a6083501ac99de9ae784e8734541c417ceb396516a96e0ab38d23cd8b838",
                    "note_type": 1,
                    "stealth_address": "RF2rhjf8Viv1Cn7rmhvdkYQJb9byMsuF1uuoa2rfTHfnUUPj9xxVdcg9ryLsDBNrP27U2SHk7wwT2qU1xqYcuqN",
                    "value_commitment": [
                        "c0b9fa836966b9ee6b6600b1067383a491bbe0742a9c2029bff2a8b89dd3703a",
                        "94a38fa38123ed9e639f7efcdba92e9699edfb8fdc068f16a257a76ad452a605"
                    ],
                    "sender": {
                        "contract": "3MUw6nf27LcoFhR5spL1Fr7KPQMYLBiwHd9fykeqCMw9SLXyofBM7GNNpuFGPPdz5zugS93SE3RtS2PT6JFrKH47"
                    }
                }
            ]
        },
        "call": {
            "contract_id": "02000000000000000000000",
            "fn_name": "stake",
            "fn_args": "...omissis byte array..."
        },
        "fee": {
            "gas_limit": 500000000,
            "gas_price": 2,
            "stealth_address": "33YyPMbYEJmPtrdzJqPKyMHh7S84qqZeLQiWe3njrW9cAFvtXWQfpXC5nVY1WyMLnpwgZnWCWeJmHmFrDZNwBFoi"
        },
        "proof": "...omissis byte array..."
    }
}