platform icon indicating copy to clipboard operation
platform copied to clipboard

feat(dashmate): Add contract and block height data to `dashmate status` output

Open pshenmic opened this issue 3 years ago • 8 comments

Expected Behavior

Dashmate status command have info about block height data

Current Behavior

It does not show block height data

Possible Solution

Add block height data to the status command. Additionally, the fallback strategy for obtaining best block height should be implemented. Call to the external blockchain explorer is used in dashmate status for obtaining the correct chain for best block height and its used as truth of source. This call can fail, server may be down, or other reasons, and this leads to the command fail as well. Add fallback to the getchaintips dashcore RPC method and mark the information as the local by coloring it in yellow.

pshenmic avatar Sep 23 '22 10:09 pshenmic

Remote block height is currently broken in v24, because insight is answering too slow, shall we create another task for fallin back to getchaintips?

pshenmic avatar Apr 18 '23 17:04 pshenmic

Why it works in v0.23 then?

shumkov avatar Apr 19 '23 05:04 shumkov

Why it works in v0.23 then?

In v23 there is no client timeout implemented and it simply waits for the response and it can take ages to receive the answer (that is why status command is slow in v23). If the request dropped by timeout with server, the command will throw an error

pshenmic avatar Apr 19 '23 08:04 pshenmic

I'm not sure getchaintips will help us to indicate that node is not actually syncing. @strophy what do you think?

shumkov avatar Apr 19 '23 17:04 shumkov

getchaintips will usually show if a particular node has at least heard of nodes with a higher block height, but really we should treat insight (and a fallback) as a reliable external source of block height. We should diagnose why insight is replying slowly instead maybe, there has been an update there in the last few weeks.

strophy avatar May 02 '23 06:05 strophy

@strophy According to what you saying the fallback will confuse people because you don't know is it a view from outside or just vision of an isolated node.

shumkov avatar May 03 '23 04:05 shumkov

In the event of a chain fork, everyone will be trying to figure out if they are on an isolated network or if the insight/fallback data is incorrect because the remote source ended up on a chain fork. I think the best option here in the status command is to provide multiple clearly labeled block heights to help people diagnose errors quickly, and highlight our height in green if matches insight.

strophy avatar May 03 '23 05:05 strophy

Sounds good to me!

shumkov avatar May 03 '23 07:05 shumkov