Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[graph_channels] funding_tx_index is wrong #254

Open
gpBlockchain opened this issue Oct 19, 2024 · 1 comment
Open

[graph_channels] funding_tx_index is wrong #254

gpBlockchain opened this issue Oct 19, 2024 · 1 comment

Comments

@gpBlockchain
Copy link
Contributor

funding_tx_index: 0x0, but tx_index is 0x1

curl --location 'http://127.0.0.1:8231' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "graph_channels",
    "params": [
        {
        }
    ]
}'
{"jsonrpc":"2.0","result":{"channels":[{"channel_outpoint":"0x0647f070650b6795379b4e570fd98c9584085d572a922f572c33add2311a7acd00000000","funding_tx_block_number":"0x36","funding_tx_index":"0x0","node1":"0215495bcfa1a2927ea98e2d0cd6ec09ca3aa058488dfef5693734114ff301375c","node2":"0384092f9a454e23e1965ea383ae99ce66540f8ce97fa8b9974c44071cb7a702b3","last_updated_timestamp":"0x192a572a9f8","created_timestamp":1729352608247,"node1_to_node2_fee_rate":"0x3e8","node2_to_node1_fee_rate":null,"capacity":"0x187e689c00","chain_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","udt_type_script":null}],"last_cursor":"0x600647f070650b6795379b4e570fd98c9584085d572a922f572c33add2311a7acd00000000"},"id":42}

curl --location 'http://127.0.0.1:8114' --header 'Content-Type: application/json' --data '{
    "id": 42,
    "jsonrpc": "2.0",
    "method": "get_transaction",
    "params": ["0x0647f070650b6795379b4e570fd98c9584085d572a922f572c33add2311a7acd"]
}'
{"jsonrpc":"2.0","result":{"cycles":"0x33bcfd","fee":null,"min_replace_fee":null,"time_added_to_pool":null,"transaction":{"cell_deps":[{"dep_type":"dep_group","out_point":{"index":"0x0","tx_hash":"0xa611f41952574b8a200465b2281d17bc1196a878e31f206857ee3d20925d5795"}}],"hash":"0x0647f070650b6795379b4e570fd98c9584085d572a922f572c33add2311a7acd","header_deps":[],"inputs":[{"previous_output":{"index":"0x1","tx_hash":"0x8486c152208e14eb0d32b0e245e1dc6bcd29d6d40e8ef83da8e159d737f18609"},"since":"0x0"},{"previous_output":{"index":"0xe","tx_hash":"0x8924295bde0c8224f3e7324729e70121d91bac34ca763b8fd283905feb75b9fa"},"since":"0x0"}],"outputs":[{"capacity":"0x187e689c00","lock":{"args":"0x91bfef443b8f9cae01404a373c99ce2546dcbaa0","code_hash":"0x03ae445d1bec9930ba5d9c77a0c2110c0f7e5fa504e7343dc13d9aaa8649cfcb","hash_type":"data1"},"type":null},{"capacity":"0x1bc16d160cc29427","lock":{"args":"0xc8328aabcd9b9e8e64fbc566c4385c3bdeb219d7","code_hash":"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8","hash_type":"type"},"type":null},{"capacity":"0x736f6310aa09da1","lock":{"args":"0x470dcdc5e44064909650113a274b3b36aecb6dc7","code_hash":"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8","hash_type":"type"},"type":null}],"outputs_data":["0x","0x","0x"],"version":"0x0","witnesses":["0x550000001000000055000000550000004100000087bc7d45b3c0b6217ac45fc234f008139881f221c02b86717998038501bef7a3053ae1973e3f01909c63277d283b454b4fa9dc0ce190d7949a97ce53379c1dc401","0x5500000010000000550000005500000041000000da152673c9ff6adbe9e2c2332781da45b75b914503b0e715eb451125fcb3c1ee0af780c0ea0d87feb0f25ffe52049c920cb74702fa6793f15da1abac37bca26701"]},"tx_status":{"block_hash":"0x660b3c305fcca8e5b14596953eddb8fe0c5044fc609c79b84099011adca80ff3","block_number":"0x36","reason":null,"status":"committed","tx_index":"0x1"}},"id":42}
@contrun
Copy link
Collaborator

contrun commented Oct 22, 2024

This is a known problem. We didn't return tx_index in the RPC until nervosnetwork/ckb#4583. I saved a "dummy" tx index (always 0) to the graph. The tx index was intended to be used by node while paginating channel information. Since we have already upgraded to 0.118 in #252 . We should be able to use real tx index now. But we need also to document our ckb node requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants