tari-project / universe

Other
8 stars 24 forks source link

feat: detect orphan chain #898

Open MCozhusheck opened 1 week ago

MCozhusheck commented 1 week ago

Description

Every 30 seconds fetch block from current tip minus 1000, 2000 and 3000 from both local node and text explorer and compares these 2. If they are different for just 1 case, send event to frontend which displays warning.

Motivation and Context

Some miners are stuck at orphan chains. This will check if it's a case for them and display information.

How Has This Been Tested?

Change condition to always return true in check_if_is_orphan_chain in node_manager.rs and check if alert under mining button is displayed.

Also replicated orphan chain by changing in experimental settings to not use tor and manually ban tcp peers in minotari node to make sure you are that there are no connected peers.

What process can a PR reviewer use to test or verify this change?

Same as above.

Breaking Changes

github-actions[bot] commented 1 week ago

⚠️ This PR contains unsigned commits. To get your PR merged, please sign those commits (git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch (git push --force-with-lease).

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with `gpg`: 1. [Generate a GPG key](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key) 2. [Add the GPG key to your GitHub account](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account) 3. [Configure `git` to use your GPG key for commit signing](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-gpg-key)
Sign commits with ssh-agent

Follow the steps below to set up commit signing with `ssh-agent`: 1. [Generate an SSH key and add it to `ssh-agent`](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) 2. [Add the SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account) 3. [Configure `git` to use your SSH key for commit signing](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key)
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process. Learn how to [use 1Password to sign your commits](https://developer.1password.com/docs/ssh/git-commit-signing/). Watch the demo
stringhandler commented 6 days ago

tested, but needs to be the other way around. It should read blocks from the explorer and see if they are in the current chain