raiden-network / raiden

Raiden Network
https://developer.raiden.network
Other
1.84k stars 378 forks source link

Direct Transfer gets stuck when injecting secret and/or secret hash #5454

Open fredo opened 4 years ago

fredo commented 4 years ago

Working on Raidex I experienced that my transfers get stuck when injecting the the secret and/or the secret hash with the payment. It represents the "atomic swap". Only direct transfers are used.

Problem Definition

There are two payments on different channels with the same secret, secret hash and identifier which are sent at about the same time. The same problem exists when only injecting the secret hash and using an external secret resolver. The resolver does not get called.

Before the incident, normal payments without injecting secret and/or secret hash do work. Even The atomic swap works when not injecting secret and/or secret hash. After the incident even normal payments get stuck.

It seems to be related to a payment injecting secret and/or secret hash.

Interestingly this problem seems to be new. With earlier versions a couple of months ago I did not have this situation. The code base of calling payment API did not change since then.

How to reproduce the problem

Issue checklist

How to find the payment of interest

Node 1: 0xA11ce1c6099E5199ACE0163F05359A3F50cd2FaA Node 2: 0xb0bBe115C6b77560Bf2697B4125E2d7867ea6748 Token Address 1: 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6 Token Address 2: 0xA0195E88F732ff6379642eB702302dFae6EA7bC4

json body of payments:

{'amount': 1, 
'identifier': 2707334117, 
'secret': '0x9454afbb94153059a284c5a10cf3e6f2d843cc20f0e5d4e60cc92e00f63a4582',
'secret_hash': '0xb7fc274f5fab987e4bdf194a9a0d1f21cec5ea6716f8a56edf8fd290d6f51e7e'}

logs:

raiden-debug_2019-12-06T11:13:20.058204.log raiden-debug_2019-12-06T11:13:39.814417.log

db

node_.zip

fredo commented 4 years ago

Edit:

The pending_transfer API call of the two nodes only shows the own transfer not the receiving one.

I just created a new swap:

For 0xA11ce1c6099E5199ACE0163F05359A3F50cd2FaA:

{
payment_identifier: "3529944478",
token_address: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
token_network_address: "0x04b7ED2E55cbe7aD8139E03522aB2A09c3c824dA",
channel_identifier: "8",
initiator: "0xA11ce1c6099E5199ACE0163F05359A3F50cd2FaA",
target: "0xb0bBe115C6b77560Bf2697B4125E2d7867ea6748",
transferred_amount: "1000000000000000",
locked_amount: "1",
role: "initiator"
}

For 0xb0bBe115C6b77560Bf2697B4125E2d7867ea6748:

{
payment_identifier: "3529944478",
token_address: "0xA0195E88F732ff6379642eB702302dFae6EA7bC4",
token_network_address: "0x43F9Fe3C215318a11DDbe7f45335bFC1dF4c2b83",
channel_identifier: "6",
initiator: "0xb0bBe115C6b77560Bf2697B4125E2d7867ea6748",
target: "0xA11ce1c6099E5199ACE0163F05359A3F50cd2FaA",
transferred_amount: "1000000000000000000",
locked_amount: "1",
role: "initiator"
}