stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3.01k stars 667 forks source link

Proof-of-burn miner on the Neon testnet not working #1586

Closed barkingmonkeye closed 4 years ago

barkingmonkeye commented 4 years ago

Describe the bug when i run stacks-node start --config=./testnet/stacks-node/conf/neon-miner-conf.toml

i get errors ==> ./testnet/stacks-node/conf/neon-miner-conf.toml INFO [1589557738.368] [testnet/stacks-node/src/run_loop/neon.rs:46] Miner node: checking UTXOs at address: moe4SZWgzNuRyALHSsYY9aM49dtRPpZH45 thread 'main' panicked at 'assertion failed:(left == right) left:22, right:4', src/libstd/sys/unix/thread.rs:172:21 note: run withRUST_BACKTRACE=1environment variable to display a backtrace.

Steps To Reproduce I have setup a custom config as described in the guide https://docs.blockstack.org/core/smart/neon-node.html

i made a custom toml file with my private key for the 'seed' field.

[node]
rpc_bind = "0.0.0.0:20443"
p2p_bind = "0.0.0.0:20444"
bootstrap_node = "048dd4f26101715853533dee005f0915375854fd5be73405f679c1917a5d4d16aaaf3c4c0d7a9c132a36b8c5fe1287f07dad8c910174d789eb24bdfb5ae26f5f27@neon># Enter your private key here!
seed = "1ed5baca02fa7874a447f4caa9df34675d9accea9f21b41237219b604cef6bf201"
miner = true

[burnchain]
chain = "bitcoin"
mode = "neon"
peer_host = "neon.blockstack.org"
rpc_port = 18443
peer_port = 18444

[[mstx_balance]]
address = "STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6"
amount = 10000000000000000
[[mstx_balance]]
address = "ST11NJTTKGVT6D1HY4NJRVQWMQM7TVAR091EJ8P2Y"
amount = 10000000000000000
[[mstx_balance]]
address = "ST1HB1T8WRNBYB0Y3T7WXZS38NKKPTBR3EG9EPJKR"
amount = 10000000000000000
[[mstx_balance]]
address = "STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP"

Expected behavior from the guide im following the custom miner should run with that command and custom config file

Environment (please complete the following information): I have win10 host and downloaded Ubuntu 20.04 LTS from the MS store. rustc 1.41.0 cargo 1.41.0

Additional context when i run command RUST_BACKTRACE=full BLOCKSTACK_DEBUG=1 stacks-node start --config=./testnet/stacks-node/conf/neon-miner-conf.toml

i get the output below

==> ./testnet/stacks-node/conf/neon-miner-conf.toml
DEBUG [1589557459.426] [src/burnchains/bitcoin/spv.rs:394] Initialized block headers at /tmp/stacks-testnet-b8d2d97d0a7fb179/burnchain/spv-headers.dat
INFO [1589557459.428] [testnet/stacks-node/src/run_loop/neon.rs:46] Miner node: checking UTXOs at address: moe4SZWgzNuRyALHSsYY9aM49dtRPpZH45
DEBUG [1589557459.444] [testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:198] BitcoinRPC builder: None:None@http://35.245.47.179:18443
DEBUG [1589557459.678] [testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs:198] BitcoinRPC builder: None:None@http://35.245.47.179:18443
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `22`,
 right: `4`', src/libstd/sys/unix/thread.rs:172:21
