Near-One / rainbow-bridge

🌈🌈🌈 NEAR <> Ethereum Decentralized Bridge
GNU General Public License v3.0
326 stars 100 forks source link

Update Near chain height metric more frequently #538

Open mfornet opened 3 years ago

mfornet commented 3 years ago

Near chain height is being updated every delay seconds by the near2eth relayer. Since this relayer in mainnet is only submitting new blocks every 12 hours the chain height is almost meaningless. To fix this problem we need to update this value more frequently. To avoid increasing the complexity of the near2eth relayer we can report this metric from the address-watcher service.

Action Items

mfornet commented 3 years ago

We got this error:

5|near2eth-relay  | 2021-03-17 14:13:58.061: Error Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!
5|near2eth-relay  | 2021-03-17 14:13:58.061:     at Object.TransactionError (/home/ubuntu/rainbow-bridge/node_modules/web3-core-helpers/src/errors.js:63:21)
5|near2eth-relay  | 2021-03-17 14:13:58.061:     at /home/ubuntu/rainbow-bridge/node_modules/web3-core-method/src/index.js:485:40
5|near2eth-relay  | 2021-03-17 14:13:58.061:     at runMicrotasks (<anonymous>)
5|near2eth-relay  | 2021-03-17 14:13:58.061:     at processTicksAndRejections (node:internal/process/task_queues:93:5) {
5|near2eth-relay  | 2021-03-17 14:13:58.061:   receipt: undefined
5|near2eth-relay  | 2021-03-17 14:13:58.061: }

A block was relayed, but it took more than 750 seconds to be mined. The relayer failed, and due to this reason, client heigh was not updated. A few minutes later the transaction was mined but the relayer didn't update the client height. This value is currently used for monitoring and alerts in the bridge. We should as well compute and export this metrics in a separate service other than near2eth relayer.

A fix needs to be implemented for the robustness issue. Tracking in #544