nervosnetwork / fiber

21 stars 11 forks source link

[add_tlc] send a lot of random hashes for add_tlc #294

Open gpBlockchain opened 3 weeks ago

gpBlockchain commented 3 weeks ago
  1. open_channel(max_tlc_number_in_flight: 10000000)
  2. send a lot of random hashes for add_tlc
    curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "add_tlc",
    "params": [
        {
            "channel_id": "0xe0692e1fd9ccba27f30a23fd3c70da2df1a7ecce29b78839382c08b1750b3df8",
            "amount": "0x64",
            "payment_hash": "0x52226b2d260888c7b31b15b2a984084e82af6d5ead6b28a786c863bae233032f",
            "expiry": 400,
            "hash_algorithm": "sha256"
        }
    ]
    }'
    {"jsonrpc":"2.0","result":{"tlc_id":"0x15c"},"id":42}

Node1 and Node2 logged a lot of messages, If we establish a connection with the boot_node and then stress test add_tlc, I wonder if it could cause a DDoS attack.

node1 log: node1.add_tlc.log node2 log: node2.add_tlc.log