[Part 1/2: Introduction] Functional tests for v2 P2P encryption #24748 #47
stratospher
started this conversation in
PR Reviews
Replies: 1 comment
-
SummaryOverview
1. What does this PR do at a high level? Why do we need this PR?BIP 324 was recently merged and nodes can now send encrypted P2P messages to each other if they run the latest client. This PR adds support for BIP 324 to the dummy implementation of peer in python so that the python code can also talk to bitcoind using the encrypted protocol. We need this to test BIP 324 code (things like whether we're communicating on encrypted/unencrypted protocol, backward compatible with unencrypted protocol etc..) and also to confirm that existing tests work fine and behave as expected. 2. Can you trace the functions through which an inbound connection is established in the test framework? hint: see how
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Session Details
p2p
test
python
Learning
This is the introductory session for a 2-part review club. The review club will focus on how the functional test framework works on current master and will not cover the changes in PR #24748. If this is your first exposure to the test framework, it is recommended to understand the basics discussed in this review club. It's a definite prerequisite to understanding PR #24748.
Summary
TestNode
.P2PInterface
class serves this purpose and mocks the behaviour of a peer. It can be easily customised.TestNode <--> TestNode
) usingconnect_nodes
which invokes theaddnode
RPC.P2PInterface
allows custom interaction. You can create inbound/outbound connections to theTestNode
from your mockable peer.TestNode
are made usingadd_p2p_connection()
TestNode <---------- P2PInterface
P2PInterface
is the initiator of the connectionTestNode
are made usingadd_outbound_p2p_connection()
TestNode ----------> P2PInterface
TestNode
is the initiator of the connectionQuestions
TestNode::add_p2p_connection
makes a call topeer_connect
TestNode::add_outbound_p2p_connection
makes a call topeer_accept_connection
data_received()
andsend_message()
Extra reading
Beta Was this translation helpful? Give feedback.
All reactions