Page MenuHomePhabricator

[avalanche] Protect from eviction nodes that relayed new proofs
ClosedPublic

Authored by Fabien on Jul 26 2021, 06:25.

Details

Reviewers
PiRK
1LcaSZDHPh3VXhCLZuNpNE3Zfikrta2NzU
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABC9d952964361b: [avalanche] Protect from eviction nodes that relayed new proofs
Summary

Similar to what is done for txs and blocks, this protects 4 nodes from eviction sorted by the last time they sent us a proof we didn't know previously. Note that the fallback make (when both time = 0) makes it possible to have this enabled all the time even if avalanche is disabled.

Ref T1634.

Test Plan
ninja check
./test/functional/test_runner.py p2p_eviction

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_protect_last_proof_time
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16255
Build 32377: Build Diffbuild-diff · lint-circular-dependencies · build-without-wallet · build-clang · build-clang-tidy · build-debug
Build 32376: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Jul 26 2021, 06:25

Failed tests logs:

====== Bitcoin ABC functional tests: p2p_eviction.py ======

------- Stdout: -------
2021-07-26T06:36:30.040000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210726_063514/p2p_eviction_61
2021-07-26T06:36:30.331000Z TestFramework (INFO): Create 4 peers and protect them from eviction by sending us a block
2021-07-26T06:36:31.579000Z TestFramework (INFO): Create 5 slow-pinging peers, making them eviction candidates
2021-07-26T06:36:32.351000Z TestFramework (INFO): Create 4 peers and protect them from eviction by sending us a tx
2021-07-26T06:36:33.202000Z TestFramework (INFO): Create 8 peers and protect them from eviction by having faster pings
2021-07-26T06:36:34.014000Z TestFramework (INFO): Create peer that triggers the eviction mechanism
2021-07-26T06:37:34.056000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
'''
2021-07-26T06:37:34.056000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/p2p_eviction.py", line 123, in run_test
    node.add_p2p_connection(SlowP2PInterface())
  File "/work/test/functional/test_framework/test_node.py", line 683, in add_p2p_connection
    p2p_conn.wait_for_verack()
  File "/work/test/functional/test_framework/p2p.py", line 563, in wait_for_verack
    self.wait_until(test_function, timeout=timeout, check_connected=False)
  File "/work/test/functional/test_framework/p2p.py", line 481, in wait_until
    timeout_factor=self.timeout_factor)
  File "/work/test/functional/test_framework/util.py", line 278, in wait_until
    "Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
''' not true after 60.0 seconds
2021-07-26T06:37:34.107000Z TestFramework (INFO): Stopping nodes
2021-07-26T06:37:34.360000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210726_063514/p2p_eviction_61
2021-07-26T06:37:34.361000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210726_063514/p2p_eviction_61/test_framework.log
2021-07-26T06:37:34.361000Z TestFramework (ERROR): 
2021-07-26T06:37:34.361000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20210726_063514/p2p_eviction_61' to consolidate all logs
2021-07-26T06:37:34.362000Z TestFramework (ERROR): 
2021-07-26T06:37:34.362000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-07-26T06:37:34.362000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-07-26T06:37:34.362000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: p2p_eviction.py

Failed tests logs:

====== Bitcoin ABC functional tests: p2p_eviction.py ======

------- Stdout: -------
2021-07-26T06:37:50.635000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210726_063414/p2p_eviction_61
2021-07-26T06:37:51.601000Z TestFramework (INFO): Create 4 peers and protect them from eviction by sending us a block
2021-07-26T06:37:52.840000Z TestFramework (INFO): Create 5 slow-pinging peers, making them eviction candidates
2021-07-26T06:37:53.632000Z TestFramework (INFO): Create 4 peers and protect them from eviction by sending us a tx
2021-07-26T06:37:54.476000Z TestFramework (INFO): Create 8 peers and protect them from eviction by having faster pings
2021-07-26T06:37:55.287000Z TestFramework (INFO): Create peer that triggers the eviction mechanism
2021-07-26T06:38:55.307000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
'''
2021-07-26T06:38:55.307000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/p2p_eviction.py", line 123, in run_test
    node.add_p2p_connection(SlowP2PInterface())
  File "/work/test/functional/test_framework/test_node.py", line 683, in add_p2p_connection
    p2p_conn.wait_for_verack()
  File "/work/test/functional/test_framework/p2p.py", line 563, in wait_for_verack
    self.wait_until(test_function, timeout=timeout, check_connected=False)
  File "/work/test/functional/test_framework/p2p.py", line 481, in wait_until
    timeout_factor=self.timeout_factor)
  File "/work/test/functional/test_framework/util.py", line 278, in wait_until
    "Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
''' not true after 60.0 seconds
2021-07-26T06:38:55.358000Z TestFramework (INFO): Stopping nodes
2021-07-26T06:38:55.509000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210726_063414/p2p_eviction_61
2021-07-26T06:38:55.509000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210726_063414/p2p_eviction_61/test_framework.log
2021-07-26T06:38:55.509000Z TestFramework (ERROR): 
2021-07-26T06:38:55.510000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20210726_063414/p2p_eviction_61' to consolidate all logs
2021-07-26T06:38:55.510000Z TestFramework (ERROR): 
2021-07-26T06:38:55.510000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-07-26T06:38:55.510000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-07-26T06:38:55.510000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: p2p_eviction.py