stack backtrace:
   0:     0x7fb0db506d33 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4ef1f84901fa8edc
   1:     0x7fb0db52198d - core::fmt::write::h026b5c0fa015f11c
   2:     0x7fb0db505505 - std::io::Write::write_fmt::hc77e135d55d2160d
   3:     0x7fb0db509c8e - std::panicking::default_hook::{{closure}}::h7a1ebe73b27c35f6
   4:     0x7fb0db5099a0 - std::panicking::default_hook::hc9a55f38c57244a0
   5:     0x7fb0db50a36b - std::panicking::rust_panic_with_hook::hd3ad4a665e641fa7
   6:     0x7fb0db509f1e - rust_begin_unwind
   7:     0x7fb0db509e60 - std::panicking::begin_panic_fmt::h1e4a1c904d7eb2f7
   8:     0x7fb0db4fafae - std::thread::sleep::h93a3f51dfbfe173f
   9:     0x7fb0da9f2167 - stacks_node::burnchains::bitcoin_regtest_controller::BitcoinRegtestController::get_utxos::h79b81a9fff7ce464
  10:     0x7fb0daa1c45b - stacks_node::run_loop::neon::RunLoop::start::h83d368aa180781dd
  11:     0x7fb0da92efdc - stacks_node::main::h596d7c862b7753a3
  12:     0x7fb0da9b6803 - std::rt::lang_start::{{closure}}::hf285921f6b8ae6c9
  13:     0x7fb0db509db3 - std::panicking::try::do_call::h00d9510988f8141f
  14:     0x7fb0db50aeea - __rust_maybe_catch_panic
  15:     0x7fb0db4f8e3c - std::rt::lang_start_internal::hbaaae8105263a0df
  16:     0x7fb0da930e62 - main
  17:     0x7fb0da5670b3 - __libc_start_main
  18:     0x7fb0da8bd23e - _start
  19:                0x0 - <unknown>
barkingmonkeye commented 4 years ago

i ran thru the set of commands from the guide again, skipping rust since i already have it. still getting the same errors, even on the base node.

