nervosnetwork / fiber

21 stars 11 forks source link

[open_channel] open channel return panic in testnet #299

Closed gpBlockchain closed 3 weeks ago

gpBlockchain commented 3 weeks ago
curl --location 'http://127.0.0.1:8227' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "node_info",
    "params": [
        {

        }
    ]
}'

{"jsonrpc":"2.0","result":{"version":"0.1.0","commit_hash":"b92120b-modified","public_key":"03c314b83e9850c0d0a22e0c63a75b451e33447ab15c5f89fc47da5f978ac734f0","node_name":null,"peer_id":"QmY8dEogQ4GK2KwZLmrtnJLULAuWuE8yPDqzegMjD7LmM7","addresses":["/ip4/127.0.0.1/tcp/8228/p2p/QmY8dEogQ4GK2KwZLmrtnJLULAuWuE8yPDqzegMjD7LmM7"],"chain_hash":"0x10639e0895502b5688a6be8cf69460d76541bfa4821629d86d62ba0aae3f9606","open_channel_auto_accept_min_ckb_funding_amount":"0x3c5986200","auto_accept_channel_ckb_funding_amount":"0x1718c7e00","tlc_expiry_delta":"0x5265c00","tlc_min_value":"0x0","tlc_max_value":"0x0","tlc_fee_proportional_millionths":"0x3e8","channel_count":"0x0","pending_channel_count":"0x0","peers_count":"0x3","network_sync_status":"Done","udt_cfg_infos":[{"name":"RUSD","script":{"code_hash":"0x1142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a","hash_type":"type","args":"0x878fcc6f1f08d48e87bb1c3b3d5083f23f8a39c5d5c764f253b55b998526439b"},"auto_accept_amount":"0x2540be400","cell_deps":[{"dep_type":"code","tx_hash":"0xed7d65b9ad3d99657e37c4285d585fea8a5fcaf58165d54dacf90243f911548b","index":"0x0"}]}]},"id":42}%                                        guopenglin@192 demo % 
curl --location 'http://127.0.0.1:8227' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "open_channel",
    "params": [
        {
            "peer_id": "QmS8y8sAoF7DH89st7fquUVW9Y1W3cgcnPgWjPe6tcm1dw",
            "funding_amount": "0x5f5e100",
            "public": true,
            "funding_udt_type_script": {
                "code_hash": "0x1142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a",
                "hash_type": "type",
                "args": "0x878fcc6f1f08d48e87bb1c3b3d5083f23f8a39c5d5c764f253b55b998526439b"
            }
        }
    ]
}'
curl: (52) Empty reply from server
  2024-10-31T10:26:12.624693Z  INFO fnn::fiber::channel: Trying to open a channel to PeerId(QmS8y8sAoF7DH89st7fquUVW9Y1W3cgcnPgWjPe6tcm1dw)
    at src/fiber/channel.rs:1695
    in ractor::actor::Actor with id: "0.7", name: "Channel-0 QmY8dEogQ4GK2KwZLmrtnJLULAuWuE8yPDqzegMjD7LmM7 <-> QmS8y8sAoF7DH89st7fquUVW9Y1W3cgcnPgWjPe6tcm1dw"
    in ractor::actor::Actor with id: "0.2", name: "Network QmY8dEogQ4GK2KwZLmrtnJLULAuWuE8yPDqzegMjD7LmM7"

  2024-10-31T10:26:12.625477Z DEBUG fnn::fiber::fee: calculate_commitment_tx_fee: 1000 udt_script: Some(Script(0x550000001000000030000000310000001142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a0120000000878fcc6f1f08d48e87bb1c3b3d5083f23f8a39c5d5c764f253b55b998526439b))
    at src/fiber/fee.rs:102
    in ractor::actor::Actor with id: "0.7", name: "Channel-0 QmY8dEogQ4GK2KwZLmrtnJLULAuWuE8yPDqzegMjD7LmM7 <-> QmS8y8sAoF7DH89st7fquUVW9Y1W3cgcnPgWjPe6tcm1dw"
    in ractor::actor::Actor with id: "0.2", name: "Network QmY8dEogQ4GK2KwZLmrtnJLULAuWuE8yPDqzegMjD7LmM7"

thread 'tokio-runtime-worker' panicked at src/ckb/contracts.rs:183:32:
Contract CommitmentLock exists
gpBlockchain commented 3 weeks ago

script should add

    - name: FundingLock
      script:
        code_hash: 0x6c67887fe201ee0c7853f1682c0b77c0e6214044c156c7558269390a8afa6d7c
        hash_type: type
        args: 0x
      cell_deps:
        - out_point:
            tx_hash: 0x89af398edc7ed0054506b33349b031097d94378e11e77bf0690ee69d82623a43
            index: 0x0
          dep_type: code
        - out_point:
            tx_hash: 0xbfd6d68b328a02606f1f65ee0f79f8ed5f76dfe86998c7aaa9ee4720d53f4c49 # ckb_auth
            index: 0x0
          dep_type: code
    - name: CommitmentLock
      script:
        code_hash: 0x740dee83f87c6f309824d8fd3fbdd3c8380ee6fc9acc90b1a748438afcdf81d8
        hash_type: type
        args: 0x
      cell_deps:
        - out_point:
            tx_hash: 0x89af398edc7ed0054506b33349b031097d94378e11e77bf0690ee69d82623a43
            index: 0x1
          dep_type: code
        - out_point:
            tx_hash: 0xbfd6d68b328a02606f1f65ee0f79f8ed5f76dfe86998c7aaa9ee4720d53f4c49 #ckb_auth
            index: 0x0
          dep_type: code