Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: trigger mempool sync on lag #4730

Merged
merged 3 commits into from
Sep 27, 2022

Conversation

SWvheerden
Copy link
Collaborator

@SWvheerden SWvheerden commented Sep 23, 2022

Description

Adds in the ability to retrigger the mempool sync if a larger re_org or block sync occurred.

Motivation and Context

As of #4706 the mempool will now properly handle re-orgs and block syncs.
But when the base_node is not at the "correct" tip its mempool will reject all invalid transactions. In order to get those transactions back, we need to trigger a mempool sync.
This adds in a new config setting to control the maximum number of blocks the base_node added during a reorg or sync before it starts a sync process.
The assumption is that in most cases, the blocks removed will be less or the same as the blocks added, so we only need to look at the blocks added.

Open Questions

Do we just sync to one peer, or do we sync to initial_sync_num_peers peer?

Prerequisite

Requires: #4706

sdbondi
sdbondi previously approved these changes Sep 23, 2022
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

utAck - minor nits

base_layer/core/src/mempool/sync_protocol/mod.rs Outdated Show resolved Hide resolved
base_layer/core/src/mempool/sync_protocol/mod.rs Outdated Show resolved Hide resolved
base_layer/core/src/mempool/sync_protocol/initializer.rs Outdated Show resolved Hide resolved
base_layer/core/src/mempool/sync_protocol/initializer.rs Outdated Show resolved Hide resolved
stringhandler
stringhandler previously approved these changes Sep 26, 2022
Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

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

utACK

@stringhandler stringhandler merged commit 1e22a03 into tari-project:development Sep 27, 2022
sdbondi added a commit to sdbondi/tari that referenced this pull request Sep 29, 2022
…re-dan

* network-dependent-grpc-ports:
  feat: different default grpc ports for different networks
  fix(clients): fix tari nodejs client proto paths (tari-project#4743)
  chore: disallow onion v2 (tari-project#4745)
  feat: change priority in mempool to take into account age (tari-project#4737)
  feat: trigger mempool sync on lag (tari-project#4730)
  fix(core): use compact inputs for block propagation (tari-project#4714)
  ci: deny dbg macro (tari-project#4740)
sdbondi added a commit to sdbondi/tari that referenced this pull request Oct 3, 2022
* development:
  v0.38.5
  feat: different default grpc ports for different networks (tari-project#4755)
  fix(core): broken doctests (tari-project#4763)
  ci: fix coverage job
  ci: run coverage on prs (tari-project#4738)
  fix(comms): fixes edge case where online status event does not get published (tari-project#4756)
  fix(dht/encryption): greatly reduce heap allocations for encrypted messaging (tari-project#4753)
  docs: explain the emission curve parameters (tari-project#4750)
  fix(comms/peer_manager): add migration to remove onionv2 addresses (tari-project#4748)
  fix(ci): add cargo cache, reduce Ubuntu dependencies and action on pull_request (tari-project#4757)
  feat(tariscript): adds ToRistrettoPoint op-code (tari-project#4749)
  fix: cli wallet cucumber (tari-project#4739)
  fix(clients): fix tari nodejs client proto paths (tari-project#4743)
  chore: disallow onion v2 (tari-project#4745)
  feat: change priority in mempool to take into account age (tari-project#4737)
  feat: trigger mempool sync on lag (tari-project#4730)
  fix(core): use compact inputs for block propagation (tari-project#4714)
  ci: deny dbg macro (tari-project#4740)
@SWvheerden SWvheerden deleted the sw_mempool_sync branch October 5, 2022 05:36
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.

3 participants