polytope-labs / hyperbridge

Hyperbridge is a hyperscalable coprocessor for verifiable, cross-chain interoperability
https://docs.hyperbridge.network/
Apache License 2.0
104 stars 33 forks source link

Use child trie root as unique offchain identifier. #188

Closed Wizdave97 closed 4 months ago

Wizdave97 commented 4 months ago

Using the parent block hash as a unique idntifier for offchain keys is not sufficient for fork awareness because 1 block deep reorgs could still overwrite canonical keys.

This PR allows us to use the child trie root of pallet-ismp as the unique indentifier for offchain keys, this works because the child trie root is unique for any sequence of requests or responses dispatched in a block, if the sequences of requests or responses are identical in different forks we are not worried about the forks overwriting each other because both forks will yield the same result.

Wizdave97 commented 4 months ago

Hyperclient tests have passed multiple times, for some reason, it keeps restarting after every run. cancelling and merging. https://testnet.bscscan.com/tx/0xf4ad6e9533316dedbf6b2ca51ed83d9d1dbc83327d49198f6d1b37b0dcb59c34 https://sepolia-optimism.etherscan.io/tx/0xb9105100f6e01cb6d5a0fab47fc37cf3fe3ea0b861d4578f21f3870a8dd3b954