conflux-rust icon indicating copy to clipboard operation
conflux-rust copied to clipboard

Skipping Catch-up Mode to Access TXPool for Current Block in Full node

Open waelsy123 opened this issue 1 year ago • 1 comments

Issue Description: I am currently setting up a Conflux full node and would like to access the transaction pool (TXPool) for the current last block immediately upon starting the node. However, the catch-up mode is automatically initiated, making it difficult to access the TXPool directly for the current block.

I understand that catch-up mode is essential for syncing the node with the blockchain, but for my some cases, we only need the TXPool information for the most recent block. Therefore, I would like to know if there is a way to skip or bypass the catch-up mode and gain direct access to the TXPool for the current block.

Additional Context: Conflux-rust version: v2.2.3

Expected Behavior: I expect the full node to allow me to access the TXPool for the current block (last) without having to wait for the catch-up mode to complete.

Actual Behavior: The node initiates catch-up mode and syncs with the entire blockchain, causing delays in accessing the TXPool for the current block.

Steps to Reproduce: Start the Conflux full node Observe that the catch-up mode begins Attempt to access the TXPool for the last block

Proposed Solution: If there is a way to skip or bypass the catch-up mode, please provide detailed instructions on how to achieve this. Alternatively, if a configuration option or command-line flag could be added to enable this functionality, it would be greatly appreciated. This would allow users like me to access the TXPool for the most recent block without waiting for the node to sync completely.

waelsy123 avatar Apr 16 '23 23:04 waelsy123

This cannot be achieved in the current version, and implementing it is also a bit tricky.

The main issue is that maintaining the transaction pool requires knowledge of the latest state (like account nonce and balance). If we simply start the transaction pool with an empty state before catching up, it is likely that all received transactions will be dropped directly.

peilun-conflux avatar May 09 '23 09:05 peilun-conflux