When running the p2p_addr_relay.py test on a WSL (ubuntu1804), I encountered a KeyError exception. It was on the following stage : "Check that we only relay addresses to inbound peers who have previously sent us addr related messages". The missing key is the "addr_relay_enabled". It seems there is no reference or previous dictionary where to find it.
Here are the logs:
2021-08-26T10:16:27.071000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_tbpvrrpg 2021-08-26T10:16:27.783000Z TestFramework (INFO): Send an addr message that is too large 2021-08-26T10:16:27.952000Z TestFramework (INFO): Test address relay 2021-08-26T10:16:27.953000Z TestFramework (INFO): Check that addr message content is relayed and added to addrman 2021-08-26T10:16:29.611000Z TestFramework (INFO): Check relay of addresses received from outbound peers 2021-08-26T10:16:29.968000Z TestFramework (INFO): Check that the first addr message received from an outbound peer is not relayed 2021-08-26T10:16:30.021000Z TestFramework (INFO): Check that subsequent addr messages sent from an outbound peer are relayed 2021-08-26T10:16:30.175000Z TestFramework (INFO): Check address relay to outbound peers 2021-08-26T10:16:30.581000Z TestFramework (INFO): Check that addresses are relayed to full outbound peers 2021-08-26T10:16:30.581000Z TestFramework (INFO): Check that addresses are not relayed to block-relay-only outbound peers 2021-08-26T10:16:30.584000Z TestFramework (INFO): Check that we only relay addresses to inbound peers who have previously sent us addr related messages 2021-08-26T10:16:30.895000Z TestFramework (ERROR): Key error Traceback (most recent call last): File "/home/nourou/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main self.run_test() File "p2p_addr_relay.py", line 86, in run_test self.inbound_blackhole_tests() File "p2p_addr_relay.py", line 214, in inbound_blackhole_tests assert_equal(peerinfo[0]['addr_relay_enabled'], True) # addr_source KeyError: 'addr_relay_enabled' 2021-08-26T10:16:30.586000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendaddrv2() 2021-08-26T10:16:30.586000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.586000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendheaders() 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=2) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=1) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_ping(nonce=3f51963ece3a99e0) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_pong(nonce=3f51963ece3a99e0) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_getheaders(locator=CBlockLocator(vHave=[23807444962857534591630102868443165169099872195127563234000810727149388982010, 447397901073913437177306182676806822084817164934125609 01130905383743091755536, 12663556118629435951519719937229071722250511777495500151983207830672125396536, 44153859904987177378521432406456967833959290357169379249027894378362945782348, 6949721849041576887560731018902390530686828028312945809877884568294648915735, 7838396004 4691199607349080946738357045163442094918920687129393... (msg truncated) 2021-08-26T10:16:30.587000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_feefilter(feerate=000003e8) 2021-08-26T10:16:30.634000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_ping(nonce=00000001) 2021-08-26T10:16:30.635000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_pong(nonce=00000001) 2021-08-26T10:16:30.686000Z TestFramework.p2p (DEBUG): Connecting to Bitcoin Node: 127.0.0.1:15188 2021-08-26T10:16:30.687000Z TestFramework.p2p (DEBUG): Connected & Listening: 127.0.0.1:15188 2021-08-26T10:16:30.687000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_version(nVersion=70016 nServices=9 nTime=Thu Aug 26 12:16:30 2021 addrTo=CAddress(nServices=1 net=IPv4 addr=127.0.0.1 port=15188) addrFrom=CAddress(nServices=1 net=IPv4 addr=0.0.0 .0 port=0) nNonce=0xCDE1539BE4DD0287 strSubVer=/python-p2p-tester:0.0.3/ nStartingHeight=-1 relay=1) 2021-08-26T10:16:30.688000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_version(nVersion=70016 nServices=1033 nTime=Thu Aug 26 12:56:27 2021 addrTo=CAddress(nServices=0 net=IPv4 addr=0.0.0.0 port=0) addrFrom=CAddress(nServices=1033 net=IPv4 addr =0.0.0.0 port=0) nNonce=0x1BB1500D2D875110 strSubVer=/Satoshi:21.99.0(testnode0)/ nStartingHeight=200 relay=1) 2021-08-26T10:16:30.688000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_getaddr() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_wtxidrelay() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendaddrv2() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.689000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendheaders() 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=2) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=1) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_ping(nonce=ce6d7861bf58d32e) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_pong(nonce=ce6d7861bf58d32e) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_getheaders(locator=CBlockLocator(vHave=[23807444962857534591630102868443165169099872195127563234000810727149388982010, 447397901073913437177306182676806822084817164934125609 01130905383743091755536, 12663556118629435951519719937229071722250511777495500151983207830672125396536, 44153859904987177378521432406456967833959290357169379249027894378362945782348, 6949721849041576887560731018902390530686828028312945809877884568294648915735, 7838396004 4691199607349080946738357045163442094918920687129393... (msg truncated) 2021-08-26T10:16:30.690000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_feefilter(feerate=000003e8) 2021-08-26T10:16:30.737000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_ping(nonce=00000001) 2021-08-26T10:16:30.738000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_pong(nonce=00000001) 2021-08-26T10:16:30.790000Z TestFramework.p2p (DEBUG): Connecting to Bitcoin Node: 127.0.0.1:15188 2021-08-26T10:16:30.791000Z TestFramework.p2p (DEBUG): Connected & Listening: 127.0.0.1:15188 2021-08-26T10:16:30.791000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_version(nVersion=70016 nServices=9 nTime=Thu Aug 26 12:16:30 2021 addrTo=CAddress(nServices=1 net=IPv4 addr=127.0.0.1 port=15188) addrFrom=CAddress(nServices=1 net=IPv4 addr=0.0.0 .0 port=0) nNonce=0xC03B06A32F1618AC strSubVer=/python-p2p-tester:0.0.3/ nStartingHeight=-1 relay=1) 2021-08-26T10:16:30.792000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_version(nVersion=70016 nServices=1033 nTime=Thu Aug 26 12:56:27 2021 addrTo=CAddress(nServices=0 net=IPv4 addr=0.0.0.0 port=0) addrFrom=CAddress(nServices=1033 net=IPv4 addr =0.0.0.0 port=0) nNonce=0x162B7EC1F6F7DD53 strSubVer=/Satoshi:21.99.0(testnode0)/ nStartingHeight=200 relay=1) 2021-08-26T10:16:30.792000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.792000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_wtxidrelay() 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendaddrv2() 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_verack() 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendheaders() 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=2) 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_sendcmpct(announce=False, version=1) 2021-08-26T10:16:30.793000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_ping(nonce=d1be045bb8729d13) 2021-08-26T10:16:30.794000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_pong(nonce=d1be045bb8729d13) 2021-08-26T10:16:30.794000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_getheaders(locator=CBlockLocator(vHave=[23807444962857534591630102868443165169099872195127563234000810727149388982010, 447397901073913437177306182676806822084817164934125609 01130905383743091755536, 12663556118629435951519719937229071722250511777495500151983207830672125396536, 44153859904987177378521432406456967833959290357169379249027894378362945782348, 6949721849041576887560731018902390530686828028312945809877884568294648915735, 7838396004 4691199607349080946738357045163442094918920687129393... (msg truncated) 2021-08-26T10:16:30.794000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_feefilter(feerate=000003e8) 2021-08-26T10:16:30.841000Z TestFramework.p2p (DEBUG): Send message to 127.0.0.1:15188: msg_ping(nonce=00000001) 2021-08-26T10:16:30.842000Z TestFramework.p2p (DEBUG): Received message from 127.0.0.1:15188: msg_pong(nonce=00000001) 2021-08-26T10:16:30.895000Z TestFramework (ERROR): Key error Traceback (most recent call last): File "/home/nourou/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main self.run_test() File "p2p_addr_relay.py", line 86, in run_test self.inbound_blackhole_tests() File "p2p_addr_relay.py", line 214, in inbound_blackhole_tests assert_equal(peerinfo[0]['addr_relay_enabled'], True) # addr_source KeyError: 'addr_relay_enabled' 2021-08-26T10:16:30.937000Z TestFramework (DEBUG): Closing down network thread 2021-08-26T10:16:30.988000Z TestFramework (INFO): Stopping nodes 2021-08-26T10:16:30.989000Z TestFramework.node0 (DEBUG): Stopping node 2021-08-26T10:16:31.417000Z TestFramework.node0 (DEBUG): Node stopped 2021-08-26T10:16:31.417000Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_tbpvrrpg 2021-08-26T10:16:31.418000Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_tbpvrrpg/test_framework.log
|![Screenshot from 2021-08-23 23-09-00](