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

Missing CellDeps in the transactions displayed by Explorer #319

Closed
Flouse opened this issue May 12, 2023 · 7 comments
Closed

Missing CellDeps in the transactions displayed by Explorer #319

Flouse opened this issue May 12, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Flouse
Copy link

Flouse commented May 12, 2023

image
https://explorer.nervos.org/transaction/0x6fca12453f33534f005d0fd0d727129076bdbebfe8ddfd0d30b9d020d373fb4e

curl https: //mainnet.ckb.dev/rpc -X POST -H "Content-Type: application/json" -d '{"id": 2, "jsonrpc": "2.0", "method": "get_transaction", "params": ["0x6fca12453f33534f005d0fd0d727129076bdbebfe8ddfd0d30b9d020d373fb4e"]}'

Result

{
    "jsonrpc": "2.0",
    "result": {
        "cycles": "0x48413a",
        "transaction": {
            "cell_deps": [
                {
                    "dep_type": "code",
                    "out_point": {
                        "index": "0x0",
                        "tx_hash": "0xd891e0e8c4864c730cc4b96b450ed1bcaf42e74c9eb1a38fb193caaf490f9a3d"
                    }
                },
                {
                    "dep_type": "code",
                    "out_point": {
                        "index": "0x0",
                        "tx_hash": "0x9f8e73e096f1583696760281004d71dc0cebd3c9aa6fb584949facde6e543e67"
                    }
                },
                {
                    "dep_type": "code",
                    "out_point": {
                        "index": "0x0",
                        "tx_hash": "0x625696834db4320214a8af09de74fd51fc8a83be69d920243f8ccd219071473b"
                    }
                },
                {
                    "dep_type": "code",
                    "out_point": {
                        "index": "0x0",
                        "tx_hash": "0x2e46a10a67987594d4eaee2d5f9ac96ce651f7bfb44e82c286a12a1950ad4f29"
                    }
                },
                {
                    "dep_type": "dep_group",
                    "out_point": {
                        "index": "0x0",
                        "tx_hash": "0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c"
                    }
                }
            ],
            "hash": "0x6fca12453f33534f005d0fd0d727129076bdbebfe8ddfd0d30b9d020d373fb4e",
            "header_deps": [],
            "inputs": [
                {
                    "previous_output": {
                        "index": "0x0",
                        "tx_hash": "0x278ecd52eb9772feec0f048df4a27346f356e24ecad19ebb56b39decc1a2390c"
                    },
                    "since": "0x40000000645df6ce"
                },
                {
                    "previous_output": {
                        "index": "0x1",
                        "tx_hash": "0x278ecd52eb9772feec0f048df4a27346f356e24ecad19ebb56b39decc1a2390c"
                    },
                    "since": "0x0"
                },
                {
                    "previous_output": {
                        "index": "0x2",
                        "tx_hash": "0x278ecd52eb9772feec0f048df4a27346f356e24ecad19ebb56b39decc1a2390c"
                    },
                    "since": "0x0"
                }
            ],
            "outputs": [
                {
                    "capacity": "0x7676d7e00",
                    "lock": {
                        "args": "0x0075c62406c6b180d8ffe96400d7f08e6e89d186dc00",
                        "code_hash": "0xa4398768d87bd17aea1361edc3accd6a0117774dc4ebc813bfa173e8ac0d086d",
                        "hash_type": "type"
                    },
                    "type": {
                        "args": "0xab21bfe2bf85927bb42faaf3006a355222e24d5ea1d4dec0e62f53a8e0c04690",
                        "code_hash": "0xfef1d086d9f74d143c60bf03bd04bab29200dbf484c801c72774f2056d4c6718",
                        "hash_type": "type"
                    }
                },
                {
                    "capacity": "0xdf8475800",
                    "lock": {
                        "args": "0x1ca35cb5fda4bd542e71d94a6d5f4c0d255d6d6fba73c41cf45d2693e59b307280d6acef972db4688408a5e196f92eb0457ca003d9aa1c45ff05056b429b353935b3080000000000",
                        "code_hash": "0xb619184ab9142c51b0ee75f4e24bcec3d077eefe513115bad68836d06738fd2c",
                        "hash_type": "type"
                    },
                    "type": null
                },
                {
                    "capacity": "0x65389a57b1",
                    "lock": {
                        "args": "0x75c62406c6b180d8ffe96400d7f08e6e89d186dc",
                        "code_hash": "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8",
                        "hash_type": "type"
                    },
                    "type": null
                }
            ],
            "outputs_data": [
                "0xd6eea74bbbde42287e71e5831f6869d06c3f9711af2f5001546e71f808e69a0d620da6616be23aef1f6e5418cfdcdceb8ee1c07b17593b7baf7c5a65bb314cd0802f00007cd4fcaa4b9828164cdf37fa9d2eb5109def7effc20ec392b8fa2a40fbb244de36b30800000000000000000000000000000000000000000000000000000000000000000000000000c166b3020367ca811aa5977a601a616fefd5a2ce6907d9b943d2a6cd3dd683be48120c0f8801000095710800000000000001",
                "0x",
                "0x"
            ],
            "version": "0x0",
            "witnesses": [
                "0x62030000100000006900000069000000550000005500000010000000550000005500000041000000de00ca39a47836ecb852f9ae52ed637d45763c13569d4438040b485ac8af7a4945cadcd5433da6dc37ec7d04b1166ba7a27eefc9171ca69da75c3b670202147001f502000000000000f102000010000000e9020000ed020000d90200001c0000006c010000700100007401000078010000d5020000500100002c000000340000005400000074000000940000009c000000c0000000e4000000e80000000c01000035b30800000000001c0000000200000014000000b8cde090e6a4741b6450308fad1dc338c53936a0328453a080af02758d1bb19266b1a1b9649c4dcababae5ac2eead97ea855f99880d6acef972db4688408a5e196f92eb0457ca003d9aa1c45ff05056b429b353948120c0f88010000620da6616be23aef1f6e5418cfdcdceb8ee1c07b17593b7baf7c5a65bb314cd0802f0000620da6616be23aef1f6e5418cfdcdceb8ee1c07b17593b7baf7c5a65bb314cd0802f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cbf25fb0e16cef5b9e7f0131b525477027e60350e3d1fdb82e8593d864b7058b000000000000000004000000590100004c50328453a080af02758d1bb19266b1a1b9649c4dcababae5ac2eead97ea855f9984f0150dcefc453c8cef430c14898779f8363816aa32454b786d096125b8af6c51f44b64f015024961ad381696ba7b43a6725d9aa08dffb9ea4aa149ecc575406a47f5b5fcf5350723c371ce0a431605342352d384c72de0342dda6e8cb93687e81a1f3e9c3330c4f025061a7970ebc7ec18d8ac6d4965e9a8861227e45bce3914bc0e87daddec3e62851505e20e641d8f4c0631776615eeddbf7d576fb8f2a6b2cfb0d8d6ca380095b975e4f02500c02a09ecf564eebd55687178b827ddb69423fd97ec71e26f454504f32dc6162501aee81bafc945454f5d7f8a8cc7093e300a6f5cc40006819b532951e1a80ccbf4f015072f9272681bc40248ac30f3ded27b091745aa31b62c6f3176d3960ebe850d6994f0350411eab1064d253d57150e0018e37d6bd30f0730427796fe14163fdaba0a920fe4fec040000000000000000000000",
                "0x10000000100000001000000010000000",
                "0x5500000010000000550000005500000041000000a30a8b5997dd91c69c4c9383b41d577c86211dfd3ba40c806a0863c5c603bb5331b200427f09f95216cfa03d0c5def3906f23ff063090fb7549763a4f0e1105a01"
            ]
        },
        "tx_status": {
            "block_hash": "0xc1315f5304d5d4247217885df4a425a6beb90252a64758c81117cfa65849f6ed",
            "reason": null,
            "status": "committed"
        }
    },
    "id": 2
}
@Flouse Flouse changed the title Missing CellDeps in the transactions showed by Explorer Missing CellDeps in the transactions displayed by Explorer May 12, 2023
@Keith-CY
Copy link
Member

