tapyrus-core icon indicating copy to clipboard operation
tapyrus-core copied to clipboard

Add submitpackage RPC

Open azuchi opened this issue 1 year ago • 1 comments

After #284, similar to Bitcoin, multiple parent-child transactions can be accepted and enter local mempools. However, the atomicity of accepting all or none of the specified transactions must be guaranteed.

azuchi avatar Oct 12 '23 05:10 azuchi

For preventing mempool eviction of package transactions while the rest of the package is still being processed, we can the same behaviour as bitcoin. i.e allow the mempool to temporarily bypass mempool size limits(upto the maximum package size). When the package evaluation is completed the mempool is trimmed to size.

With regards to orphan transaction handling there are gaps in our code: Tx orphan is only in the p2p layer. Each orphan is tied to the node which sent it. Only when its parent is received on the p2p layer the orphan is reprocessed. RPC sendrawtransaction does not result in the same behaviour. It submits the transaction to mempool, but there is no orphan processing. submitpackage RPC added in this PR also results in the same behaviour, no orphan processing.

In bitcoin :

  • it has been refactored to use TxOrphanage. This is decoupled from p2p layer.
  • sendrawtransaction does not just submit the transaction to mempool. It also results in the transaction being broadcast to all peers which triggers the orphan transaction processing.
  • There is also a list in the mempool which tracks transaction submitted to it without relay. The scheduler periodically relays these transactions.

We need to decide what behaviour we can port.

Naviabheeman avatar Jul 18 '24 06:07 Naviabheeman