darwinia-network / bridger

Relayer client implementation for Darwinia LCMP protocols.
https://rust-docs.darwinia.network/bridger
GNU General Public License v3.0
12 stars 10 forks source link

Optimize subql bridge parachain #453

Closed fewensa closed 2 years ago

fewensa commented 2 years ago

Related: #449

query


query queryNeedRelayBlockPage {
  justificationMappings (
    first: 5
    orderBy: BLOCK_NUMBER_DESC
  ) {
    nodes {
      id
      blockNumber
      blockHash
      mandatory
      justification
    }
  }
  needRelayBlocks (
    first: 5
    orderBy: BLOCK_NUMBER_ASC
  ) {
    nodes {
      id
      blockNumber
      blockHash
      type
      origin
      laneId
      messageNonce
      timestamp
    }
  }
}

response

{
  "data": {
    "justificationMappings": {
      "nodes": [
        {
          "id": "1094519",
          "blockNumber": 1094519,
          "blockHash": "0x54f429c5a10222781a89a62d61ba2c501a266b6a85328f0b55a6652d50474a26",
          "mandatory": true,
          "justification": "0x200500000000000054f429c5a10222781a89a62d61ba2c501a266b6a85328f0b55a6652d50474a2677b310000c54f429c5a10222781a89a62d61ba2c501a266b6a85328f0b55a6652d50474a2677b3100005988192f02868246e153bb3610fc044682aa5161ff66a8f9b21dac983bf80e526ec9811b7f86dfc736b886e7eb021470dbc66b026b1511bc337f93ac9e9b10963e122d962a835020bef656ad5a80dbcc994bb48a659f1af955552f4b3c27b0954f429c5a10222781a89a62d61ba2c501a266b6a85328f0b55a6652d50474a2677b31000ee5002a77ffb8c17aad318e5a607f2604dad71ce65cec3317aacdf89ac88d748e93d47c12b2c7625b94740438e7eddcf10b70b10968458e1ef5c6916644d39028a50704f41448fca63f608575debb626639ac00ad151a1db08af1368be9ccb1d54f429c5a10222781a89a62d61ba2c501a266b6a85328f0b55a6652d50474a2677b310003abc9568897e5c0eae26a10721fe24f74db9427e2fb80d77a88f2dbd356e3fe8cae782f1b5299bb76e73ff78be4b58586b28fd897e2079120a261c7f41a8db0ab28fade2d023f08c0d5a131eac7d64a107a2660f22a0aca09b37a3f321259ef600"
        },
        {
          "id": "1094144",
          "blockNumber": 1094144,
          "blockHash": "0xad39ecfb44cf320eafe11d3ad357bca898fa9d3db201e78b068b810b2855385b",
          "mandatory": false,
          "justification": "0xfa02000000000000ad39ecfb44cf320eafe11d3ad357bca898fa9d3db201e78b068b810b2855385b00b210000cad39ecfb44cf320eafe11d3ad357bca898fa9d3db201e78b068b810b2855385b00b21000e25a0ec42bd0807f6ebb7a27983d3af54fd4cca9669bf0bc205170cd33d91d1411dfe37f25fc5696d937782a5ebeea735d2e14a060200bf23dd247e38dce560563e122d962a835020bef656ad5a80dbcc994bb48a659f1af955552f4b3c27b09ad39ecfb44cf320eafe11d3ad357bca898fa9d3db201e78b068b810b2855385b00b210009949dbeee008899754cf1d70ec634b3a418b056c1d5921e5071a211b6575f7f4062826cb28b4354e8edeb3374d28ee35f6d38eccb102804d15d4f8353bc1d2038a50704f41448fca63f608575debb626639ac00ad151a1db08af1368be9ccb1dad39ecfb44cf320eafe11d3ad357bca898fa9d3db201e78b068b810b2855385b00b210000a99188f4f1e2dcb8b9b543cca921f241ad831c731a50c1a74df5a5e42b50d9cd67f1c8826a05a4488addc4dab21de9093438a3090a61cc0e0b34cb831cae20cb28fade2d023f08c0d5a131eac7d64a107a2660f22a0aca09b37a3f321259ef600"
        },
        {
          "id": "1093632",
          "blockNumber": 1093632,
          "blockHash": "0xdb1d8762a69112ab95166de25ad70c795b3c88959beedd88627b13a9ddccc8cc",
          "mandatory": false,
          "justification": "0x0a00000000000000db1d8762a69112ab95166de25ad70c795b3c88959beedd88627b13a9ddccc8cc00b010000cdb1d8762a69112ab95166de25ad70c795b3c88959beedd88627b13a9ddccc8cc00b01000609d2cbc558a55126304bc63f2cd9efa38490cdaa99fec5662cd8b80c6e8aa12b38a2a41e59b456eea1184204bae1f596fcbdade0c37a6c01572a009a6bb040763e122d962a835020bef656ad5a80dbcc994bb48a659f1af955552f4b3c27b09db1d8762a69112ab95166de25ad70c795b3c88959beedd88627b13a9ddccc8cc00b01000ab39996b020acc62ff0dfab5854550e65b7ffc4b9dfeaf5ab88868a3c971aaf1219cd09871c4d4d24990984f8e15952b213a08ade50c1d1603123aba78ca27018a50704f41448fca63f608575debb626639ac00ad151a1db08af1368be9ccb1ddb1d8762a69112ab95166de25ad70c795b3c88959beedd88627b13a9ddccc8cc00b0100061b0ce54ca677604cba50f4e73ebd567e3510021918b7e083d83af4e02567e7f5d33bfe9ff7bb59670354c64f83146ddb2eadbc6a036c24514721d17c2a3be04b28fade2d023f08c0d5a131eac7d64a107a2660f22a0aca09b37a3f321259ef600"
        },
        {
          "id": "1093625",
          "blockNumber": 1093625,
          "blockHash": "0x5210a3e838c11e24f401981cb4e9291eabf9c4c47b62daf035f2566fe0dfcf58",
          "mandatory": true,
          "justification": "0x20050000000000005210a3e838c11e24f401981cb4e9291eabf9c4c47b62daf035f2566fe0dfcf58f9af10000c5210a3e838c11e24f401981cb4e9291eabf9c4c47b62daf035f2566fe0dfcf58f9af1000fbba267d3e50f392c77e2552f937a4de09abec09ad3467f6ad4df5005935c9676313c5adcc1dbd28405c9341af23ad331c4a5b94eb26cb2bb618bc66456fbf0063e122d962a835020bef656ad5a80dbcc994bb48a659f1af955552f4b3c27b095210a3e838c11e24f401981cb4e9291eabf9c4c47b62daf035f2566fe0dfcf58f9af1000cb96809bf9af8097901f2c76875c85d465f9290c7eeeb00ab1854e5d87ef2fac0e202bc4b9f76462d93865d38f332f81707af043ce7b3897b8063ba6cd74800d8a50704f41448fca63f608575debb626639ac00ad151a1db08af1368be9ccb1d5210a3e838c11e24f401981cb4e9291eabf9c4c47b62daf035f2566fe0dfcf58f9af1000eb2aaba94216c2bcea284b33c0a42c209513892b0ade259f3f94b5dbe0c54fe8ae1a81a8743d8fd07b62e3993e9b70ceb28c44a590e87ce0a4efcd8f29f18808b28fade2d023f08c0d5a131eac7d64a107a2660f22a0aca09b37a3f321259ef600"
        },
        {
          "id": "1093120",
          "blockNumber": 1093120,
          "blockHash": "0xc3fcbf8e08e2b15d8039b08c1c348e5dc6d9adedbeb789446416e367b22bb619",
          "mandatory": false,
          "justification": "0x3d02000000000000c3fcbf8e08e2b15d8039b08c1c348e5dc6d9adedbeb789446416e367b22bb61900ae10000cc3fcbf8e08e2b15d8039b08c1c348e5dc6d9adedbeb789446416e367b22bb61900ae10001d81af12edb25e225ce5a317ad1c161f633636476dd963b15de50b6fd2dfb5bcc41726cc652a5ff5e6f061b1a19cecc1ddc07189dc12ed6c4fd2b1bf7066700a63e122d962a835020bef656ad5a80dbcc994bb48a659f1af955552f4b3c27b09c3fcbf8e08e2b15d8039b08c1c348e5dc6d9adedbeb789446416e367b22bb61900ae10002065fbf5cb2b18271d7219e5d52bde2f921c6b54ea06071f5c486787d07c2c73c10ae57788819657d6ac4e9b85df7119dc571dc2ab071f6f69ce40186fef3e078a50704f41448fca63f608575debb626639ac00ad151a1db08af1368be9ccb1dc3fcbf8e08e2b15d8039b08c1c348e5dc6d9adedbeb789446416e367b22bb61900ae1000f2a3e869796bef100049b21aabc1bff69bb31267a502d8fc05ecf04f09922b4119d6512eb34dc8e9393b5ede80d0f71e8371d12a22b8514e38c486e642fb570ab28fade2d023f08c0d5a131eac7d64a107a2660f22a0aca09b37a3f321259ef600"
        }
      ]
    },
    "needRelayBlocks": {
      "nodes": [
        {
          "id": "1093625-5",
          "blockNumber": 1093625,
          "blockHash": "0x5210a3e838c11e24f401981cb4e9291eabf9c4c47b62daf035f2566fe0dfcf58",
          "type": "mandatory",
          "origin": "mandatory",
          "laneId": null,
          "messageNonce": null,
          "timestamp": "2022-02-14T04:36:36.001"
        },
        {
          "id": "1094519-6",
          "blockNumber": 1094519,
          "blockHash": "0x54f429c5a10222781a89a62d61ba2c501a266b6a85328f0b55a6652d50474a26",
          "type": "mandatory",
          "origin": "mandatory",
          "laneId": null,
          "messageNonce": null,
          "timestamp": "2022-02-14T06:06:36"
        }
      ]
    }
  }
}