darwinia-network / dj

Darwinia bridge relayer tool implemented in nodejs
GNU General Public License v3.0
4 stars 5 forks source link

Why dj continue to submit proposal 8647971 after it has already been included in relayer game #84

Closed hackfisher closed 3 years ago

hackfisher commented 3 years ago
~ % dj
2020-09-15 18:47:02        API/INIT: RPC methods not decorated: balances_usableBalance, headerMMR_genProof, staking_powerOf
Unable to resolve type Status, it will fail on construction
Unable to resolve type MappedRing, it will fail on construction
Unknown signed extensions CheckEthereumRelayHeaderHash found, treating them as no-effect
Unknown signed extensions CheckEthereumRelayHeaderHash found, treating them as no-effect
Unknown types found, no types for MappedRing, Status
[ info ]: Current account: 5E9Tbd7pyT764bDNkWgRPePY7igognkmy943Ud5vBhUFTBgN
[ info ]: Current balance: {
  "free": "10.114k CRING",
  "reserved": "0",
  "free_kton": "0",
  "reserved_kton": "0"
}
[ info ]: Currently we have 9 txs are waiting to be redeemed
[ event ]: Fetching proposal of 8647971
[ event ]: Submit proposal contains block 8647971
[ info ]: Transaction status: Ready
[ info ]: Ready
[ info ]: Transaction status: Broadcast
[ info ]: {"Broadcast":["12D3KooWPNX5qzF4wbBU91ChPiNACziqMaCxH8kpE86Zg6cJTuvH","12D3KooWPiza2NAD6CjdBGtfUd3pfDnZXysYKzumejGHafW3Y8xP","12D3KooWGs9f2haWSvwNyr1mYzdN5bEa3mgNFZUa4GFpgmaYv3fQ","12D3KooWDz57M5euYyqdrazkWoxQ9jp3iyqSCE3FWrghND8M2zkN","12D3KooW9sjm3usL1YiooAZKJXyDmPcGKXEHKWmTALvBgNipNGB1","12D3KooWN3L4itdJg6xePfoQyxtPqjtWgNaDixXoVzZsscYp5WVs","12D3KooWBqRteESYYDJ6FkvQ9qkm8pLJk6scZVL3BJ95tT5PeKqS","12D3KooWPC3wN128vXgYiE4WGNW8fDBgmhSWcyprNT2d9fFMSXMH","12D3KooWL1YoofbK8jZa69h5vqnaTupxxcDNk1QEMmYB7PyuhKqu","12D3KooWJek4iRykbT6Zek4XfPBVyUBnWU3C3qViLKsg63jVRMmD","12D3KooWPRw3Z9qXfibw6ucUkyeRvS6oCMda5213Tx1zrtZNZp5J","12D3KooWMYVT9UGFESCqFwhoetFpF1Um5gE4uwf4g7zWr2i7m15X","12D3KooWBVFqkKjAZFensemUZjJJk81rp9pxcUAxjnr1HVWCb2Zb","12D3KooWC3ioqsjEdPh8DCEL4mV6J1HzUjPY9VpJG54Di2K8h9wo","12D3KooWMyQb9GYR8xcE9AAbgncTMA41JofNQ4v2cz6TtV8niQod","12D3KooWJCfwFqCFfWkw45PqVtfUxw81nbDXpAuQ6eQLRCh49rLB","12D3KooWEUnpoYMbBZThCuZcyvngjP1toh7nBtm9ThZ8t6TPZUAB","12D3KooWGzMWK5UxU6cLutckBSYBqxDaAwpKrSAM25rdU54D1uUd","12D3KooWKNxhkfuUCjdMCX9Ud3YQgdzj9s3LPYkoszmCzBPoCrcT","12D3KooWCk63SN37bvN5ZtEH5CD5iBCD3SUXodA4v74Jj32syZAY","12D3KooWLxxU7F4WhGijR9uTK73z8QvGgavvaV8d2BvKpXNqAzLf","12D3KooWS8h2Wnep21tHU7DZkwNAwBJX5j8c19JiJYDFph5WUG1D","12D3KooWFqHZkyv6iabxxqiHdNjWb4c7EfmBqMNCyqLCCVZm8yyQ","12D3KooWQsVLHqUL3iGAN72Qw4SWEHfMrWekUdA7rctwU5JU5gpZ","12D3KooWDXjxHayRC2Vmc3Cs7p4YMdQCpTs9dbAagvKv9vnhqpp9"]}
[ info ]: Transaction status: InBlock
[ info ]: {"InBlock":"0x37e4c0c1bc4d18e33aa6997bc1bf9a9fe9f79cbcf41ac58f72e4813ffb5bac09"}
[ info ]:   {"ApplyExtrinsic":2}: treasury.DepositRing[141144000000]
[ info ]:   {"ApplyExtrinsic":2}: balances.Deposit["5CRABQsXmCVNa756ZSezYEhwNx3XuGGGgj9B7AXDkbtSYYSs",35286000000]
[ info ]:   {"ApplyExtrinsic":2}: system.ExtrinsicSuccess[{"weight":0,"class":"Normal","paysFee":"Yes"}]
[ info ]: Transaction status: Finalized
[ info ]: {"Finalized":"0x37e4c0c1bc4d18e33aa6997bc1bf9a9fe9f79cbcf41ac58f72e4813ffb5bac09"}
[ info ]: Finalized block hash: 0x37e4c0c1bc4d18e33aa6997bc1bf9a9fe9f79cbcf41ac58f72e4813ffb5bac09
[ info ]: Currently we have 9 txs are waiting to be redeemed
[ event ]: Fetching proposal of 8647971
[ event ]: Submit proposal contains block 8647971
2020-09-15 18:49:28        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Custom error: 2
2020-09-15 18:49:28             DRR: Error: 1010: Invalid Transaction: Custom error: 2
    at RpcCoder._checkError (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/coder/index.js:85:13)
    at RpcCoder.decodeResponse (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/coder/index.js:48:10)
    at WsProvider.value (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/ws/Provider.js:213:90)
    at W3CWebSocket.value [as onmessage] (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/ws/Provider.js:193:153)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/denny/.config/yarn/global/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onMessage (/Users/denny/.config/yarn/global/node_modules/websocket/lib/W3CWebSocket.js:234:14)
    at WebSocketConnection.<anonymous> (/Users/denny/.config/yarn/global/node_modules/websocket/lib/W3CWebSocket.js:205:19)
    at WebSocketConnection.emit (events.js:314:20)
    at WebSocketConnection.processFrame (/Users/denny/.config/yarn/global/node_modules/websocket/lib/WebSocketConnection.js:554:26)
    at /Users/denny/.config/yarn/global/node_modules/websocket/lib/WebSocketConnection.js:323:40
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
2020-09-15 18:49:28        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Custom error: 2
(node:30379) UnhandledPromiseRejectionWarning: Error: 1010: Invalid Transaction: Custom error: 2
    at RpcCoder._checkError (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/coder/index.js:85:13)
    at RpcCoder.decodeResponse (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/coder/index.js:48:10)
    at WsProvider.value (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/ws/Provider.js:213:90)
    at W3CWebSocket.value [as onmessage] (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/ws/Provider.js:193:153)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/denny/.config/yarn/global/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onMessage (/Users/denny/.config/yarn/global/node_modules/websocket/lib/W3CWebSocket.js:234:14)
    at WebSocketConnection.<anonymous> (/Users/denny/.config/yarn/global/node_modules/websocket/lib/W3CWebSocket.js:205:19)
    at WebSocketConnection.emit (events.js:314:20)
    at WebSocketConnection.processFrame (/Users/denny/.config/yarn/global/node_modules/websocket/lib/WebSocketConnection.js:554:26)
    at /Users/denny/.config/yarn/global/node_modules/websocket/lib/WebSocketConnection.js:323:40
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:30379) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:30379) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[ info ]: Currently we have 9 txs are waiting to be redeemed
[ event ]: Fetching proposal of 8647971
[ event ]: Submit proposal contains block 8647971
2020-09-15 18:50:29        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Custom error: 2
2020-09-15 18:50:29             DRR: Error: 1010: Invalid Transaction: Custom error: 2
    at RpcCoder._checkError (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/coder/index.js:85:13)
    at RpcCoder.decodeResponse (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/coder/index.js:48:10)
    at WsProvider.value (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/ws/Provider.js:213:90)
    at W3CWebSocket.value [as onmessage] (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/ws/Provider.js:193:153)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/denny/.config/yarn/global/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onMessage (/Users/denny/.config/yarn/global/node_modules/websocket/lib/W3CWebSocket.js:234:14)
    at WebSocketConnection.<anonymous> (/Users/denny/.config/yarn/global/node_modules/websocket/lib/W3CWebSocket.js:205:19)
    at WebSocketConnection.emit (events.js:314:20)
    at WebSocketConnection.processFrame (/Users/denny/.config/yarn/global/node_modules/websocket/lib/WebSocketConnection.js:554:26)
    at /Users/denny/.config/yarn/global/node_modules/websocket/lib/WebSocketConnection.js:323:40
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
2020-09-15 18:50:29        RPC-CORE: submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus:: 1010: Invalid Transaction: Custom error: 2
(node:30379) UnhandledPromiseRejectionWarning: Error: 1010: Invalid Transaction: Custom error: 2
    at RpcCoder._checkError (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/coder/index.js:85:13)
    at RpcCoder.decodeResponse (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/coder/index.js:48:10)
    at WsProvider.value (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/ws/Provider.js:213:90)
    at W3CWebSocket.value [as onmessage] (/Users/denny/.config/yarn/global/node_modules/@polkadot/rpc-provider/ws/Provider.js:193:153)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/Users/denny/.config/yarn/global/node_modules/yaeti/lib/EventTarget.js:107:17)
    at W3CWebSocket.onMessage (/Users/denny/.config/yarn/global/node_modules/websocket/lib/W3CWebSocket.js:234:14)
    at WebSocketConnection.<anonymous> (/Users/denny/.config/yarn/global/node_modules/websocket/lib/W3CWebSocket.js:205:19)
    at WebSocketConnection.emit (events.js:314:20)
    at WebSocketConnection.processFrame (/Users/denny/.config/yarn/global/node_modules/websocket/lib/WebSocketConnection.js:554:26)
    at /Users/denny/.config/yarn/global/node_modules/websocket/lib/WebSocketConnection.js:323:40
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
(node:30379) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
^C
hackfisher commented 3 years ago

https://crab.subscan.io/extrinsic/1822387-2

clearloop commented 3 years ago

dj can not condition if a block is in the relayer game directly(save the proposed blocks from events is dirty), a possible optimization is to add a submitted proposal memory storage for the relay process, it could be contained in the next pr.

However, dj only checks if a block is confirmed before it submits a new proposal now.