Page MenuHomePhabricator

D17659.id52663.diff
No OneTemporary

D17659.id52663.diff

diff --git a/contrib/teamcity/build-configurations.yml b/contrib/teamcity/build-configurations.yml
--- a/contrib/teamcity/build-configurations.yml
+++ b/contrib/teamcity/build-configurations.yml
@@ -1004,3 +1004,13 @@
dockerfile: cashtab.Dockerfile
build_args:
- "NGINX_CONF=nginx-preview.conf"
+
+ build-getavaaddr:
+ Werror: true
+ cmake_flags:
+ - '-DCMAKE_BUILD_TYPE=Debug'
+ targets:
+ - - all
+ timeout: 1200
+ post_build: |
+ for i in {1..20}; do ./test/functional/test_runner.py abc_p2p_getavaaddr || break; done
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -7339,6 +7339,8 @@
if (now < pfrom.m_nextGetAvaAddr) {
// Prevent a peer from exhausting our resources by spamming
// getavaaddr messages.
+ LogPrintf("REPEATED GETAVAADDR: %d < %d\n", now.count(),
+ pfrom.m_nextGetAvaAddr.count());
return;
}
@@ -7372,11 +7374,13 @@
m_connman.ForEachNode([&](const CNode *pnode) {
if (!pnode->m_avalanche_enabled ||
pnode->getAvailabilityScore() < 0.) {
+ LogPrintf("SKIPPING NODE WITH <= 0 SCORE\n");
return;
}
avaNodes.insert(pnode);
if (avaNodes.size() > m_opts.max_addr_to_send) {
+ LogPrintf("NOTHING LEFT TO SEND\n");
avaNodes.erase(std::prev(avaNodes.end()));
}
});
@@ -7385,6 +7389,8 @@
for (const CNode *pnode : avaNodes) {
PushAddress(*peer, pnode->addr);
}
+ LogPrintf("AFTER GETAVAADDR THERE ARE %d ADDR TO SEND\n",
+ peer->m_addrs_to_send.size());
return;
}
@@ -8151,6 +8157,7 @@
std::chrono::microseconds current_time) {
// Nothing to do for non-address-relay peers
if (!peer.m_addr_relay_enabled) {
+ LogPrintf("NO ADDRESS RELAY\n");
return;
}
@@ -8177,6 +8184,8 @@
// We sent an `addr` message to this peer recently. Nothing more to do.
if (current_time <= peer.m_next_addr_send) {
+ LogPrintf("NOT ENOUGH TIME PASSED: %d <= %d\n", current_time.count(),
+ peer.m_next_addr_send.count());
return;
}
@@ -8187,9 +8196,13 @@
if (!Assume(peer.m_addrs_to_send.size() <= max_addr_to_send)) {
// Should be impossible since we always check size before adding to
// m_addrs_to_send. Recover by trimming the vector.
+ LogPrintf("RESIZING TO %d ADDR TO SEND\n", max_addr_to_send);
peer.m_addrs_to_send.resize(max_addr_to_send);
}
+ LogPrintf("BEFORE FILTERING ALREADY KNOWN ADDR: %s\n",
+ peer.m_addrs_to_send.size());
+
// Remove addr records that the peer already knows about, and add new
// addrs to the m_addr_known filter on the same pass.
auto addr_already_known =
@@ -8206,8 +8219,12 @@
addr_already_known),
peer.m_addrs_to_send.end());
+ LogPrintf("AFTER FILTERING ALREADY KNOWN ADDR: %s\n",
+ peer.m_addrs_to_send.size());
+
// No addr messages to send
if (peer.m_addrs_to_send.empty()) {
+ LogPrintf("NOTHING LEFT TO SEND\n");
return;
}
diff --git a/test/functional/abc_p2p_getavaaddr.py b/test/functional/abc_p2p_getavaaddr.py
--- a/test/functional/abc_p2p_getavaaddr.py
+++ b/test/functional/abc_p2p_getavaaddr.py
@@ -173,7 +173,7 @@
mock_time += MAX_ADDR_SEND_DELAY
node.setmocktime(mock_time)
requester.sync_with_ping()
- requester.wait_until(requester.addr_received)
+ requester.wait_until(requester.addr_received, timeout=10)
requester.received_addrs = None
# Add some more address so the node has something to respond
@@ -556,16 +556,16 @@
def run_test(self):
self.getavaaddr_interval_test()
- # Limited by maxaddrtosend
- self.address_test(maxaddrtosend=3, num_proof=2, num_avanode=8)
- # Limited by the number of good nodes
- self.address_test(maxaddrtosend=100, num_proof=2, num_avanode=8)
+ # # Limited by maxaddrtosend
+ # self.address_test(maxaddrtosend=3, num_proof=2, num_avanode=8)
+ # # Limited by the number of good nodes
+ # self.address_test(maxaddrtosend=100, num_proof=2, num_avanode=8)
- self.getavaaddr_outbound_test()
- self.getavaaddr_manual_test()
- self.getavaaddr_noquorum()
- self.test_send_inbound_getavaaddr_until_quorum_is_established()
- self.test_addr_requests_order()
+ # self.getavaaddr_outbound_test()
+ # self.getavaaddr_manual_test()
+ # self.getavaaddr_noquorum()
+ # self.test_send_inbound_getavaaddr_until_quorum_is_established()
+ # self.test_addr_requests_order()
if __name__ == "__main__":

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 1, 10:02 (6 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187283
Default Alt Text
D17659.id52663.diff (4 KB)

Event Timeline