AmbireTech / adex-market

AdEx Market: a scraper that aggregates ad campaign information from the validator network
7 stars 6 forks source link

Fix: isDisconnected Implementation #8

Closed samparsky closed 5 years ago

samparsky commented 5 years ago

There is an issue with the way isDisconnected is implemented. https://github.com/AdExNetwork/adex-market/blob/master/lib/getStatus.js#L54 it does a util.isDeepStrictEqual(h1, h2) but the signatures & timestamp on the messages would be different

hence the channel would return disconnected

An approach would be to get the leader propagated heartbeat messages from the follower and then do length comparison and check if the difference is within the allowed difference. And the same for the follower from the leader.

Ivshti commented 5 years ago

the idea is to check whether the follower has the leader's messages or vice versa

so comparing the signatures would be correct