<p>I had a look.<br>
It looks like the problem is a dishonest/buggy/old peer.</p>
<p>There is a peer is sending an invalid "alert" msg.<br>
Alert msgs were used in the past to alert problems on the btc protocol. Alert messages are deprecated but a peer is sending it anyway.</p>
<p>On top of that, the alert msg is malformed.<br>
Bitcoin msg format is: header+payload.<br>
Since the first couple of bytes of the payload printed on the log look like a header, I guess the malformed msg contains the msg header twice (unfortunately just the payload is printed on the log, not the full msg).</p>
<p>As part of bisq's bitcoinj 0.14.7 release I included some DoS protection<br>
<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/bisq-network/bitcoinj/commit/66c5bd46cbabfab57e3cdcc6379e21c81d989ae1/hovercard" href="https://github.com/bisq-network/bitcoinj/commit/66c5bd46cbabfab57e3cdcc6379e21c81d989ae1">bisq-network/bitcoinj@<tt>66c5bd4</tt></a> that just happened to detect this malformed msg.</p>
<p>I was able to reproduce the exception running bisq in dao-betanet (it is reproduced randomly).</p>
<p>I notice by default dao-betanet does not use the "safe" btc nodes provided by the bisq community. It uses either dns peer discovery or connects to the harcoded bitcoinj nodes.</p>
<p>I wrote a java main program that reproduces the problem:</p>
<pre><code>import org.bitcoinj.core.BitcoinSerializer;
import org.bitcoinj.core.Message;
import org.bitcoinj.params.MainNetParams;

import java.io.IOException;
import java.nio.ByteBuffer;

import static org.bitcoinj.core.Utils.HEX;

public class Test {

    public static void main(String[] args) throws IOException {
        String msg = "f9beb4d9616c65727400000000000000a80000001bf9aaea60010000000000000000000000ffffff7f00000000ffffff7ffeffff7f01ffffff7f00000000ffffff7f00ffffff7f002f555247454e543a20416c657274206b657920636f6d70726f6d697365642c2075706772616465207265717569726564004630440220653febd6410f470f6bae11cad19c48413becb1ac2c17f908fd0fd53bdc3abd5202206d0e9c96fe88d4a0f01ed9dedae2b6f9e00da94cad0fecaae66ecf689bf71b50";
        String doubleHeaderMsg = "f9beb4d9616c65727400000000000000a80000001de0d306f9beb4d9616c65727400000000000000a80000001bf9aaea60010000000000000000000000ffffff7f00000000ffffff7ffeffff7f01ffffff7f00000000ffffff7f00ffffff7f002f555247454e543a20416c657274206b657920636f6d70726f6d697365642c2075706772616465207265717569726564004630440220653febd6410f470f6bae11cad19c48413becb1ac2c17f908fd0fd53bdc3abd5202206d0e9c96fe88d4a0f01ed9dedae2b6f9e00da94cad0fecaae66ecf689bf71b50";
        BitcoinSerializer serializer = new BitcoinSerializer(MainNetParams.get(), false);
        ByteBuffer bb = ByteBuffer.wrap(HEX.decode(doubleHeaderMsg));
        Message m = serializer.deserialize(bb);
        System.out.print(m);
    }
}
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/issues/2557#issuecomment-474131078">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AkpZtvczB8H2FCHedTkVOMUGdCaavC22ks5vYBf3gaJpZM4b6fgM">mute the thread</a>.<img src="https://github.com/notifications/beacon/AkpZtl3fZM8wz2-6oeuQz-LXKVQwJIu9ks5vYBf3gaJpZM4b6fgM.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/bisq-network/bisq","title":"bisq-network/bisq","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/bisq-network/bisq"}},"updates":{"snippets":[{"icon":"PERSON","message":"@oscarguindzberg in #2557: I had a look.\r\nIt looks like the problem is a dishonest/buggy/old peer.\r\n\r\nThere is a peer is sending an invalid \"alert\" msg.\r\nAlert msgs were used in the past to alert problems on the btc protocol. Alert messages are deprecated but a peer is sending it anyway.\r\n\r\nOn top of that, the alert msg is malformed.\r\nBitcoin msg format is: header+payload. \r\nSince the first couple of bytes of the payload printed on the log look like a header, I guess the malformed msg contains the msg header twice (unfortunately just the payload is printed on the log, not the full msg). \r\n\r\nAs part of bisq's bitcoinj 0.14.7 release I included some DoS protection\r\nhttps://github.com/bisq-network/bitcoinj/commit/66c5bd46cbabfab57e3cdcc6379e21c81d989ae1 that just happened to detect this malformed msg.\r\n\r\nI was able to reproduce the exception running bisq in dao-betanet (it is reproduced randomly).\r\n\r\nI notice by default dao-betanet does not use the \"safe\" btc nodes provided by the bisq community. It uses either dns peer discovery or connects to the harcoded bitcoinj nodes. \r\n\r\nI wrote a java main program that reproduces the problem:\r\n\r\n```\r\nimport org.bitcoinj.core.BitcoinSerializer;\r\nimport org.bitcoinj.core.Message;\r\nimport org.bitcoinj.params.MainNetParams;\r\n\r\nimport java.io.IOException;\r\nimport java.nio.ByteBuffer;\r\n\r\nimport static org.bitcoinj.core.Utils.HEX;\r\n\r\npublic class Test {\r\n\r\n    public static void main(String[] args) throws IOException {\r\n        String msg = \"f9beb4d9616c65727400000000000000a80000001bf9aaea60010000000000000000000000ffffff7f00000000ffffff7ffeffff7f01ffffff7f00000000ffffff7f00ffffff7f002f555247454e543a20416c657274206b657920636f6d70726f6d697365642c2075706772616465207265717569726564004630440220653febd6410f470f6bae11cad19c48413becb1ac2c17f908fd0fd53bdc3abd5202206d0e9c96fe88d4a0f01ed9dedae2b6f9e00da94cad0fecaae66ecf689bf71b50\";\r\n        String doubleHeaderMsg = \"f9beb4d9616c65727400000000000000a80000001de0d306f9beb4d9616c65727400000000000000a80000001bf9aaea60010000000000000000000000ffffff7f00000000ffffff7ffeffff7f01ffffff7f00000000ffffff7f00ffffff7f002f555247454e543a20416c657274206b657920636f6d70726f6d697365642c2075706772616465207265717569726564004630440220653febd6410f470f6bae11cad19c48413becb1ac2c17f908fd0fd53bdc3abd5202206d0e9c96fe88d4a0f01ed9dedae2b6f9e00da94cad0fecaae66ecf689bf71b50\";\r\n        BitcoinSerializer serializer = new BitcoinSerializer(MainNetParams.get(), false);\r\n        ByteBuffer bb = ByteBuffer.wrap(HEX.decode(doubleHeaderMsg));\r\n        Message m = serializer.deserialize(bb);\r\n        System.out.print(m);\r\n    }\r\n}\r\n```"}],"action":{"name":"View Issue","url":"https://github.com/bisq-network/bisq/issues/2557#issuecomment-474131078"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/issues/2557#issuecomment-474131078",
"url": "https://github.com/bisq-network/bisq/issues/2557#issuecomment-474131078",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>