➜  stacks-blockchain git:(master) ✗ sudo apt-get install build-essential cmake libssl-dev pkg-config
[sudo] password for blockstack:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.8ubuntu1).
cmake is already the newest version (3.16.3-1ubuntu1).
libssl-dev is already the newest version (1.1.1f-1ubuntu2).
pkg-config is already the newest version (0.29.1-0ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
➜  stacks-blockchain git:(master) ✗ source $HOME/.cargo/env
➜  stacks-blockchain git:(master) ✗ git clone https://github.com/blockstack/stacks-blockchain.git
Cloning into 'stacks-blockchain'...
remote: Enumerating objects: 79220, done.
remote: Total 79220 (delta 0), reused 0 (delta 0), pack-reused 79220
Receiving objects: 100% (79220/79220), 58.32 MiB | 22.80 MiB/s, done.
Resolving deltas: 100% (53885/53885), done.
➜  stacks-blockchain git:(master) ✗ cd stacks-blockchain
➜  stacks-blockchain git:(master) cargo install --path ./testnet/stacks-node
  Installing stacks-node v0.1.0 (/home/blockstack/stacks-blockchain/stacks-blockchain/testnet/stacks-node)
    Updating crates.io index
  Downloaded proc-macro2 v1.0.13
  Downloaded syn v1.0.22
   Compiling libc v0.2.70
   Compiling cc v1.0.26
   Compiling proc-macro2 v1.0.13
   Compiling cfg-if v0.1.10
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.22
   Compiling pkg-config v0.3.17
   Compiling autocfg v1.0.0
   Compiling memchr v2.3.3
   Compiling log v0.4.8
   Compiling lazy_static v1.4.0
   Compiling typenum v1.12.0
   Compiling version_check v0.9.1
   Compiling slab v0.4.2
   Compiling serde v1.0.110
   Compiling byteorder v1.3.4
   Compiling itoa v0.4.5
   Compiling fnv v1.0.7
   Compiling futures-core v0.3.5
   Compiling bytes v0.5.4
   Compiling bitflags v1.2.1
   Compiling getrandom v0.1.14
   Compiling pin-project-lite v0.1.5
   Compiling byte-tools v0.3.1
   Compiling matches v0.1.8
   Compiling openssl v0.10.29
   Compiling foreign-types-shared v0.1.1
   Compiling once_cell v1.4.0
   Compiling smallvec v1.4.0
   Compiling standback v0.2.8
   Compiling httparse v1.3.4
   Compiling native-tls v0.2.4
   Compiling futures-sink v0.3.5
   Compiling opaque-debug v0.2.3
   Compiling pin-utils v0.1.0
   Compiling ryu v1.0.4
   Compiling futures-io v0.3.5
   Compiling percent-encoding v2.1.0
   Compiling openssl-probe v0.1.2
   Compiling proc-macro-hack v0.5.15
   Compiling ppv-lite86 v0.2.6
   Compiling try-lock v0.2.2
   Compiling encoding_rs v0.8.23
   Compiling tower-service v0.3.0
   Compiling subtle v2.2.2
   Compiling fake-simd v0.1.2
   Compiling linked-hash-map v0.5.3
   Compiling zeroize v1.1.0
   Compiling keccak v0.1.0
   Compiling dtoa v0.4.5
   Compiling regex-syntax v0.6.17
   Compiling mime v0.3.16
   Compiling base64 v0.11.0
   Compiling tini v0.2.0
   Compiling pico-args v0.3.1
   Compiling openssl-src v111.9.0+1.1.1g
   Compiling thread_local v1.0.1
   Compiling futures-channel v0.3.5
   Compiling indexmap v1.3.2
   Compiling http v0.2.1
   Compiling block-padding v0.1.5
   Compiling unicode-bidi v0.3.4
   Compiling foreign-types v0.3.2
   Compiling futures-task v0.3.5
   Compiling unicode-normalization v0.1.12
   Compiling unicase v2.6.0
   Compiling time v0.2.16
   Compiling lru-cache v0.1.2
   Compiling clear_on_drop v0.2.3
   Compiling libsqlite3-sys v0.11.1
   Compiling secp256k1 v0.11.6
   Compiling sha2-asm v0.5.3
   Compiling openssl-sys v0.9.56
   Compiling want v0.3.0
   Compiling aho-corasick v0.7.10
   Compiling idna v0.2.0
   Compiling quote v1.0.5
   Compiling iovec v0.1.4
   Compiling net2 v0.2.34
   Compiling num_cpus v1.13.0
   Compiling time v0.1.43
   Compiling http-body v0.3.1
   Compiling generic-array v0.12.3
   Compiling url v2.1.1
   Compiling regex v1.3.7
   Compiling mio v0.6.22
   Compiling rand_core v0.5.1
   Compiling digest v0.8.1
   Compiling block-buffer v0.7.3
   Compiling mime_guess v2.0.3
   Compiling tokio v0.2.21
   Compiling rand_chacha v0.2.2
   Compiling sha2 v0.8.1
   Compiling ripemd160 v0.8.0
   Compiling sha3 v0.8.2
   Compiling rand v0.7.2
   Compiling tokio-util v0.3.1
   Compiling serde_derive v1.0.110
   Compiling pin-project-internal v0.4.16
   Compiling time-macros-impl v0.1.1
   Compiling time-macros v0.1.0
   Compiling pin-project v0.4.16
   Compiling futures-util v0.3.5
   Compiling rusqlite v0.16.0
   Compiling h2 v0.2.5
   Compiling hyper v0.13.5
   Compiling curve25519-dalek v2.0.0
   Compiling serde_json v1.0.53
   Compiling serde_urlencoded v0.6.1
   Compiling toml v0.5.6
   Compiling ed25519-dalek v1.0.0-pre.3
   Compiling blockstack-core v0.0.1 (/home/blockstack/stacks-blockchain/stacks-blockchain)
   Compiling tokio-tls v0.3.1
   Compiling hyper-tls v0.4.1
   Compiling reqwest v0.10.4
   Compiling stacks-node v0.1.0 (/home/blockstack/stacks-blockchain/stacks-blockchain/testnet/stacks-node)
    Finished release [optimized] target(s) in 7m 20s
   Replacing /home/blockstack/.cargo/bin/stacks-node
    Replaced package `stacks-node v0.1.0 (/home/blockstack/stacks-blockchain/target/release/stacks-blockchain/testnet/stacks-node)` with `stacks-node v0.1.0 (/home/blockstack/stacks-blockchain/stacks-blockchain/testnet/stacks-node)` (executable `stacks-node`)
➜  stacks-blockchain git:(master) stacks-node neon
INFO [1589639854.801] [testnet/stacks-node/src/run_loop/neon.rs:58] Follower node: starting up
INFO [1589639854.877] [src/chainstate/stacks/index/marf.rs:764] First-ever block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 in /tmp/stacks-testnet-775c38c8754f0863/burnchain/db/bitcoin/regtest/burn.db/marf
INFO [1589639885.946] [src/burnchains/burnchain.rs:855] Node will fetch burnchain blocks 0-1799...
ERROR [1589640216.680] [src/burnchains/bitcoin/network.rs:207] Failed to connect to peer 35.245.47.179:18444: connection to peer could not be (re-)established
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
  left: `22`,
 right: `4`', src/libstd/sys/unix/thread.rs:172:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
INFO [1589640216.684] [src/burnchains/burnchain.rs:930] Failed to feed burnchain block header 1452: "SendError(..)"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', src/libcore/result.rs:1188:5
➜  stacks-blockchain git:(master)  
barkingmonkeye commented 4 years ago

➜ ~ stacks-node neon INFO [1589638775.742] [testnet/stacks-node/src/run_loop/neon.rs:58] Follower node: starting up INFO [1589638775.810] [src/chainstate/stacks/index/marf.rs:764] First-ever block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 in /tmp/stacks-testnet-ace763c9581a2871/burnchain/db/bitcoin/regtest/burn.db/marf INFO [1589638805.913] [src/burnchains/burnchain.rs:855] Node will fetch burnchain blocks 0-1764... INFO [1589639200.407] [src/chainstate/stacks/index/marf.rs:764] First-ever block 8aeecfa0b9f2ac7818863b1362241e4f32d06b100ae9d1c0fbcc4ed61b91b17a in /tmp/stacks-testnet-ace763c9581a2871/chainstate/chain-00000080-testnet/vm/clarity/marf INFO [1589639200.487] [src/chainstate/stacks/db/accounts.rs:183] STB44HYPYAT2BB2QE513NSP81HTMYWBJP02HPGK6 credited: 10000000000000000 uSTX INFO [1589639200.488] [src/chainstate/stacks/db/accounts.rs:183] ST11NJTTKGVT6D1HY4NJRVQWMQM7TVAR091EJ8P2Y credited: 10000000000000000 uSTX INFO [1589639200.489] [src/chainstate/stacks/db/accounts.rs:183] ST1HB1T8WRNBYB0Y3T7WXZS38NKKPTBR3EG9EPJKR credited: 10000000000000000 uSTX INFO [1589639200.490] [src/chainstate/stacks/db/accounts.rs:183] STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP credited: 10000000000000000 uSTX INFO [1589639200.613] [src/chainstate/stacks/index/marf.rs:764] First-ever block 8aeecfa0b9f2ac7818863b1362241e4f32d06b100ae9d1c0fbcc4ed61b91b17a in /tmp/stacks-testnet-ace763c9581a2871/chainstate/chain-00000080-testnet/vm/index BOOTSTRAP WITH [Neighbor { addr: facade01+80000000://V4(35.245.47.179:20444), public_key: Secp256k1PublicKey { key: PublicKey(aa164d5d7a91c179f60534e75bfd54583715095f00ee3d535358710161f2d48d275f6fe25afbbd24eb89d77401918cad7df08712fec5b8362a139c7a0d4c3caf), compressed: false }, expire_block: 99999, last_contact_time: 0, whitelisted: 0, blacklisted: 0, asn: 0, org: 0, in_degree: 0, out_degree: 0 }] INFO [1589639201.102] [src/net/db.rs:127] Peer's public key: 04bc320b4d031623362a8cb8d110f964f6038a750577f1254a17a6589a33383161d4ce603014a7122efa1444107975b00869b92f2fa81e5030f2083e54e9a05fee INFO [thread '1589639201.' panicked at '267assertion failed: (left == right) left: 22, right: 4] [', testnet/stacks-node/src/neon_node.rssrc/libstd/sys/unix/thread.rs::507172] :Bound HTTP server on: 0.0.0.0:2044321

INFO [note: run with RUST_BACKTRACE=1 environment variable to display a backtrace. 1589639201.269] [testnet/stacks-node/src/neon_node.rs:508] Bound P2P server on: 0.0.0.0:20444 INFO [1589639201.274] [testnet/stacks-node/src/run_loop/neon.rs:78] Begin run loop INFO [1589639202.876] [src/burnchains/burnchain.rs:855] Node will fetch burnchain blocks 1764-1777... thread '' panicked at 'assertion failed: (left == right) left: 22, right: 4', src/libstd/sys/unix/thread.rs:172:21 thread '' panicked at 'called Result::unwrap() on an Err value: DBError(IndexError(SQLError(SqliteFailure(Error { code: DatabaseBusy, extended_code: 5 }, Some("database is locked")))))', src/libcore/result.rs:1188:5 INFO [1589639206.373] [testnet/stacks-node/src/neon_node.rs:710] Received burnchain block #1765 including block_commit_op (winning) - mx2uds6sgnn9znABQ6iDSSmXY9K5D4SHF9 INFO [1589639206.384] [testnet/stacks-node/src/neon_node.rs:710] Received burnchain block #1766 including block_commit_op (winning) - mymHTVyEtB5p6RVkh4vRWVGwM6VqvRG2bE INFO [1589639206.404] [testnet/stacks-node/src/neon_node.rs:710] Received burnchain block #1768 including block_commit_op (winning) - mymHTVyEtB5p6RVkh4vRWVGwM6VqvRG2bE INFO [1589639206.434] [testnet/stacks-node/src/neon_node.rs:710] Received burnchain block #1771 including block_commit_op (winning) - mx2uds6sgnn9znABQ6iDSSmXY9K5D4SHF9 INFO [1589639206.446] [testnet/stacks-node/src/neon_node.rs:710] Received burnchain block #1772 including block_commit_op (winning) - mymHTVyEtB5p6RVkh4vRWVGwM6VqvRG2bE INFO [1589639206.467] [testnet/stacks-node/src/neon_node.rs:710] Received burnchain block #1774 including block_commit_op (winning) - mymHTVyEtB5p6RVkh4vRWVGwM6VqvRG2bE INFO [1589639206.488] [testnet/stacks-node/src/neon_node.rs:710] Received burnchain block #1776 including block_commit_op (winning) - mymHTVyEtB5p6RVkh4vRWVGwM6VqvRG2bE thread 'main' panicked at 'assertion failed: (left == right) left: 22, right: 4', src/libstd/sys/unix/thread.rs:172:21 ➜ ~

barkingmonkeye commented 4 years ago

is this thing partially working?

diwakergupta commented 4 years ago

@barkingmonkeye what's your rust version? Output of rustc --version And what platform / OS / version are you on?

Given the panic is coming from within Rust and not our code, I suspect this is less a bug in our code, more about something going on in your setup.

barkingmonkeye commented 4 years ago

Im on win10 v1903, with WSL 1, Ubuntu 20.04 LTS downloaded from the MS store running as just a terminal, node v10.19.0, rustc 1.41.0.

Thanks for the tip about it pointing to Rust. ill focus on the steps im using to set that up.

barkingmonkeye commented 4 years ago

i got it working today on a different testbed. thanks so much for your help and guidance.