Grinnode-live / 2020-grin-bug-bash-challenge

Finding bugs in Grin-Wallet & Grin-nodes for a bounty prior to Grin fork v5.
3 stars 1 forks source link

[GRIN-Node] - Full sync from scratch #14

Closed MCM-Mike closed 3 years ago

MCM-Mike commented 3 years ago

Description: Sync a GRIN-Node from scratch.

Prerequisites Start the most recent beta of GRIN-Node v5.0.0-beta.2 and wait until fully synced. (No archive mode)

Expected result: Should sync without any problems.

marekyggdrasil commented 3 years ago

I suggest to specify which version of the node, I suggest v5.0.0-beta.2 as this is the most recent one at the moment.

marekyggdrasil commented 3 years ago

I figured it would be also good to test macOS https://github.com/Grinnode-live/2020-grin-bug-bash-challenge/issues/38

goyle commented 3 years ago

I suggest to specify which version of the node, I suggest v5.0.0-beta.2 as this is the most recent one at the moment.

v5.0.0-beta.3 is the latest beta version now. Should that be the test?

stakervali commented 3 years ago

@goyle, Please present your test results for both the latest version: https://github.com/mimblewimble/grin/releases/tag/v5.0.0-rc.1 and the one before , which is: https://github.com/mimblewimble/grin/releases/tag/v5.0.0-beta.3

goyle commented 3 years ago

Running into some errors in Debian 10 that did not appear in Ubuntu 20.04.1 LTS. I will wait until the node fully syncs in Ubuntu.

MCM-Mike commented 3 years ago

Running into some errors in Debian 10 that did not appear in Ubuntu 20.04.1 LTS. I will wait until the node fully syncs in Ubuntu.

would it be possible to share the errors on Debian 10? If you would also try to test it additionally on Debian 10 I would recommend a free additional GRIN t-shirt from our t-shirt sponsor.

goyle commented 3 years ago

@MCM-Mike Thank you for the reward, but I found out the error might not be relevant as it is not purely from the Grin node but may be from my environment, which is virt-manager and qemu/kvm. It looks to be a strange edge case that impacts both Debian and Ubuntu. I ran the virtual machine disk image files stored on a secondary hard drive and resulted in a peers lock error in the node and couldn't sync at all for both Debian and Ubuntu distros. Once I recreate the disk image files using default storage on my main hard drive, the nodes were able to sync and build the chain. I can write more about this and list the steps if you find this error relevant.

Error snippet:


ERROR: grin_p2p::peers - connected_peers: failed to get peers lock
ERROR: grin_p2p::peers - connected_peers: failed to get peers lock
ERROR: grin_p2p::peers - connected_peers: failed to get peers lock
goyle commented 3 years ago

Grin Node v5.0.0-beta.3

Description

Sync a GRIN-Node from scratch. This test case will be for Debian 10.

System Information: Linux debian 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux \ Testing Environment: virt-manager and Qemu/KVM

Prerequisites

Grin node version will be v5.0.0-beta.3. Archive mode is disabled. Debug log is enabled.

Expected result

Should sync without any problems.

