helium / blockchain-etl

Blockchain follower that follows and stores the Helium blockchain
Apache License 2.0
64 stars 37 forks source link

Changes the online storage to match http #319

Closed madninja closed 2 years ago

madninja commented 2 years ago

The blockchain-http repo already had a workaround in place to return a hotpot status as online if the hotspots had any activity on chain.

This worked but would then not reflect in generated extracts or in city counts.

This PR updates the gateway_status.online column based on the same logic.. i.e.: A hotspot is online if it has any on chain activity in the last 36 hours of blocks (2160 blocks).

A side effect of this PR is that ARPs are no longer sent since we’re no longer interested in using the hotspot gossiped height as an indication of how far along it is. This is not a big deal except that listen_addresses are no longer updated as frequently which will no longer matter with light hotspots around the corner

madninja commented 2 years ago

The issue with this PR is that online is determined by "last_block" which is updated whenever the ledger changes for a given gateway which can happen for any number of non block activity reasons (like scale changes). This would cause the block the ledger changed state in to be associated with the gateway. This leads to unexpected last_block action by gateways.