Seems that cell deps in all transactions are lost, possibly a bug of the new sync mechanism that is not found in staging environment

@Keith-CY Keith-CY added the bug Something isn't working label May 12, 2023
@Keith-CY
Copy link
Member

Keith-CY commented May 12, 2023

This issue has been fixed by nervosnetwork/ckb-explorer#1277 but the reason is not mentioned in PR message.
Please add a brief explanation in this issue so we can track the code in the future @ShiningRay

@ShiningRay
Copy link
Contributor

The returning object of to_h method of Transaction object from CKB SDK is hash with symbol keys, and the old cell_deps field has string keys, so the processing method did not find correct cell deps info before. And now is fixed

@Keith-CY Keith-CY reopened this Aug 16, 2023
@Keith-CY
Copy link
Member

Cell Deps are lost in many transactions.

For instance, block 9840000 has 3 transactions.

Transaction 0xc601470aff46ce3b498ecc314641f686abfaf5ab8b79e39b3a01022251069389
shows:

  • 0 cell deps
  • 1 header deps

image

It's expected to have 23 cell deps and 1 header deps
image

Transaction 0x52398c370ab42eadb5e648e589b9bedf7a4e3d4f4e026524ddcb9960f7366c80
shows:

  • 0 cell deps
  • 0 header deps

It's expected to have 3 cell deps

image

So the header deps are synced correctly but cell deps are lost

@Danie0918 Danie0918 assigned rabbitz and unassigned ShiningRay and FrederLu Aug 16, 2023
@rabbitz
Copy link

rabbitz commented Aug 16, 2023

Transactions after 0xc601470aff46ce3b498ecc314641f686abfaf5ab8b79e39b3a01022251069389 missing data for cell_dependencies fixed.

https://github.com/nervosnetwork/ckb-explorer/blob/master/app/models/deployed_cell.rb#L26

DeployedCell.create_initial_data(ckb_transaction_id)

@Keith-CY
Copy link
Member

How is it going

@rabbitz
Copy link

rabbitz commented Aug 17, 2023

The transactions missing cell deps before 0xc601470aff46ce3b498ecc314641f686abfaf5ab8b79e39b3a01022251069389 (24 items) have been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

5 participants