Steps

  1. Download grin v5.0.0-beta.3 and its sha256sum.
    $ wget https://github.com/mimblewimble/grin/releases/download/v5.0.0-beta.3/grin-v5.0.0-beta.3-linux-amd64.tar.gz
    $ wget https://github.com/mimblewimble/grin/releases/download/v5.0.0-beta.3/grin-v5.0.0-beta.3-linux-amd64-sha256sum.txt
  2. Compare sha256 checksum to verify integrity.
    $ echo "f4072c52d8dcd78c1df2cdadd932c18755095d57527a18ec4b5921e2fe6811ca *grin-v5.0.0-beta.3-linux-amd64.tar.gz" | shasum -a 256 --check
    • This produces the following output.
      grin-v5.0.0-beta.3-linux-amd64.tar.gz: OK
  3. Extract grin-v5.0.0-beta.3-linux.amd64.tar.gz.
    $ tar -xvf grin-v5.0.0-beta.3-linux.amd64.tar.gz
    • Output is as follows.
      grin/
      grin/grin
  4. Change to grin directory and start node.
    $ cd grin/
    $ ./grin
    • Output results in an error.
      ./grin: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory
  5. To fix the error, install libncursesw5.
    # apt install libncursesw5
  6. Configure the node to save its logs and chain data in the current directory. This is optional and I did this for convenience and testing purposes.
    $ ./grin server config
    • The output will be as follows.
      grin-server.toml file configured and created in current directory
  7. If the previous step is done, enable DEBUG mode in grin-server.toml.
    #log level for file: Error, Warning, Info, Debug, Trace
    file_log_level = "Debug"
  8. Run the Grin node in the grin directory: ./grin
  9. Optional: Leaving the node running idle can result in Debian suspending to save power. To prevent this, I disabled automatic suspend in the system settings.
  10. Wait until Grin has fully synced.
  11. Success!

