def METHOD_NAME(self):
    # Tests the validation:block_connected tracepoint by generating blocks
    # and comparing the values passed in the tracepoint arguments with the
    # blocks.
    # See https://github.com/bitcoin/bitcoin/blob/master/doc/tracing.md#tracepoint-validationblock_connected
    class Block(ctypes.Structure):
        _fields_ = [
            ("hash", ctypes.c_ubyte * 32),
            ("height", ctypes.c_int),
            ("transactions", ctypes.c_int64),
            ("inputs", ctypes.c_int),
            ("sigops", ctypes.c_int64),
            ("duration", ctypes.c_uint64),
        ]
        def __repr__(self):
            return "ConnectedBlock(hash=%s height=%d, transactions=%d, inputs=%d, sigops=%d, duration=%d)" % (
                bytes(self.hash[::-1]).hex(),
                self.height,
                self.transactions,
                self.inputs,
                self.sigops,
                self.duration)
    BLOCKS_EXPECTED = 2
    blocks_checked = 0
    expected_blocks = dict()
    events = []
    self.log.info("hook into the validation:block_connected tracepoint")
    ctx = USDT(pid=self.nodes[0].process.pid)
    ctx.enable_probe(probe="validation:block_connected",
                     fn_name="trace_block_connected")
    bpf = BPF(text=validation_blockconnected_program,
              usdt_contexts=[ctx], debug=0)
    def handle_blockconnected(_, data, __):
        nonlocal events, blocks_checked
        event = ctypes.cast(data, ctypes.POINTER(Block)).contents
        self.log.info(f"handle_blockconnected(): {event}")
        events.append(event)
        blocks_checked += 1
    bpf["block_connected"].open_perf_buffer(
        handle_blockconnected)
    self.log.info(f"mine {BLOCKS_EXPECTED} blocks")
    block_hashes = self.generatetoaddress(
        self.nodes[0], BLOCKS_EXPECTED, ADDRESS_BCRT1_UNSPENDABLE)
    for block_hash in block_hashes:
        expected_blocks[block_hash] = self.nodes[0].getblock(block_hash, 2)
    bpf.perf_buffer_poll(timeout=200)
    self.log.info(f"check that we correctly traced {BLOCKS_EXPECTED} blocks")
    for event in events:
        block_hash = bytes(event.hash[::-1]).hex()
        block = expected_blocks[block_hash]
        assert_equal(block["hash"], block_hash)
        assert_equal(block["height"], event.height)
        assert_equal(len(block["tx"]), event.transactions)
        assert_equal(len([tx["vin"] for tx in block["tx"]]), event.inputs)
        assert_equal(0, event.sigops)  # no sigops in coinbase tx
        # only plausibility checks
        assert event.duration > 0
        del expected_blocks[block_hash]
    assert_equal(BLOCKS_EXPECTED, blocks_checked)
    assert_equal(0, len(expected_blocks))
    bpf.cleanup()