stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Log analysis tool

Open obycode opened this issue 1 year ago • 3 comments

From various times debugging issues in our naka-1 testnet, I've found that it could be useful to have a tool to help me comb through the logs to figure out what is going on. This tool would take in a log file (text) and generate a sequence diagram showing the various activities of Bitcoin, the Stacks miner, and the signers. For starters, something like this could be helpful:

sequenceDiagram
    participant bitcoin
    participant miner
    participant signer
    bitcoin->>miner: Burn block 7635, winner commits to 95107
    miner->>signer: Propose block 95107
    miner->>bitcoin: Submit block commit, committing to 95107
    signer->>miner: Request block validation
    miner->>signer: Block validated
    signer-xminer: Block signed
    bitcoin->>miner: Burn block 7636, winner commits to 95107

obycode avatar Jun 28 '24 20:06 obycode

Most of the useful information is directly in a single log, but some of it would need to be accumulated (e.g. identifying the block that a block-commit is confirming).

obycode avatar Jun 28 '24 20:06 obycode

This example is using mermaid.

obycode avatar Jun 28 '24 20:06 obycode

Somehow adding timestamps would be very helpful, both to understand the timing between events, and to map back into the logs.

obycode avatar Jun 28 '24 20:06 obycode

I have completed the setup of the tool, making it dev-friendly by updating its naming conventions, code structure, and documentation in the README. I believe this issue can be closed. If any specific needs arise in the future, I can make the necessary changes to the tool. Additionally, the steps to follow are straightforward, so others can easily make modifications as needed.

The tool can be found here https://github.com/hirosystems/log-analysis-tool. If there is anything else needed to finish the tool setup, please let me know.

ASuciuX avatar Aug 03 '24 17:08 ASuciuX

Thanks @ASuciuX.

obycode avatar Aug 05 '24 13:08 obycode

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

blockstack-devops avatar Oct 26 '24 00:10 blockstack-devops