Replies: 2 comments 7 replies
-
Thoughts? @kantai @zone117x @rafaelcr @lgalabru @wileyj @diwakergupta @agraebe |
Beta Was this translation helpful? Give feedback.
-
@CharlieC3 Could there be a scenario in which a lot of overhead (and unnecessary) traffic is created by either the API multicast or the mempool pusher script? If a node that receives a tx can then rebroadcast that same transaction to other nodes, how can we control that we really need to rebroadcast that tx? So for example if the last node received a tx from an API multicast, it would then rebroadcast that same tx to the rest of the nodes which have already received that tx. |
Beta Was this translation helpful? Give feedback.
-
Context
When a transaction (tx) is submitted to a stacks-node, it can take some time before the tx propagates to a neighboring node which broadcasts the event to a public stacks-blockchain-api (API). Depending on the topography of the blockchain, this event can make its way to an API in anywhere from a couple seconds to over an hour in the worst cases. This can cause mempool tx's to not appear in any service or client which ingests mempool data from an API.
There's currently a couple different solutions available to the public that Hiro utilizes to help reduce the number of missing or delayed mempool tx's that appear in the stacks-blockchain-api's (API) database.
Problem
The above solutions would help a single entity propagate mempool tx's within their own infrastructure, but if one entity hosts an API instance and receives a tx, other entities running their own API may not receive the mempool tx in a timely manner and would be susceptible to the issue described in the context above.
As decentralization continues to expand, this problem where an entity may be missing mempool tx's from other entities will likely get worse.
Possible Solution
One idea I've had to mitigate this problem was for an entity to broadcast tx's received to other known entities that opt-in to receiving tx's from external sources. For example, if an exchange or partner submitted a tx to an API they host, it would then broadcast the same tx to a list of public endpoints that Hiro and others entities own. Entities receiving the broadcast would then be able to distribute the tx as needed to their internal infrastructure.
The list of entities to receive this broadcast would be a publicly-curated list, perhaps in Github, and would be opt-in. So entities will not receive the broadcast unless they add themselves to the list. The list could be a json or yaml file which simply lists entity names and a public endpoint they own.
This feature could likely be done by the API with some code changes to the current multicast logic. It could also likely be modified to accept tx's as well which would then be forwarded to backend stacks-nodes internally.
It's possible this is something that can be solved with another solution, or perhaps with changes to the stacks-node, but I'm not sure of their feasibility or what those would look like.
Beta Was this translation helpful? Give feedback.
All reactions