user101040: I was reviewing the PR #25720. This is part of description for the PR:

However, if an INV for a block is received before our headers chain is
caught up, we'll then start to sync headers from each peer announcing
the block. This can result in doing a big headers sync with many (if
not all) of our peers simultaneously, which wastes bandwidth.

What is an INV message? I tried to figure it out by searching it but found nothing useful. This link had a small information about it but it is still not clear for me what it is.

user101040: Michael's answer was very helpful for me, but I think it is also helpful to take a look at the source code and implementation of inv messages while the question is tagged bitcoin-core-development.
This is the source code for inv messages. Link:
/** inv message data */
class CInv
{
public:
    CInv();
    CInv(uint32_t typeIn, const uint256& hashIn);

    SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }

    friend bool operator<(const CInv& a, const CInv& b);

    std::string GetCommand() const;
    std::string ToString() const;

    // Single-message helper methods
    bool IsMsgTx() const { return type == MSG_TX; }
    bool IsMsgBlk() const { return type == MSG_BLOCK; }
    bool IsMsgWtx() const { return type == MSG_WTX; }
    bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
    bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
    bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }

    // Combined-message helper methods
    bool IsGenTxMsg() const
    {
        return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX;
    }
    bool IsGenBlkMsg() const
    {
        return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK;
    }

    uint32_t type;
    uint256 hash;
};


user47827: inv is short for inventory. As the Bitcoin wiki says:

Inventory vectors are used for notifying other nodes about objects they have or data which is being requested.

Inventory vectors consist of the following data format:

The inv message (for transactions) was explained in the notes of this PR review club in Feb 2021 hosted by Elle Mouton.

Transaction relay is a three step process: inv -> getdata -> tx:

the relaying node sends an inv message to the receiving node to announce a new transaction.
if the receiving node wants to retrieve the transaction that it learned about in the inv message then it will send a getdata message to the relaying node to request the full transaction. (The receiving node won't send a getdata message to a peer for transactions that it has already seen or if it has already sent a getdata message for the transaction to a different peer.)
the relaying node delivers a tx message to the receiving node. If the relaying node is no longer able to deliver the transaction, it responds with notfound instead of the tx.



101040: <p>I was reviewing the <a href="https://github.com/bitcoin/bitcoin/pull/25720" rel="nofollow noreferrer">PR #25720</a>. This is part of description for the PR:</p>
<blockquote>
<p>However, if an INV for a block is received before our headers chain is
caught up, we'll then start to sync headers from each peer announcing
the block. This can result in doing a big headers sync with many (if
not all) of our peers simultaneously, which wastes bandwidth.</p>
</blockquote>
<p>What is an <code>INV</code> message? I tried to figure it out by searching it but found nothing useful. This <a href="https://en.bitcoin.it/wiki/Protocol_documentation#inv" rel="nofollow noreferrer">link</a> had a small information about it but it is still not clear for me what it is.</p>
 101040: <p>Michael's answer was very helpful for me, but I think it is also helpful to take a look at the source code and implementation of <code>inv</code> messages while the question is tagged <code>bitcoin-core-development</code>.</p>
<p>This is the source code for <code>inv</code> messages. <a href="https://github.com/bitcoin/bitcoin/blob/master/src/protocol.h#L471" rel="nofollow noreferrer">Link</a>:</p>
<pre><code>/** inv message data */
class CInv
{
public:
    CInv();
    CInv(uint32_t typeIn, const uint256&amp; hashIn);

    SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }

    friend bool operator&lt;(const CInv&amp; a, const CInv&amp; b);

    std::string GetCommand() const;
    std::string ToString() const;

    // Single-message helper methods
    bool IsMsgTx() const { return type == MSG_TX; }
    bool IsMsgBlk() const { return type == MSG_BLOCK; }
    bool IsMsgWtx() const { return type == MSG_WTX; }
    bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
    bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
    bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }

    // Combined-message helper methods
    bool IsGenTxMsg() const
    {
        return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX;
    }
    bool IsGenBlkMsg() const
    {
        return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK;
    }

    uint32_t type;
    uint256 hash;
};
</code></pre>
 47827: <p><code>inv</code> is short for inventory. As the Bitcoin <a href="https://en.bitcoin.it/wiki/Protocol_documentation#Inventory_Vectors" rel="nofollow noreferrer">wiki</a> says:</p>
<blockquote>
<p>Inventory vectors are used for notifying other nodes about objects they have or data which is being requested.</p>
</blockquote>
<p>Inventory vectors consist of the following data format:</p>
<p><a href="https://i.stack.imgur.com/gVLyq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gVLyq.png" alt="enter image description here" /></a></p>
<p>The <code>inv</code> message (for transactions) was explained in the <a href="https://bitcoincore.reviews/21224" rel="nofollow noreferrer">notes</a> of this PR review club in Feb 2021 hosted by Elle Mouton.</p>
<blockquote>
<p>Transaction relay is a three step process: <code>inv</code> -&gt; <code>getdata</code> -&gt; <code>tx</code>:</p>
<ol>
<li>the relaying node sends an <code>inv</code> message to the receiving node to announce a new transaction.</li>
<li>if the receiving node wants to retrieve the transaction that it learned about in the <code>inv</code> message then it will send a <code>getdata</code> message to the relaying node to request the full transaction. (The receiving node won't send a <code>getdata</code> message to a peer for transactions that it has already seen or if it has already sent a <code>getdata</code> message for the transaction to a different peer.)</li>
<li>the relaying node delivers a <code>tx</code> message to the receiving node. If the relaying node is no longer able to deliver the transaction, it responds with <code>notfound</code> instead of the <code>tx</code>.</li>
</ol>
</blockquote>
