Skip to content

docs: event queue connection class design#71

Open
r4mmer wants to merge 5 commits intomasterfrom
docs/reliable-integration-on-wallet-lib
Open

docs: event queue connection class design#71
r4mmer wants to merge 5 commits intomasterfrom
docs/reliable-integration-on-wallet-lib

Conversation

@r4mmer
Copy link
Member

@r4mmer r4mmer commented Dec 12, 2023

@r4mmer r4mmer requested review from andreabadesso and removed request for glevco December 22, 2023 16:14
Copy link
Contributor

@andreabadesso andreabadesso left a comment

Choose a reason for hiding this comment

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

I think it would be great to be more explicit on how the specific events from the reliable integrations feed are going to be handled, like NEW_VERTEX_ACCEPTED and VERTEX_METADATA_CHANGED

Copy link
Contributor

Choose a reason for hiding this comment

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

The fullnode already sends it decoded, the documentation might not have been updated because this was a change I requested, here is an example input:

{
  "tx_id": "00000000000000a7880484eb5f059e7857973d7c4d131a9bd59389afe6b0dfc6",
  "index": 0,
  "spent_output": {
    "value": 800,
    "token_data": 0,
    "script": "dqkUtlo02wdlNsUJx3OADdSG/uaHGnWIrA==",
    "decoded": {
      "type": "P2PKH",
      "address": "HP9KRutTVPPf5h8jZ3BMwfhkJoZpD1c7if",
      "timelock": null
    }
  }
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch.


#### Events

- `new-tx` and `update-tx`
Copy link
Contributor

Choose a reason for hiding this comment

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

Semi-unrelated to line number, but remember to add a ping/pong mechanism

Copy link
Member Author

Choose a reason for hiding this comment

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

The document of the event queue and the implementation did not have ping/pong anywhere but from what I understand it comes with the websocket lib we use, so I'll add the ping/pong to the design

Copy link
Contributor

Choose a reason for hiding this comment

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

Autobahn answers the PING frame with a PONG and also disconnects when no messages are received in a window. It also doesn't send a PING, so the implementation must be done in the client

Copy link
Contributor

Choose a reason for hiding this comment

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

We also need to assert that the stream_id is the same from the last sync

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If the `voided_by` field is the same we can iterate on the outputs and calculate
If the `voided_by` field is empty we can iterate on the outputs and calculate

Copy link
Member Author

Choose a reason for hiding this comment

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

Used null instead of empty but to the same effect.

@r4mmer r4mmer requested a review from andreabadesso January 9, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants

Comments