darwinia-network / bridger

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

wrong sign_mmr_root status #159

Closed xiaoch05 closed 3 years ago

xiaoch05 commented 3 years ago

https://github.com/darwinia-network/bridger/blob/20a5a3acdbc71845be8a8b425ac0d55c865c4a9b/src/service/subscribe/mod.rs#L139

at block header.number, we may get the wrong status of the sign_mmr_root with a high probability, and then send extrinsic with error result. Instead, it may be better to use the latest block by None here.

wuminzhe commented 3 years ago

Why get the wrong status with a high probability?

xiaoch05 commented 3 years ago

have not caught the deep reason, I tried to remove the header.number, and it got the right status. I think the header.number is a critical point of the status change.

wuminzhe commented 3 years ago

if using None here, the result is not the result at that moment.

xiaoch05 commented 3 years ago

do we need the latest result or the result at that moment here? If the mmr root has been signed by all other authorities after that block. we should not sign again.

wuminzhe commented 3 years ago

I forget why this is added here. The original method is what you said, I will think about it.