Failed tests logs:

====== Bitcoin ABC functional tests: p2p_eviction.py ======

------- Stdout: -------
2021-07-26T06:38:08.858000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210726_063526/p2p_eviction_61
2021-07-26T06:38:09.156000Z TestFramework (INFO): Create 4 peers and protect them from eviction by sending us a block
2021-07-26T06:38:10.395000Z TestFramework (INFO): Create 5 slow-pinging peers, making them eviction candidates
2021-07-26T06:38:11.160000Z TestFramework (INFO): Create 4 peers and protect them from eviction by sending us a tx
2021-07-26T06:38:11.993000Z TestFramework (INFO): Create 8 peers and protect them from eviction by having faster pings
2021-07-26T06:38:12.800000Z TestFramework (INFO): Create peer that triggers the eviction mechanism
2021-07-26T06:39:12.858000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
'''
2021-07-26T06:39:12.858000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/p2p_eviction.py", line 123, in run_test
    node.add_p2p_connection(SlowP2PInterface())
  File "/work/test/functional/test_framework/test_node.py", line 683, in add_p2p_connection
    p2p_conn.wait_for_verack()
  File "/work/test/functional/test_framework/p2p.py", line 563, in wait_for_verack
    self.wait_until(test_function, timeout=timeout, check_connected=False)
  File "/work/test/functional/test_framework/p2p.py", line 481, in wait_until
    timeout_factor=self.timeout_factor)
  File "/work/test/functional/test_framework/util.py", line 278, in wait_until
    "Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
''' not true after 60.0 seconds
2021-07-26T06:39:12.913000Z TestFramework (INFO): Stopping nodes
2021-07-26T06:39:13.168000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210726_063526/p2p_eviction_61
2021-07-26T06:39:13.168000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210726_063526/p2p_eviction_61/test_framework.log
2021-07-26T06:39:13.169000Z TestFramework (ERROR): 
2021-07-26T06:39:13.169000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210726_063526/p2p_eviction_61' to consolidate all logs
2021-07-26T06:39:13.169000Z TestFramework (ERROR): 
2021-07-26T06:39:13.170000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-07-26T06:39:13.170000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-07-26T06:39:13.170000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: p2p_eviction.py ======

------- Stdout: -------
2021-07-26T06:41:45.719000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210726_063913/p2p_eviction_61
2021-07-26T06:41:46.276000Z TestFramework (INFO): Create 4 peers and protect them from eviction by sending us a block
2021-07-26T06:41:47.514000Z TestFramework (INFO): Create 5 slow-pinging peers, making them eviction candidates
2021-07-26T06:41:48.286000Z TestFramework (INFO): Create 4 peers and protect them from eviction by sending us a tx
2021-07-26T06:41:49.129000Z TestFramework (INFO): Create 8 peers and protect them from eviction by having faster pings
2021-07-26T06:41:49.942000Z TestFramework (INFO): Create peer that triggers the eviction mechanism
2021-07-26T06:42:49.964000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
'''
2021-07-26T06:42:49.964000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 127, in main
    self.run_test()
  File "/work/test/functional/p2p_eviction.py", line 123, in run_test
    node.add_p2p_connection(SlowP2PInterface())
  File "/work/test/functional/test_framework/test_node.py", line 683, in add_p2p_connection
    p2p_conn.wait_for_verack()
  File "/work/test/functional/test_framework/p2p.py", line 563, in wait_for_verack
    self.wait_until(test_function, timeout=timeout, check_connected=False)
  File "/work/test/functional/test_framework/p2p.py", line 481, in wait_until
    timeout_factor=self.timeout_factor)
  File "/work/test/functional/test_framework/util.py", line 278, in wait_until
    "Predicate {} not true after {} seconds".format(predicate_source, timeout))
AssertionError: Predicate ''''
        def test_function():
            if check_connected:
                assert self.is_connected
            return test_function_in()
''' not true after 60.0 seconds
2021-07-26T06:42:50.018000Z TestFramework (INFO): Stopping nodes
2021-07-26T06:42:50.072000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210726_063913/p2p_eviction_61
2021-07-26T06:42:50.072000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210726_063913/p2p_eviction_61/test_framework.log
2021-07-26T06:42:50.072000Z TestFramework (ERROR): 
2021-07-26T06:42:50.073000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20210726_063913/p2p_eviction_61' to consolidate all logs
2021-07-26T06:42:50.073000Z TestFramework (ERROR): 
2021-07-26T06:42:50.073000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-07-26T06:42:50.074000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-07-26T06:42:50.074000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: p2p_eviction.py
Bitcoin ABC functional tests with the next upgrade activated: p2p_eviction.py

Fabien planned changes to this revision.Jul 26 2021, 06:45
Fabien edited the summary of this revision. (Show Details)
Fabien added a task: Restricted Maniphest Task.
PiRK requested changes to this revision.Jul 26 2021, 11:06
PiRK added a subscriber: PiRK.
PiRK added inline comments.
src/test/net_tests.cpp
930

this comment does not mention proofs, so it does not add up to 32

939

"last"

test/functional/p2p_eviction.py
93

This line can be moved out of the loop. Or alternatively pass only [blocks[i]] and use [stakes[0]] in the line below

This revision now requires changes to proceed.Jul 26 2021, 11:06
This revision is now accepted and ready to land.Jul 26 2021, 12:01