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

test: Test failed when running p2p_addr_relay.py #22819

Closed
nourou4them opened this issue Aug 27, 2021 · 5 comments
Closed

test: Test failed when running p2p_addr_relay.py #22819

nourou4them opened this issue Aug 27, 2021 · 5 comments

Comments

@nourou4them
Copy link

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

@0xB10C
Copy link
Contributor

0xB10C commented Aug 27, 2021

On what branch / commit are you? You run git log -1 and post the output here.

@nourou4them
Copy link
Author

Here is the result:

commit d3203a9 (HEAD -> master, origin/master, origin/HEAD)
Merge: ec6db8e 7c33e3a
Author: Hennadii Stepanov 32963518+hebasto@users.noreply.github.com
Date: Mon Aug 23 22:08:32 2021 +0300

Merge bitcoin-core/gui#408: Add missing mnemonics in menu bar options

7c33e3a572b62536566247f237031010bcf4ecb2 qt: Add missing mnemonics in menu bar options (Shashwat)

Pull request description:

  Since #362 we have defaulted to add mnemonic shortcuts for the context menus.
  The Window -> Minimize option and File -> Load PSBT from clipboard were hitherto missing a mnemonic shortcut. This PR adds mnemonic shortcuts for them

  Changes introduced in this PR:
  | Master | PR |
  | ----------| ---- |
  | ![Screenshot from 2021-08-23 23-10-07](https://user-images.githubusercontent.com/85434418/130494098-c65ec9da-c3f1-4243-9b3d-0c87cb677825.png) | ![Screenshot from 2021-08-23 23-08-41](https://user-images.githubusercontent.com/85434418/130494083-849ffd14-05e9-4a6d-

bdc3-b3e55b8a8861.png)|
|Screenshot from 2021-08-23 23-10-21|![Screenshot from 2021-08-23 23-09-00](https://user-images.githubusercontent.com/85434418/130494181-dcdbf119-a2c6-469d-a6c
9-3021506ab40b.png)|

ACKs for top commit:
  jarolrod:
    tACK 7c33e3a572b62536566247f237031010bcf4ecb2
  hebasto:
    ACK 7c33e3a572b62536566247f237031010bcf4ecb2, tested on Linux Mint 20.2 (Qt 5.12.8).

Tree-SHA512: 32f201ae7716b19ca123856292f8bfa0d805f6c7271ac1b5e08eff6b95017443754c8a76e8396ccca1869a57384e11016cbd99d63ccdd2fae6da4eaf3ae32298

@nourou4them
Copy link
Author

I just run git pull, and still the same error.

@jonatack
Copy link
Contributor

jonatack commented Aug 27, 2021

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 > > 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'

That is the first assert on addr_relay_enabled in the test file. My guess is you are running the test on a build that pre-dates the merge of #21528. In other words, you not only need to git pull but also build.

@nourou4them
Copy link
Author

nourou4them commented Aug 27, 2021

Yes I just did that and tests were successful.
Thanks for your help @jonatack.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants