nervosnetwork / fiber

21 stars 11 forks source link

[open_channel, send_payment] set tlc_fee_proportional_millionths 1000001 will cause send_payment FeeInsufficient #288

Open gpBlockchain opened 4 weeks ago

gpBlockchain commented 4 weeks ago
1. open_channel (tlc_fee_proportional_millionths:1000001)
2. node balance:100ckb  send_payment( ckb:0.01,max_fee_amount: 1000 ckb ) through node 
3. get_payment 
       return FeeInsufficient

rpc

curl --location 'http://127.0.0.1:8228' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "new_invoice",
    "params": [
        {
            "amount": "0xf4240",
            "currency": "Fibb",
            "description": "test invoice generated by node2",
            "expiry": "0xe10",
            "final_cltv": "0x28",
            "payment_preimage": "0x9e3e57b5a3a618716c3e08a37e40151a26292ef9d027e25af352fa2cbc023f09",
            "hash_algorithm": "sha256"
        }
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"invoice_address": "fibb10000001pms3acfz8kxgfw0pnm6vkn92j5dvwn03k99cgcrp4y52ru8yf0umj8uyn4nr7ehc78szslh680d8djttlzqhpnx9swhydags0xa53jp72wupwl4vftmu3vnecr3qfcfk06xwklla3gsx568ez66lrz5kqtmg3y28jcckpfzyldnrz9quxs8g89tlqx5fmywczvn0req65rwrdcw0aaeywvxrxq3jfnxxjzkajlthu3pzvmadzn2lccj9c7mx2ctgqwppjz0ej7n32sx2ggqnl7rmm7pv3ydhakgxfc8m2upc4nma5j9st2hukwdvsc3vkzruej5a0egkxe6v2gu45trtzg7y5z20s3aw54m9flp7xnwcjwpcgqgh2n4m", "invoice": {"currency": "Fibb", "amount": "0xf4240", "signature": "060a080800131f1e031b1b1e010c11040d171d1608060918071b0a1c011815131b1d141205100b0a171c160e0d0c1018110c1602031c1912141d0f19081606191a0c0a081c15140b030b02081e0414020a0f10111d0e14151b05091f011e06130e18120e01180800", "data": {"timestamp": "0x192bed0406f", "payment_hash": "0xb4bd3bc56cf72abfbe7576b205bb46c2c7beb70cf23e81a76a4ea84b4c0c22fc", "attrs": [{"Description": "test invoice generated by node2"}, {"ExpiryTime": {"secs": 3600, "nanos": 0}}, {"FinalHtlcMinimumCltvExpiry": 40}, {"HashAlgorithm": "sha256"}, {"PayeePublicKey": "03be13f4c66bb17238723b27e08b5d19dfcd79340e6833b2891f533f01e87b2733"}]}}}, "id": 42}
curl --location 'http://127.0.0.1:8231' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "send_payment",
    "params": [
        {
            "invoice": "fibb10000001pms3acfz8kxgfw0pnm6vkn92j5dvwn03k99cgcrp4y52ru8yf0umj8uyn4nr7ehc78szslh680d8djttlzqhpnx9swhydags0xa53jp72wupwl4vftmu3vnecr3qfcfk06xwklla3gsx568ez66lrz5kqtmg3y28jcckpfzyldnrz9quxs8g89tlqx5fmywczvn0req65rwrdcw0aaeywvxrxq3jfnxxjzkajlthu3pzvmadzn2lccj9c7mx2ctgqwppjz0ej7n32sx2ggqnl7rmm7pv3ydhakgxfc8m2upc4nma5j9st2hukwdvsc3vkzruej5a0egkxe6v2gu45trtzg7y5z20s3aw54m9flp7xnwcjwpcgqgh2n4m",
            "max_fee_amount": "0x174876e800"
        }
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"payment_hash": "0xb4bd3bc56cf72abfbe7576b205bb46c2c7beb70cf23e81a76a4ea84b4c0c22fc", "status": "Inflight", "created_at": "0x192bed04463", "last_updated_at": "0x625395d8b92ca", "failed_error": null}, "id": 42}
curl --location 'http://127.0.0.1:8231' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "get_payment",
    "params": [
        {
            "payment_hash": "0xb4bd3bc56cf72abfbe7576b205bb46c2c7beb70cf23e81a76a4ea84b4c0c22fc"
        }
    ]
}'
response:
{"jsonrpc": "2.0", "result": {"payment_hash": "0xb4bd3bc56cf72abfbe7576b205bb46c2c7beb70cf23e81a76a4ea84b4c0c22fc", "status": "Failed", "created_at": "0x192bed04463", "last_updated_at": "0x625395d8dc3b7", "failed_error": "FeeInsufficient"}, "id": 42}

node2 log: node.log err log

  2024-10-24T13:56:02.038657Z ERROR fnn::fiber::channel: No preimage found for payment hash: Hash256(0xb4bd3bc56cf72abfbe7576b205bb46c2c7beb70cf23e81a76a4ea84b4c0c22fc)
  2024-10-24T13:56:13.058417Z ERROR fnn::fiber::channel: too low forward_fee: 1000000, expected_fee: 1000001
  2024-10-24T13:56:13.058435Z ERROR fnn::fiber::channel: Error handling AddTlc message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.058530Z ERROR fnn::fiber::channel: Error while processing channel message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.064976Z ERROR fnn::fiber::channel: Error while processing channel message: Musig2VerifyError(BadSignature)
  2024-10-24T13:56:13.094497Z ERROR fnn::fiber::channel: too low forward_fee: 1000000, expected_fee: 1000001
  2024-10-24T13:56:13.094508Z ERROR fnn::fiber::channel: Error handling AddTlc message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.094585Z ERROR fnn::fiber::channel: Error while processing channel message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.099742Z ERROR fnn::fiber::channel: Error while processing channel message: Musig2VerifyError(BadSignature)
  2024-10-24T13:56:13.125410Z ERROR fnn::fiber::channel: too low forward_fee: 1000000, expected_fee: 1000001
  2024-10-24T13:56:13.125423Z ERROR fnn::fiber::channel: Error handling AddTlc message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.125496Z ERROR fnn::fiber::channel: Error while processing channel message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.130267Z ERROR fnn::fiber::channel: Error while processing channel message: Musig2VerifyError(BadSignature)
  2024-10-24T13:56:13.159416Z ERROR fnn::fiber::channel: too low forward_fee: 1000000, expected_fee: 1000001
  2024-10-24T13:56:13.159428Z ERROR fnn::fiber::channel: Error handling AddTlc message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.159506Z ERROR fnn::fiber::channel: Error while processing channel message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.164439Z ERROR fnn::fiber::channel: Error while processing channel message: Musig2VerifyError(BadSignature)
  2024-10-24T13:56:13.191533Z ERROR fnn::fiber::channel: too low forward_fee: 1000000, expected_fee: 1000001
  2024-10-24T13:56:13.191543Z ERROR fnn::fiber::channel: Error handling AddTlc message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.191612Z ERROR fnn::fiber::channel: Error while processing channel message: TlcForwardFeeIsTooLow
  2024-10-24T13:56:13.196523Z ERROR fnn::fiber::channel: Error while processing channel message: Musig2VerifyError(BadSignature)

excepted : if tlc_fee_proportional_millionths can't > 1000000 , will cause send_payment must failed ,could return err when open_channel with set tlc_fee_proportional_millionths > 1000000