Skip to content

mempool: waitSync channel to block broadcast routines - #1386

Merged
hvanz merged 1 commit into
hvanz/reject-incoming-txs-when-catching-up-785from
cason/reject-incoming-txs-when-catching-up-785
Sep 22, 2023
Merged

hvanz merged 1 commit into
hvanz/reject-incoming-txs-when-catching-up-785from
cason/reject-incoming-txs-when-catching-up-785

Conversation

@cason

@cason cason commented Sep 22, 2023

Copy link
Copy Markdown

Proposal to address synchronization issues of #1119:

  1. A broadcastTxRoutine is started for every peer added to the reactor, regardless the output of WaitSync()
  2. The broadcastTxRoutine starts by checking the output of WaitSync(). If it is true, it blocks on a new waitSyncCh channel until the node is allowed to broadcast transactions.
  3. The EnableInOutTxs() method does not start broadcastTxRoutine instances any longer, as they are started by AddPeer(). It instead unblocks every blocked routine by closing the waitSyncCh channel.

@cason
cason requested a review from a team as a code owner September 22, 2023 07:32
@cason
cason requested a review from a team September 22, 2023 07:32
@cason cason mentioned this pull request Sep 22, 2023
1 of 3 tasks
@cason
cason force-pushed the cason/reject-incoming-txs-when-catching-up-785 branch from f655c50 to fc1b63c Compare September 22, 2023 08:09
@hvanz
hvanz merged commit 9290694 into hvanz/reject-incoming-txs-when-catching-up-785 Sep 22, 2023
@hvanz
hvanz deleted the cason/reject-incoming-txs-when-catching-up-785 branch September 22, 2023 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants