Bitshala / BitcoinCore-PR-Review-Club

Bitcoin Core PR Review Organising repo
10 stars 2 forks source link

Review : p2p: Fill reconciliation sets (Erlay) #60

Open Prabhat1308 opened 1 month ago

Prabhat1308 commented 1 month ago

Session Details

Date : 23-05-2024 Time: IST 20:00 (UTC 14:30) Link : p2p: Fill reconciliation sets (Erlay) BIP : 330 Difficulty : High

Notes

This PR introduces tracking of per-peer reconciliation sets containing transactions to be exchanged efficiently using minisketch. Currently all the transaction are flooded to each peer via flooding algorithm .

Questions

  1. What is the objective of the PR ?
  2. What are benchmark functions ?
  3. Can you decipher how is the combined salt being formed ? Any reason that you can think of ?
  4. We form a local salt when Pre-registering a peer . Why pre-register in the first place ? Any pros you can think of ?
  5. Why testing with Boost library and not use python tests ?

Learnings

sketches erlay multi-threaded architecture

Pre-Requisites

PR review club - BIP330

YeamlaksiraKebede commented 1 month ago

Answers for the questions

  1. I feel like this PR tries to answer some potential points of misunderstanding, like, latency increase, bandwidth savings, security implications and compatibility with existing protocols. 2) Benchmark functions are routines used to measure and evaluate the performance of software, algorithms, or systems. They provide insights into how well a piece of code performs under various conditions, which can be crucial for optimization and ensuring that performance requirements are met. In the context of Bitcoin and the Erlay BIP, benchmark functions might be used to: Transaction Propagation, Comparison of Protocols, Scalability, Resource Efficiency. 3) In the Erlay Bitcoin Improvement Proposal (BIP), the term "combined salt" likely refers to the process of creating a single value from two separate salts contributed by different parties. Let's break down how this combined salt is formed and consider the reasons behind this approach: A. Contributed Salts:
    • Each party involved in the transaction relay process contributes a salt, denoted as "salt1" and "salt2".
    • These salts serve as sources of entropy, adding randomness to the computation process.

B. Sorting Salts:

C. Hash Computation:

D. Reasons for Combined Salt:

4) In the context of the Erlay Bitcoin Improvement Proposal (BIP), pre-registering a peer involves forming a local salt in anticipation of future interactions with that peer. Let's explore the reasons why pre-registering peers might be beneficial and some potential advantages: A. Efficient Communication:

B. Optimized Resource Usage:

C. Enhanced Security:

D. Reduced Latency:

E. Customized Interaction:

Summary: Pre-registering peers in the Erlay BIP allows nodes to anticipate future interactions, streamline communication, optimize resource usage, enhance security, reduce latency, and customize interaction strategies. These benefits contribute to improved efficiency, performance, and reliability in the Bitcoin network.

5) Testing with the Boost library rather than using Python tests may offer certain advantages in specific contexts, particularly when developing software in C++ like the Erlay Bitcoin Improvement Proposal (BIP). Here are some reasons why testing with Boost might be preferred:

A. Native Integration:

B. Performance:

C. Language Compatibility:

D. Robustness and Reliability:

E. Community Support:

While using Python tests may also be a viable option, particularly for higher-level or integration testing, testing with Boost offers specific advantages for testing C++ code, such as performance, language compatibility, and native integration. Ultimately, the choice of testing framework depends on the specific requirements and constraints of the project, as well as the preferences of the development team.