1 suggestion
Optional improvements
[suggestion] · Assumevalid test does not pin the exact two-week threshold
The test catches a threshold below two weeks and a changed <= comparison, but a larger threshold still passes.
Location: test/functional/feature_assumevalid.py:190 (head).
Details and suggested fix
Node 2 receives 2017 headers, placing block 1 exactly two weeks of equivalent work behind the best header. The test expects script verification to remain enabled, so it catches a lower threshold or changing <= to <. But the nearest case that expects verification to be skipped places block 1 1,320,600 seconds behind; any threshold from two weeks up to that value still passes. For example, a mistaken 15-day threshold would go undetected. Such a mistake would make the node check more scripts, so this is a test-precision gap, not a safety problem. Send node 2 one additional header and check both sides of the boundary: block 1 should disable script verification at 2017 blocks behind, and block 2 should enable it at exactly 2016 blocks behind. Update the getchaintips lookup to self.blocks[BURIED_HEADER_COUNT]; block 102 remains checked, so the existing rejection assertions still hold.