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!: compact block propagation #3704

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Jan 13, 2022

Description

  • Changes the propagated new block message to contain <block_header, coinbase, excess_sigs>
  • Reconciles incoming new block with known mempool transactions by excess signature
  • Requests, if required, missing transactions from peer
  • Failing that, request the full block from the peer
  • Reduce (deallocate) mempool memory when transactions are removed
  • Replace real time-based reorg pool expiry with block height-based expiry
  • Clean up deprecated mempool messaging handlers etc
  • Ensure DHT connectivity keeps hold of connection handles

Motivation and Context

In the majority of cases, the inputs, outputs and kernels to be inserted in a block are already known and exist in the mempool. Previously, a propagated new block message would just contain the block hash, requiring the node request the full block from the peer. This implementation provides the minimum block data required to assemble a valid block and propagates that message (typically less than 100kb).

How Has This Been Tested?

Updated tests, existing block propagation tests
Manually: 3 base nodes, 1 wallet and 4 blocks worth of transactions in the mempool on dibbler

@sdbondi sdbondi force-pushed the core-compact-block-request branch 8 times, most recently from e9fbbd1 to 6956f09 Compare January 14, 2022 09:45
@sdbondi sdbondi force-pushed the core-compact-block-request branch from 6956f09 to e6bb606 Compare January 14, 2022 10:36
Copy link
Contributor

@delta1 delta1 left a comment

Choose a reason for hiding this comment

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

Awesome! 👏

Some very minor comments while I build and test

@sdbondi sdbondi force-pushed the core-compact-block-request branch from 3fd4967 to 931bd37 Compare January 14, 2022 11:10
@sdbondi sdbondi force-pushed the core-compact-block-request branch from 743d15d to 5f5fd45 Compare January 14, 2022 11:50
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.

So keen to try this out

@aviator-app aviator-app bot merged commit 274b7d9 into tari-project:development Jan 14, 2022
@sdbondi sdbondi deleted the core-compact-block-request branch January 14, 2022 17:30
@sdbondi sdbondi restored the core-compact-block-request branch February 3, 2022 05: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.

3 participants