Final Results

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│Grin Version 5.0.0-beta.3 [Mainnet]                                                                           │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────┐┌──────────────────────────────────────────────────────────────────────────────────────────┐
│Basic Status      ││                                                                                          │
│Peers and Sync    ││ Current Status:               Running                                                    │
│Mining            ││ Connected Peers:              8                                                          │
│Logs              ││ Disk Usage (GB):              1.865                                                      │
│Version Info      ││ --------------------------------------------------------                                 │
│                  ││ Header Tip Hash:              0000d4683cc1...                                            │
│                  ││ Header Chain Height:          1010308                                                    │
│                  ││ Header Cumulative Difficulty: 1734208616338316                                           │
│                  ││ Header Tip Timestamp:         2020-12-20 09:34:40 UTC                                    │
│                  ││ --------------------------------------------------------                                 │
│                  ││ Chain Tip Hash:               0000d4683cc1...                                            │
│                  ││ Chain Height:                 1010308                                                    │
│                  ││ Chain Cumulative Difficulty:  1734208616338316                                           │
│                  ││ Chain Tip Timestamp:          2020-12-20 09:34:40 UTC                                    │
│                  ││ --------------------------------------------------------                                 │
│                  ││ Transaction Pool Size:        1 (2)                                                      │
│                  ││ Stem Pool Size:               0 (0)                                                      │
│                  ││ --------------------------------------------------------                                 │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│------------------││                                                                                          │
│Tab/Arrow : Cycle ││                                                                                          │
│Enter     : Select││                                                                                          │
│Esc       : Back  ││                                                                                          │
│Q         : Quit  ││                                                                                          │
└──────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│Grin Version 5.0.0-beta.3 [Mainnet]                                                                           │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────┐┌──────────────────────────────────────────────────────────────────────────────────────────┐
│Basic Status      ││                                                                                          │
│Peers and Sync    ││ Total Peers: 8 (Outbound: 8)                                                             │
│Mining            ││ Longest Chain: 1734208204642005 D @ 1010307 H vs Us: 1734208204642005 D @ 1010307 H      │
│Logs              ││                                                                                          │
│Version Info      ││ ┌─────────────────────────────────┤ Connected Peers ├──────────────────────────────────┐ │
│                  ││ │ Address    [^] ╷ State [ ╷ Used bandwidth ╷ Directio╷ Total Difficulty  [ ] ╷ P╷ C╷  │ │
│                  ││ │ ───────────────┴─────────┴────────────────┴─────────┴───────────────────────┴──┴──┴─ │ │
│                  ││ │ 108.196.200.233┆ Connecte┆ ↑: 6 B, ↓: 74 B┆ Outbound┆ 1734208204642005 D @ 1┆ 1┆ 3┆  │ │
│                  ││ │ 120.78.134.123:┆ Connecte┆ ↑: 6 B, ↓: 74 B┆ Outbound┆ 1734208204642005 D @ 1┆ 2┆ 1┆  │ │
│                  ││ │ 178.196.7.116:3┆ Connecte┆ ↑: 6 B, ↓: 74 B┆ Outbound┆ 1734208204642005 D @ 1┆ 1┆ 1┆  │ │
│                  ││ │ 18.204.166.78:3┆ Connecte┆ ↑: 6 B, ↓: 74 B┆ Outbound┆ 1734208204642005 D @ 1┆ 2┆ 1┆  │ │
│                  ││ │ 213.239.217.14:┆ Connecte┆ ↑: 6 B, ↓: 74 B┆ Outbound┆ 1734208204642005 D @ 1┆ 1┆ 3┆  │ │
│                  ││ │ 35.237.62.254:3┆ Connecte┆ ↑: 5 B, ↓: 6 B ┆ Outbound┆ 1734208204642005 D @ 1┆ 2┆ 1┆  │ │
│                  ││ │ 47.90.188.191:1┆ Connecte┆ ↑: 6 B, ↓: 74 B┆ Outbound┆ 1734208204642005 D @ 1┆ 2┆ 1┆  │ │
│                  ││ │ 49.12.108.173:3┆ Connecte┆ ↑: 6 B, ↓: 74 B┆ Outbound┆ 1734208204642005 D @ 1┆ 1┆ 1┆  │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ └──────────────────────────────────────────────────────────────────────────────────────┘ │
│                  ││                                                                                          │
│------------------││                                                                                          │
│Tab/Arrow : Cycle ││                                                                                          │
│Enter     : Select││                                                                                          │
│Esc       : Back  ││                                                                                          │
│Q         : Quit  ││                                                                                          │
└──────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────┘

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│Grin Version 5.0.0-beta.3 [Mainnet]                                                                           │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────┐┌──────────────────────────────────────────────────────────────────────────────────────────┐
│Basic Status      ││                                                                                          │
│Peers and Sync    ││ This is Grin version 5.0.0-beta.3 (git v5.0.0-beta.3), built for x86_64-unknown-linux-   │
│Mining            ││ gnu by rustc 1.48.0 (7eac88abb 2020-11-16).                                              │
│Logs              ││                                                                                          │
│Version Info      ││ Built with profile "release", features "".                                               │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│------------------││                                                                                          │
│Tab/Arrow : Cycle ││                                                                                          │
│Enter     : Select││                                                                                          │
│Esc       : Back  ││                                                                                          │
│Q         : Quit  ││                                                                                          │
└──────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────┘

Errors

  1. Minor error encountered. Starting the Grin node in step 4 results in an error related to ncurses. Installing libncursesw5 fixes this problem. Looking at the quick start install page on docs.grin.mw, libncursesw5 was already suggested as a fix when encountering this error. I hope to include libncursesw5 as one of the default dependencies to install prior to running the node and to also update and include the fix in the requirements section in the build wiki on Github.
marekyggdrasil commented 3 years ago

Great work @goyle !

goyle commented 3 years ago

@marekyggdrasil I also completed the test for v5.0.0-rc.1 on Debian 10. Should I also present those results too?

marekyggdrasil commented 3 years ago

@goyle if it is not trouble and you still have it please share, as long as its not a private key or something else confidential it could be useful at some point. Thanks!

goyle commented 3 years ago

Sorry, I missed this somehow. It was a good thing I still have this saved somewhere!

goyle commented 3 years ago

Grin Node v5.0.0-rc.1

Description

Sync a GRIN-Node from scratch. This test case will be for Debian 10.

System Information: Linux debian 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux \ Testing Environment: virt-manager and Qemu/KVM

Prerequisites

Grin node version will be v5.0.0-rc.1. Archive mode is disabled. Debug log is enabled. This will require building using Rust.

Expected result

Should sync without any problems.

Steps

  1. Download grin v5.0.0-rc.1
    $ wget https://github.com/mimblewimble/grin/archive/v5.0.0-rc.1.tar.gz
    1. Extract v5.0.0-rc.1.tar.gz
      $ tar -xvf v5.0.0-rc.1.tar.gz 
      • Output is as follows.
        grin-5.0.0-rc.1/
        grin-5.0.0-rc.1/.cargo/
        grin-5.0.0-rc.1/.cargo/config
        grin-5.0.0-rc.1/.ci/
        grin-5.0.0-rc.1/.ci/general-jobs
        grin-5.0.0-rc.1/.ci/release.yml
        grin-5.0.0-rc.1/.ci/test.yml
        grin-5.0.0-rc.1/.ci/windows-release.yml
        grin-5.0.0-rc.1/.editorconfig
        grin-5.0.0-rc.1/.github/
        ...
  2. Install rust (and curl if needed).
    $ curl https://sh.rustup.rs -sSf | sh; source $HOME/.cargo/env
    • Proceed with installation with default profile.
         default host triple: x86_64-unknown-linux-gnu
           default toolchain: stable (default)
                     profile: default
        modify PATH variable: yes
      • Output as follows.
        stable-x86_64-unknown-linux-gnu installed - rustc 1.48.0 (7eac88abb 2020-11-16)
  3. Download dependencies. Include the missing libcursesw5.
    # apt install build-essential git tor cmake git libgit2-dev clang libncursesw5 libncurses5-dev libncursesw5-dev zlib1g-dev pkg-config libssl-dev llvm
  4. Build grin node v5.0.0-rc.1.
    $ cd grin-5.0.0-rc.1/
    $ cargo build --release
  5. Configure the node to save its logs and chain data in the current directory. This is optional and I did this for convenience and testing purposes.
    $ cd target/release/
    $ ./grin server config
    • The output will be as follows.
      grin-server.toml file configured and created in current directory
  6. If the previous step is done, enable DEBUG mode in grin-server.toml.
    #log level for file: Error, Warning, Info, Debug, Trace
    file_log_level = "Debug"
  7. Start node.
    $ ./grin
  8. Wait until Grin has fully synced.
  9. Success!

Final Results

┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│Grin Version 5.0.0-rc.1 [Mainnet]                                                                             │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────┐┌──────────────────────────────────────────────────────────────────────────────────────────┐
│Basic Status      ││                                                                                          │
│Peers and Sync    ││ Current Status:               Running                                                    │
│Mining            ││ Connected Peers:              8                                                          │
│Logs              ││ Disk Usage (GB):              1.858                                                      │
│Version Info      ││ --------------------------------------------------------                                 │
│                  ││ Header Tip Hash:              00017fff11d9...                                            │
│                  ││ Header Chain Height:          1010785                                                    │
│                  ││ Header Cumulative Difficulty: 1734404753261009                                           │
│                  ││ Header Tip Timestamp:         2020-12-20 17:39:52 UTC                                    │
│                  ││ --------------------------------------------------------                                 │
│                  ││ Chain Tip Hash:               00017fff11d9...                                            │
│                  ││ Chain Height:                 1010785                                                    │
│                  ││ Chain Cumulative Difficulty:  1734404753261009                                           │
│                  ││ Chain Tip Timestamp:          2020-12-20 17:39:52 UTC                                    │
│                  ││ --------------------------------------------------------                                 │
│                  ││ Transaction Pool Size:        0 (0)                                                      │
│                  ││ Stem Pool Size:               0 (0)                                                      │
│                  ││ --------------------------------------------------------                                 │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│------------------││                                                                                          │
│Tab/Arrow : Cycle ││                                                                                          │
│Enter     : Select││                                                                                          │
│Esc       : Back  ││                                                                                          │
│Q         : Quit  ││                                                                                          │
└──────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│Grin Version 5.0.0-rc.1 [Mainnet]                                                                             │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────┐┌──────────────────────────────────────────────────────────────────────────────────────────┐
│Basic Status      ││                                                                                          │
│Peers and Sync    ││ Total Peers: 8 (Outbound: 8)                                                             │
│Mining            ││ Longest Chain: 1734405164041715 D @ 1010786 H vs Us: 1734405164041715 D @ 1010786 H      │
│Logs              ││                                                                                          │
│Version Info      ││ ┌─────────────────────────────────┤ Connected Peers ├──────────────────────────────────┐ │
│                  ││ │ Address    [^] ╷ State [ ╷ Used bandwidth ╷ Directio╷ Total Difficulty  [ ] ╷ P╷ C╷  │ │
│                  ││ │ ───────────────┴─────────┴────────────────┴─────────┴───────────────────────┴──┴──┴─ │ │
│                  ││ │ 116.203.154.223┆ Connecte┆ ↑: 5 B, ↓: 12 B┆ Outbound┆ 1734405164041715 D @ 1┆ 2┆ 1┆  │ │
│                  ││ │ 157.230.142.11:┆ Connecte┆ ↑: 5 B, ↓: 12 B┆ Outbound┆ 1734405164041715 D @ 1┆ 2┆ 1┆  │ │
│                  ││ │ 176.9.86.219:34┆ Connecte┆ ↑: 6 B, ↓: 34 B┆ Outbound┆ 1734405164041715 D @ 1┆ 1┆ 3┆  │ │
│                  ││ │ 213.239.217.14:┆ Connecte┆ ↑: 5 B, ↓: 12 B┆ Outbound┆ 1734405164041715 D @ 1┆ 1┆ 3┆  │ │
│                  ││ │ 35.181.35.93:34┆ Connecte┆ ↑: 6 B, ↓: 34 B┆ Outbound┆ 1734405164041715 D @ 1┆ 2┆ 1┆  │ │
│                  ││ │ 49.12.108.173:3┆ Connecte┆ ↑: 6 B, ↓: 34 B┆ Outbound┆ 1734405164041715 D @ 1┆ 1┆ 1┆  │ │
│                  ││ │ 5.135.184.54:34┆ Connecte┆ ↑: 12 B, ↓: 5 B┆ Outbound┆ 1734405164041715 D @ 1┆ 1┆ 3┆  │ │
│                  ││ │ 85.10.201.143:3┆ Connecte┆ ↑: 6 B, ↓: 33 B┆ Outbound┆ 1734405164041715 D @ 1┆ 1┆ 3┆  │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ │                                                                                      │ │
│                  ││ └──────────────────────────────────────────────────────────────────────────────────────┘ │
│                  ││                                                                                          │
│------------------││                                                                                          │
│Tab/Arrow : Cycle ││                                                                                          │
│Enter     : Select││                                                                                          │
│Esc       : Back  ││                                                                                          │
│Q         : Quit  ││                                                                                          │
└──────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│Grin Version 5.0.0-rc.1 [Mainnet]                                                                             │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────┐┌──────────────────────────────────────────────────────────────────────────────────────────┐
│Basic Status      ││                                                                                          │
│Peers and Sync    ││ This is Grin version 5.0.0-rc.1, built for x86_64-unknown-linux-gnu by rustc 1.48.0      │
│Mining            ││ (7eac88abb 2020-11-16).                                                                  │
│Logs              ││                                                                                          │
│Version Info      ││ Built with profile "release", features "".                                               │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│                  ││                                                                                          │
│------------------││                                                                                          │
│Tab/Arrow : Cycle ││                                                                                          │
│Enter     : Select││                                                                                          │
│Esc       : Back  ││                                                                                          │
│Q         : Quit  ││                                                                                          │
└──────────────────┘└──────────────────────────────────────────────────────────────────────────────────────────┘