Coder Social home page Coder Social logo

parity-bitcoin's Introduction

The Parity Bitcoin client.

THIS IS UNMAINTAINED HISTORICAL SOFTWARE

Build Status Snap Status

Gitter Gitter https://gitter.im/paritytech/parity-bitcoin

Installing from source

Installing pbtc from source requires rustc and cargo.

Minimal supported version is rustc 1.23.0 (766bd11c8 2018-01-01)

Install rustc and cargo

Both rustc and cargo are a part of rust tool-chain.

An easy way to install the stable binaries for Linux and Mac is to run this in your shell:

curl -sSf https://static.rust-lang.org/rustup.sh | sh

Windows binaries can be downloaded from rust-lang website.

Install C and C++ compilers

You will need the cc and gcc compilers to build some of the dependencies.

sudo apt-get update
sudo apt-get install build-essential

Clone and build pbtc

Now let's clone pbtc and enter it's directory:

git clone https://github.com/paritytech/parity-bitcoin
cd parity-bitcoin

pbtc can be build in two modes. --debug and --release. Debug is the default.

# builds pbtc in debug mode
cargo build -p pbtc
# builds pbtc in release mode
cargo build -p pbtc --release

pbtc is now available at either ./target/debug/pbtc or ./target/release/pbtc.

Installing the snap

In any of the supported Linux distros:

sudo snap install parity-bitcoin --edge

Running tests

pbtc has internal unit tests and it conforms to external integration tests.

Running unit tests

Assuming that repository is already cloned, we can run unit tests with this command:

cargo test --all

Running external integration tests

Running integration tests is automated, as the regtests repository is one of the submodules. Let's download it first:

git submodule update --init

Now we can run them using the command:

./tools/regtests.sh

It is also possible to run regtests manually:

# let's start pbtc in regtest compatible mode
./target/release/pbtc --btc --regtest

# now in second shell window
cd $HOME
git clone https://github.com/TheBlueMatt/test-scripts
cd test-scripts
java -jar pull-tests-f56eec3.jar

Going online

By default parity connects to bitcoind-seednodes. Full list is available here.

Before starting synchronization, you must decide - which fork to follow - Bitcoin Core (--btc flag) or Bitcoin Cash (--bch flag). On next start, passing the same flag is optional, as the database is already bound to selected fork and won't be synchronized using other verification rules.

To start syncing the main network, just start the client, passing selected fork flag. For example:

./target/release/pbtc --btc

To start syncing the testnet:

./target/release/pbtc --btc --testnet

To not print any syncing progress add --quiet flag:

./target/release/pbtc --btc --quiet

Importing bitcoind database

It is possible to import existing bitcoind database:

# where $BITCOIND_DB is path to your bitcoind database, e.g., "/Users/user/Library/Application Support"
./target/release/pbtc import "$BITCOIND_DB/Bitcoin/blocks"

By default import verifies imported the blocks. You can disable this, by adding --verification-level=none flag.

./target/release/pbtc --btc --verification-level=none import "$BITCOIND_DB/Bitcoin/blocks"

Command line interface

Full list of CLI options, which is available under pbtc --help:

pbtc 0.1.0
Parity Technologies <[email protected]>
Parity Bitcoin client

USAGE:
    pbtc [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
        --bch             Use Bitcoin Cash verification rules (BCH).
        --btc             Use Bitcoin Core verification rules (BTC).
    -h, --help            Prints help information
        --no-jsonrpc      Disable the JSON-RPC API server.
    -q, --quiet           Do not show any synchronization information in the console.
        --regtest         Use a private network for regression tests.
        --testnet         Use the test network (Testnet3).
    -V, --version         Prints version information

OPTIONS:
        --blocknotify <COMMAND>            Execute COMMAND when the best block changes (%s in COMMAND is replaced by the block hash).
    -c, --connect <IP>                     Connect only to the specified node.
    -d, --data-dir <PATH>                  Specify the database and configuration directory PATH.
        --db-cache <SIZE>                  Sets the database cache size.
        --jsonrpc-apis <APIS>              Specify the APIs available through the JSONRPC interface. APIS is a comma-delimited list of API names.
        --jsonrpc-cors <URL>               Specify CORS header for JSON-RPC API responses.
        --jsonrpc-hosts <HOSTS>            List of allowed Host header values.
        --jsonrpc-interface <INTERFACE>    The hostname portion of the JSONRPC API server.
        --jsonrpc-port <PORT>              Specify the PORT for the JSONRPC API server.
        --only-net <NET>                   Only connect to nodes in network version <NET> (ipv4 or ipv6).
        --port <PORT>                      Listen for connections on PORT.
    -s, --seednode <IP>                    Connect to a seed-node to retrieve peer addresses, and disconnect.
        --verification-edge <BLOCK>        Non-default verification-level is applied until a block with given hash is met.
        --verification-level <LEVEL>       Sets the Blocks verification level to full (default), header (scripts are not verified), or none (no verification at all).

SUBCOMMANDS:
    help        Prints this message or the help of the given subcommand(s)
    import      Import blocks from a Bitcoin Core database.
    rollback    Rollback the database to given canonical-chain block.

JSON-RPC

The JSON-RPC interface is served on port :8332 for mainnet and :18332 for testnet unless you specified otherwise. So if you are using testnet, you will need to change the port in the sample curl requests shown below.

Network

The Parity-bitcoin network interface.

addnode

Add the node.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "add"], "id":1 }' localhost:8332

Remove the node.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "remove"], "id":1 }' localhost:8332

Connect to the node.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "onetry"], "id":1 }' localhost:8332
getaddednodeinfo

Query info for all added nodes.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getaddednodeinfo", "params": [true] }' localhost:8332

Query info for the specified node.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getaddednodeinfo", "params": [true, "192.168.0.201"] }' localhost:8332
getconnectioncount

Get the peer count.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getconnectioncount", "params": [] }' localhost:8332

Blockchain

The Parity-bitcoin blockchain data interface.

getbestblockhash

Get hash of best block.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getbestblockhash", "params": [], "id":1 }' localhost:8332
getblockcount

Get height of best block.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getblockcount", "params": [], "id":1 }' localhost:8332
getblockhash

Get hash of block at given height.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getblockhash", "params": [0], "id":1 }' localhost:8332
getdifficulty

Get proof-of-work difficulty as a multiple of the minimum difficulty

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getdifficulty", "params": [], "id":1 }' localhost:8332
getblock

Get information on given block.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getblock", "params": ["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"], "id":1 }' localhost:8332
gettxout

Get details about an unspent transaction output.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "gettxout", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", 0], "id":1 }' localhost:8332
gettxoutsetinfo

Get statistics about the unspent transaction output set.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "gettxoutsetinfo", "params": [], "id":1 }' localhost:8332

Miner

The Parity-bitcoin miner data interface.

getblocktemplate

Get block template for mining.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getblocktemplate", "params": [{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}], "id":1 }' localhost:8332

Raw

The Parity-bitcoin raw data interface.

getrawtransaction

Return the raw transaction data.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "getrawtransaction", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"], "id":1 }' localhost:8332
decoderawtransaction

Return an object representing the serialized, hex-encoded transaction.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "decoderawtransaction", "params": ["01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"], "id":1 }' localhost:8332
createrawtransaction

Create a transaction spending the given inputs and creating new outputs.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "createrawtransaction", "params": [[{"txid":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b","vout":0}],{"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":0.01}], "id":1 }' localhost:8332
sendrawtransaction

Adds transaction to the memory pool && relays it to the peers.

curl -H 'content-type: application/json' --data-binary '{"jsonrpc": "2.0", "method": "sendrawtransaction", "params": ["01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"], "id":1 }' localhost:8332

Logging

This is a section only for developers and power users.

You can enable detailed client logging by setting the environment variable RUST_LOG, e.g.,

RUST_LOG=verification=info ./target/release/pbtc --btc

pbtc started with this environment variable will print all logs coming from verification module with verbosity info or higher. Available log levels are:

  • error
  • warn
  • info
  • debug
  • trace

It's also possible to start logging from multiple modules in the same time:

RUST_LOG=sync=trace,p2p=trace,verification=trace,db=trace ./target/release/pbtc --btc

Internal documentation

Once released, pbtc documentation will be available here. Meanwhile it's only possible to build it locally:

cd parity-bitcoin
./tools/doc.sh
open target/doc/pbtc/index.html

parity-bitcoin's People

Contributors

5chdn avatar alun avatar amanusk avatar arkpar avatar chevdor avatar chritchens avatar cjwatson avatar d3v3sh5ingh avatar debris avatar devops-parity avatar ecliptik avatar evandandrea avatar gavofyork avatar general-beck avatar gguoss avatar gtklocker avatar i1skn avatar jeandudey avatar jlopp avatar josephgoulden avatar korczis avatar melvillian avatar nicolasochem avatar niklasad1 avatar nikvolf avatar okislitsin avatar pierre-l avatar rphmeier avatar sorpaas avatar svyatonik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parity-bitcoin's Issues

Find logic error which causes InvalidVersion panic

thread '<unnamed>' panicked at 'failed to create outgoing message: InvalidVersion', ../src/libcore/result.rs:837
stack backtrace:
   1:     0x5638caeaae1a - std::sys::imp::backtrace::tracing::imp::write::he3d1bfbdbf113480
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x5638caeb0aef - std::panicking::default_hook::{{closure}}::h575f1b40d2e88f07
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:247
   3:     0x5638caeae996 - std::panicking::default_hook::h3d5dccce8125d0cf
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:263
   4:     0x5638caeaf047 - std::panicking::rust_panic_with_hook::h00b81bb3dcbd51f2
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:451
   5:     0x5638caeaeed4 - std::panicking::begin_panic::ha6a0d553db9869ff
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:413
   6:     0x5638caeaedf9 - std::panicking::begin_panic_fmt::h24d113aee3ee4081
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:397
   7:     0x5638caeaed87 - rust_begin_unwind
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:373
   8:     0x5638caeec91d - core::panicking::panic_fmt::he441b2ea2036b98a
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/panicking.rs:69
   9:     0x5638ca7984b0 - core::result::unwrap_failed::hd47547f52f049569
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/macros.rs:29
  10:     0x5638ca76c2e5 - <core::result::Result<T, E>>::expect::h25e4d11b614db245
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libcore/result.rs:761
  11:     0x5638ca8415b1 - p2p::net::channel::Channel::write_message::h1db1d5e1f0db631f
                        at /home/svyatonik/dev/parity-bitcoin/p2p/src/net/channel.rs:23
  12:     0x5638ca85b555 - p2p::p2p::Context::send::hc2ba7cf0d38f78bf
                        at /home/svyatonik/dev/parity-bitcoin/p2p/src/p2p.rs:308
  13:     0x5638ca85449b - p2p::p2p::Context::send_to_peer::h62ac1bc99ec0030e
                        at /home/svyatonik/dev/parity-bitcoin/p2p/src/p2p.rs:296
  14:     0x5638ca846086 - <p2p::protocol::addr::AddrProtocol as p2p::protocol::Protocol>::initialize::h1eed21af011fcd40
                        at /home/svyatonik/dev/parity-bitcoin/p2p/src/protocol/addr.rs:29
  15:     0x5638ca84cf49 - p2p::session::Session::initialize::h78459305bb99b967
                        at /home/svyatonik/dev/parity-bitcoin/p2p/src/session.rs:48
  16:     0x5638ca873d52 - p2p::p2p::Context::connect_future::{{closure}}::h71e635ac2b95f423
                        at /home/svyatonik/dev/parity-bitcoin/p2p/src/p2p.rs:144
  17:     0x5638ca869224 - <futures::then::Then<A, B, F> as futures::Future>::poll::{{closure}}::h87e2a8eb4dd1be53
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/then.rs:32
  18:     0x5638ca7cb100 - <futures::chain::Chain<A, B, C>>::poll::hedd0141d10b79893
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/chain.rs:38
  19:     0x5638ca80ee7b - <futures::then::Then<A, B, F> as futures::Future>::poll::hc785eec5d321dfa3
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/then.rs:31
  20:     0x5638ca7cceef - <futures::chain::Chain<A, B, C>>::poll::hf8c1ce1b1f846b74
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/chain.rs:25
  21:     0x5638ca80e92c - <futures::then::Then<A, B, F> as futures::Future>::poll::h351fdbec0c8a1772
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/then.rs:31
  22:     0x5638ca776f81 - <Box<F> as futures::Future>::poll::h031052890afff7c2
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:232
  23:     0x5638ca7f70bc - futures::catch_unwind::<impl futures::Future for std::panic::AssertUnwindSafe<F>>::poll::h2f2f40a7ee1770d3
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/catch_unwind.rs:48
  24:     0x5638ca86523a - <futures::catch_unwind::CatchUnwind<F> as futures::Future>::poll::{{closure}}::h5aaf00034a06a4c7
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/catch_unwind.rs:31
  25:     0x5638ca75fc32 - std::panicking::try::do_call::h45a46974a5b46139
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:356
  26:     0x5638caeb85ca - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libpanic_unwind/lib.rs:97
  27:     0x5638ca75f7a4 - std::panicking::try::ha604d046d12a61ab
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:332
  28:     0x5638ca75e3de - std::panic::catch_unwind::h31724c3a586e7bbd
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:351
  29:     0x5638ca7f52b1 - <futures::catch_unwind::CatchUnwind<F> as futures::Future>::poll::h8786d9ad3d391562
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/catch_unwind.rs:31
  30:     0x5638ca734b44 - <futures_cpupool::Sender<F, core::result::Result<<F as futures::Future>::Item, <F as futures::Future>::Error>> as futures::Future>::poll::ha933c9d1f22012f8
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-cpupool-0.1.2/src/lib.rs:262
  31:     0x5638caac6b71 - <Box<F> as futures::Future>::poll::h031052890afff7c2
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:209
  32:     0x5638caac719c - <futures::task::Spawn<F>>::poll_future::{{closure}}::h4bcd69f31780588e
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:209
  33:     0x5638caac70fe - <futures::task::Spawn<T>>::enter::{{closure}}::h0ce387e28b9ed49e
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:209
  34:     0x5638caac7025 - futures::task::set::{{closure}}::h8cec1681c117dc9a
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:209
  35:     0x5638caac10a1 - <std::thread::local::LocalKey<T>>::with::hddc7ce62a6e625d5
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/local.rs:245
  36:     0x5638caac5d67 - futures::task::set::h0d84863f05c636e6
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:209
  37:     0x5638caac6161 - <futures::task::Spawn<T>>::enter::haca6110ef6706078
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:209
  38:     0x5638caac5fea - <futures::task::Spawn<F>>::poll_future::hbde3a1e2083fc8d3
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:209
  39:     0x5638caac6397 - futures::task::Run::run::h365a03c70d195c4b
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.3/src/lib.rs:209
  40:     0x5638ca8ca2e3 - futures_cpupool::work::hae6d5574b2c8c04e
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-cpupool-0.1.2/src/lib.rs:208
  41:     0x5638ca8cb05d - futures_cpupool::Builder::create::{{closure}}::h6ea03a3a4bf08a53
                        at /home/svyatonik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-cpupool-0.1.2/src/lib.rs:327
  42:     0x5638ca8c9afb - <std::panic::AssertUnwindSafe<F> as core::ops::FnOnce<()>>::call_once::h401fe23df8967701
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:295
  43:     0x5638ca8c050a - std::panicking::try::do_call::h3aedbbe95cce7999
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:356
  44:     0x5638caeb85ca - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libpanic_unwind/lib.rs:97
  45:     0x5638ca8c0299 - std::panicking::try::haf8a8c6303a1a95c
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:332
  46:     0x5638ca8bf74a - std::panic::catch_unwind::hb538e759064ccba5
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panic.rs:351
  47:     0x5638ca8cacfa - std::thread::Builder::spawn::{{closure}}::h8adf1771ee3bd522
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/thread/mod.rs:287
  48:     0x5638ca8c481b - <F as alloc::boxed::FnBox<A>>::call_box::h46003cea5b0ff514
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/liballoc/boxed.rs:595
  49:     0x5638caeae074 - std::sys::imp::thread::Thread::new::thread_start::h990fb082eb5abe34
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/liballoc/boxed.rs:605
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys_common/thread.rs:21
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys/unix/thread.rs:84
  50:     0x7f0c6c0bb709 - start_thread
  51:     0x7f0c6bbdb82c - clone
  52:                0x0 - <unknown>

JSON-RPC api

high priority methods

  • sendrawtransaction

list for next milestone:

full list:
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

Reproducible panic during testnet sync

branch: testnet_verification

./target/release/pbtc --print-to-console --testnet                                                                                                  
1 โ†ต
2016-12-02 12:01:58  WARN sync Block "00000000e9e9bea533457c19b81742724c1ffb401eb9832d139aba538eea7720" verification failed with error "Transaction(1, Signature(47))"
2016-12-02 12:01:58  WARN sync Previous header of the first header from peer#1 `headers` message is unknown. First: "000000003a23e2acdddc548664c5b9eaa935ddf2d0c93bf4ae3dc8f6a6a6a48e". Previous: "000000002ecef6141059c01f12027fb554b49688b742544749ac2f0e332cd58c"
thread 'Sync verification thread' panicked at 'internal error: entered unreachable code: sync will never put orphaned blocks to verification queue', sync/src/synchronization_verifier.rs:165
stack backtrace:
2016-12-02 12:01:58  WARN sync Previous header of the first header from peer#2 `headers` message is unknown. First: "000000003a23e2acdddc548664c5b9eaa935ddf2d0c93bf4ae3dc8f6a6a6a48e". Previous: "000000002ecef6141059c01f12027fb554b49688b742544749ac2f0e332cd58c"
2016-12-02 12:01:58  INFO sync "12:01:58" @ Switched to saturated state. Chain information: [sch:0 / bh:0 -> req:0 -> vfy:0 -> stored: 519]
   1:        0x10a276cfa - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7
   2:        0x10a2794ef - std::panicking::default_hook::{{closure}}::h6875a2976258b020
   3:        0x10a279197 - std::panicking::default_hook::h88ffbc5922643264
   4:        0x10a2799b6 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3
   5:        0x10a279854 - std::panicking::begin_panic::hc066339e2fdc17d1
   6:        0x10a279772 - std::panicking::begin_panic_fmt::h5912b2d2df332044
   7:        0x109f6af78 - sync::synchronization_verifier::execute_verification_task::h97dc36bdd3df7784
   8:        0x109f14f6d - std::panicking::try::do_call::h7e254e750d480bfe
   9:        0x10a27a8ba - __rust_maybe_catch_panic
  10:        0x109f2167d - <F as alloc::boxed::FnBox<A>>::call_box::hd8e2df46621509b0
  11:        0x10a278bc4 - std::sys::imp::thread::Thread::new::thread_start::h8084b1107992ae5b
  12:     0x7fffb3f87aaa - _pthread_body
  13:     0x7fffb3f879f6 - _pthread_start
thread '<unnamed>' panicked at 'Verification thread have the same lifetime as `AsyncVerifier`: "SendError(..)"', ../src/libcore/result.rs:837
stack backtrace:
   1:        0x10a276cfa - std::sys::imp::backtrace::tracing::imp::write::h944c02ac40aee2d7
   2:        0x10a2794ef - std::panicking::default_hook::{{closure}}::h6875a2976258b020
   3:        0x10a279197 - std::panicking::default_hook::h88ffbc5922643264
   4:        0x10a2799b6 - std::panicking::rust_panic_with_hook::ha5aed1dfc0e220e3
   5:        0x10a279854 - std::panicking::begin_panic::hc066339e2fdc17d1
   6:        0x10a279772 - std::panicking::begin_panic_fmt::h5912b2d2df332044
   7:        0x10a2796d7 - rust_begin_unwind
   8:        0x10a2a62e0 - core::panicking::panic_fmt::h561c5ee168a3d2cb
   9:        0x109f1be94 - core::result::unwrap_failed::hc438eeb865b0835f
  10:        0x109f41cc1 - <sync::inbound_connection::InboundConnection as p2p::protocol::sync::InboundSyncConnection>::on_block::h5ebd17e72242778e
  11:        0x109fd642b - <p2p::protocol::sync::SyncProtocol as p2p::protocol::Protocol>::on_message::h4b1667486be47f4a
  12:        0x109fd9102 - p2p::session::Session::on_message::hd13de6cf48696875
  13:        0x109fbebe9 - <futures::future::then::Then<A, B, F> as futures::future::Future>::poll::hb9d9e5609324deb0
  14:        0x109fa0493 - std::panicking::try::do_call::h746251dd938a67b0
  15:        0x10a27a8ba - __rust_maybe_catch_panic
  16:        0x109f9cd0f - <futures_cpupool::Sender<F, core::result::Result<<F as futures::future::Future>::Item, <F as futures::future::Future>::Error>> as futures::future::Future>::poll::hb1240370e50c2800
  17:        0x10a23f958 - futures::task_impl::Run::run::hbc1659458f768a6e
  18:        0x109fe8f93 - std::panicking::try::do_call::h0b885a4f33340297
  19:        0x10a27a8ba - __rust_maybe_catch_panic
  20:        0x109fe986f - <F as alloc::boxed::FnBox<A>>::call_box::hd3f4632539d276a6
  21:        0x10a278bc4 - std::sys::imp::thread::Thread::new::thread_start::h8084b1107992ae5b
  22:     0x7fffb3f87aaa - _pthread_body

bip30 implementation ideas

so... this is bip30: https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki

tl;dr;
it's possible to duplicate coinbase transaction or any other transaction which spent less then half of the funds. By duplicating, I mean, valid transaction, with the same hash as existing one.

With existing db design, if transaction is already in database it's impossible to guess if it's a part of master chain, side chain, many side chains or all of them

imo, the easiest solution might be storing block hashes in transaction meta and later checking if there is an intersection between X parents and this hashes

@NikVolf @svyatonik what do you think about it?

Track number of transactions processed in the sync log

  • along with block count
  • it is actually much more informant indicator of the being job done
  • Processed 814 blocks (_12334 transactions_) in 60.00660687100026 seconds. Chain information: [sch:5184 / bh:0 -> req:637 -> vfy:483 -> stored: 177712]

Panic in sync during regtests

branch origin/test_b83

regtests failed with

regtest name:

04:32:11 1 BitcoindComparisonTool.main: Testing block large reorg reorg block 129 7db984219ebfbcf09b8ae53ac8597aef08bba433672ea0290a5e0c279c27d4cc
thread 'Sync verification thread' panicked at 'internal error: entered unreachable code: sync will never put orphaned blocks to verification queue', sync/src/synchronization_verifier.rs:164
stack backtrace:
   1:        0x105d9732a - std::sys::imp::backtrace::tracing::imp::write::he3d1bfbdbf113480
   2:        0x105d9af5f - std::panicking::default_hook::{{closure}}::h575f1b40d2e88f07
   3:        0x105d997cf - std::panicking::default_hook::h3d5dccce8125d0cf
   4:        0x105d99e06 - std::panicking::rust_panic_with_hook::h00b81bb3dcbd51f2
   5:        0x105d99ca4 - std::panicking::begin_panic::ha6a0d553db9869ff
   6:        0x105d99bc2 - std::panicking::begin_panic_fmt::h24d113aee3ee4081
   7:        0x1059e4c26 - sync::synchronization_verifier::execute_verification_task::h6ce90e68127ef548
   8:        0x10598e833 - std::panicking::try::do_call::he6de41d85fd6cf1e
   9:        0x105d9b51a - __rust_maybe_catch_panic
  10:        0x10599a75d - <F as alloc::boxed::FnBox<A>>::call_box::h74cfd58a527a980b
  11:        0x105d99204 - std::sys::imp::thread::Thread::new::thread_start::h990fb082eb5abe34
  12:     0x7fffb3f87aaa - _pthread_body
  13:     0x7fffb3f879f6 - _pthread_start

failing b82 test

copy paste from slack:

ok, so it looks something weird is going on with b82

from the test-scripts:

        // Test transaction resurrection
        // -> b77 (24) -> b78 (25) -> b79 (26)
        //            \-> b80 (25) -> b81 (26) -> b82 (27)
        // b78 creates a tx, which is spent in b79. after b82, both should be in mempool
b77 379ed6636a5e60d9812c106710617833b9e879c9155a8cc66c8209ae4111b638
b78 3e19dea416ab91b60509179b0ce9294d8bf6fd1db287ad5eb06cb83180268c3c
b79 1231c471468d12203db242ffceb4d92ed134334ab97e0836f83cd06e85679d5a
b80 736acddf427aa62ea60d37b3ca351c70a75f3ff2dfb8e2e6c7db53569d9aba0a
b81 780f39d097891eb127ce130fdc64085f086fa5b210be1821961729c52b45e317
b82 17e9a795c724b2b7861873feaf8617d509265b2ce4e3aa935ff69fd4c52408ec

parity logs:

TRACE:sync::local_node: Got `block` message from peer#1. Block hash: 17e9a795c724b2b7861873feaf8617d509265b2ce4e3aa935ff69fd4c52408ec
TRACE:verification::chain_verifier: Block 17e9a795c724b2b7861873feaf8617d509265b2ce4e3aa935ff69fd4c52408ec (transactions: 2) verification finished. Result Ok(Side)
TRACE:db::storage: Decanonizing block 1231c471468d12203db242ffceb4d92ed134334ab97e0836f83cd06e85679d5a
TRACE:db::storage: Decanonizing block 3e19dea416ab91b60509179b0ce9294d8bf6fd1db287ad5eb06cb83180268c3c
TRACE:p2p::p2p: Received getheaders message from 127.0.0.1:52665
TRACE:p2p::net::peer_context: declared response: 375
TRACE:p2p::protocol::sync: declared response 375 for request: getheaders
TRACE:sync::local_node: Got `getheaders` message from peer#1
TRACE:sync::synchronization_server: Best common block header with peer#1 is block#125: "379ed6636a5e60d9812c106710617833b9e879c9155a8cc66c8209ae4111b638"
TRACE:p2p::p2p: Received ping message from 127.0.0.1:52665

so:

  • b82 caused decanonization of b78 and b79. And somehow we havenโ€™t canonized b80, b81 and b82. Is it even possible?
  • b82 test expects decanonized transactions to be moved to mempool. Are we doing that already?

assertion in node_table failed

might be related with connecting to the same node twice

stacktrace

thread '<unnamed>' panicked at 'assertion failed: self.by_score.remove(&old.clone().into())', p2p/src/util/node_table.rs:157
stack backtrace:
   1:        0x1040e2569 - std::sys::backtrace::tracing::imp::write::hd4b54a4a2078cb15
   2:        0x1040e5d70 - std::panicking::default_hook::_{{closure}}::h51a5ee7ba6a9fcef
   3:        0x1040e4bd0 - std::panicking::default_hook::hf823fce261e27590
   4:        0x1040e5256 - std::panicking::rust_panic_with_hook::h8d486474663979b9
   5:        0x103c44073 - std::panicking::begin_panic::h94e6fb50d7864116
   6:        0x103d2f05d - _<p2p..util..node_table..NodeTable<T>>::insert_many::h0f9998827deb35b6
   7:        0x103d3046a - p2p::p2p::Context::update_node_table::h67893486e06e2f81
   8:        0x103d27cd7 - _<p2p..protocol..addr..AddrProtocol as p2p..protocol..Protocol>::on_message::h998118426a95f131
   9:        0x103d41ed7 - p2p::session::Session::on_message::_{{closure}}::hbdf798987c9852da
  10:        0x103c71d4f - core::ops::impls::_<impl core..ops..FnOnce<A> for &'a mut F>::call_once::hb8a17e480083c4bc
  11:        0x103c3323e - _<core..option..Option<T>>::map::h5575252957ab3335
  12:        0x103cf4534 - _<core..iter..Map<I, F> as core..iter..iterator..Iterator>::next::h432ca8fe64986608
  13:        0x103c253bb - _<<core..result..Result<V, E> as core..iter..traits..FromIterator<core..result..Result<A, E>>>..from_iter..Adapter<Iter, E> as core..iter..iterator..Iterator>::next::h1ad1b82d739008fc
  14:        0x103ccb3af - _<&'a mut I as core..iter..iterator..Iterator>::next::h14eaed9e07d627fc
  15:        0x103c3af73 - _<collections..vec..Vec<T>>::extend_desugared::h8258e2323939c2c9
  16:        0x103d0d71f - _<collections..vec..Vec<T> as core..iter..traits..FromIterator<T>>::from_iter::ha5b15a415a92594d
  17:        0x103c17ef6 - _<core..result..Result<V, E> as core..iter..traits..FromIterator<core..result..Result<A, E>>>::from_iter::h925a53f681543508
  18:        0x103c761ae - core::iter::iterator::Iterator::collect::h3aeddbd3c3f4458b
  19:        0x103d2dd6f - p2p::session::Session::on_message::h30e1ddd4d2753521
  20:        0x103d51854 - p2p::p2p::Context::on_message::_{{closure}}::hcd2fcbf2ea63bcb4
  21:        0x103d446bf - _<futures..then..Then<A, B, F> as futures..Future>::poll::_{{closure}}::h54ffd8e1dab74ed8
  22:        0x103ca622b - _<futures..chain..Chain<A, B, C>>::poll::hb8e1e68befd5fec9
  23:        0x103cf336b - _<futures..then..Then<A, B, F> as futures..Future>::poll::hd7a60240222261af
  24:        0x103c5a260 - _<Box<F> as futures..Future>::poll::h9c4857a46bc043fa
  25:        0x103cda5ab - futures::catch_unwind::_<impl futures..Future for std..panic..AssertUnwindSafe<F>>::poll::h9fed03d959db7b2d
  26:        0x103d414b6 - _<futures..catch_unwind..CatchUnwind<F> as futures..Future>::poll::_{{closure}}::h319bc65a636e10d5
  27:        0x103c4564d - std::panicking::try::do_call::h4339b32eb3c34ab7
  28:        0x1040e635a - __rust_maybe_catch_panic
  29:        0x103c4499c - std::panicking::try::h860fd8c2f6720b53
  30:        0x103c43dae - std::panic::catch_unwind::h4aa44042fd78f088
  31:        0x103cd845f - _<futures..catch_unwind..CatchUnwind<F> as futures..Future>::poll::h313e76fda1382e95
  32:        0x103c234e7 - _<futures_cpupool..Sender<F, core..result..Result<<F as futures..Future>..Item, <F as futures..Future>..Error>> as futures..Future>::poll::h7802b20ae1bda7db
  33:        0x103ee9961 - _<Box<F> as futures..Future>::poll::h683f5c6503df1de0
  34:        0x103ee9c7c - _<futures..task..Spawn<F>>::poll_future::_{{closure}}::h1b50c409ba616ea9
  35:        0x103ee9bde - _<futures..task..Spawn<T>>::enter::_{{closure}}::h5f6adcc56eff7c14
  36:        0x103ee9abf - futures::task::set::_{{closure}}::h3ab58225858f7fb4
  37:        0x103ee356a - _<std..thread..local..LocalKey<T>>::with::h6e17502a5d65411d
  38:        0x103ee870a - futures::task::set::he94844b036bd9d85
  39:        0x103ee8c41 - _<futures..task..Spawn<T>>::enter::hf171e31bfacb20c6
  40:        0x103ee8a92 - _<futures..task..Spawn<F>>::poll_future::hde89f4cf6464c5ac
  41:        0x103ee8ea2 - futures::task::Run::run::h8fe690a96be24805
  42:        0x103ed8855 - futures_cpupool::work::hbfdd44854e0914ea
  43:        0x103ed96bd - futures_cpupool::Builder::create::_{{closure}}::hae1b82701e391f9d
  44:        0x103ed7fcb - _<std..panic..AssertUnwindSafe<F> as core..ops..FnOnce<()>>::call_once::hd9843cd8ca7e484f
  45:        0x103ece57a - std::panicking::try::do_call::h2c16039dba30e2a0
  46:        0x1040e635a - __rust_maybe_catch_panic
  47:        0x103ece309 - std::panicking::try::hc122fe0b368cf21a
  48:        0x103ecd6da - std::panic::catch_unwind::hc68481d4edb4a92b
  49:        0x103ed9355 - std::thread::Builder::spawn::_{{closure}}::h44203a85c8a5bde2
  50:        0x103ed2bc3 - _<F as alloc..boxed..FnBox<A>>::call_box::h25d897ee5767a716
  51:        0x1040e4305 - std::sys::thread::Thread::new::thread_start::h57f688c224d4fa4d
  52:     0x7fff8d451aaa - _pthread_body
  53:     0x7fff8d4519f6 - _pthread_start

sync cannot recover from wrong chain

master branch

RUST_LOG=info ./target/release/pbtc --diskdb -s dnsseed.bluematt.me:8333    
INFO:p2p::p2p: Inbound connections: (0/10)
INFO:p2p::p2p: Outbound connections: (1/10)
INFO:sync::synchronization_client: Processed 1494 blocks in 0.7938470150002104 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 2, stored: 1495 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.7507192960001703 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 2, stored: 2989 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.7232982440000342 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 3, stored: 4482 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.8171023249997234 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 2, stored: 5977 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.6400520489987684 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 2, stored: 7471 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.7886963849996391 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 1, stored: 8966 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.6213304720004089 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 3, stored: 10458 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.6838100310014852 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 1, stored: 11954 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.8352868570000282 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 1, stored: 13448 }
INFO:sync::synchronization_client: Processed 1494 blocks in 1.97738209399904 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 1, stored: 14942 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.8169208510007593 seconds. Chain information: Information { scheduled: 498, requested: 0, verifying: 3, stored: 16434 }
INFO:p2p::p2p: Inbound connections: (0/10)
INFO:p2p::p2p: Outbound connections: (2/10)
INFO:sync::synchronization_client: Processed 1496 blocks in 0.5882269829999132 seconds. Chain information: Information { scheduled: 500, requested: 423, verifying: 1, stored: 17507 }
INFO:sync::synchronization_client: Processed 1494 blocks in 0.43728403099885327 seconds. Chain information: Information { scheduled: 498, requested: 498, verifying: 0, stored: 18929 }
INFO:sync::synchronization_client: Processed 1108 blocks in 0.44706783999936306 seconds. Chain information: Information { scheduled: 984, requested: 1054, verifying: 0, stored: 18995 }
INFO:sync::synchronization_client: Processed 1228 blocks in 0.154804622001393 seconds. Chain information: Information { scheduled: 1966, requested: 1217, verifying: 0, stored: 19078 }
INFO:sync::synchronization_client: Processed 1256 blocks in 0.12818571100069676 seconds. Chain information: Information { scheduled: 3460, requested: 907, verifying: 0, stored: 19150 }
INFO:sync::synchronization_client: Processed 1287 blocks in 0.15298957100094412 seconds. Chain information: Information { scheduled: 4442, requested: 1124, verifying: 0, stored: 19238 }
INFO:sync::synchronization_client: Processed 1533 blocks in 0.3928036670004076 seconds. Chain information: Information { scheduled: 4400, requested: 1093, verifying: 1418, stored: 19426 }
WARN:sync::synchronization_client: Out-of-order block 155278d80032eb3e2d81e95836d46562bda7bf395dfb13ff3393641600000000 was dropped. Expecting block with parent hash 32d6d2b87b2fbd6b327a13bc156b6884d899cd661fbf4a139eb1881b00000000
WARN:sync::synchronization_client: Out-of-order block 67cbfb02a5c0c9888352289421ab95942835c9ee6a7e0107566d8a4d00000000 was dropped. Expecting block with parent hash 32d6d2b87b2fbd6b327a13bc156b6884d899cd661fbf4a139eb1881b00000000
INFO:sync::synchronization_client: Processed 1556 blocks in 0.028416120996553218 seconds. Chain information: Information { scheduled: 4400, requested: 937, verifying: 2693, stored: 19863 }
WARN:sync::synchronization_client: Out-of-order block eabd32a6c9dbbaceb7d557ccab73471509f5c706578cedf46c8f47b700000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 4c6c533a7759a2e0bc40e0dbe04f0678eb10b8984a6b6324028cdb1300000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 899daae194d1126bef931bdcc68ec7b51222687d05921420c887a58400000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 7ce271cc6a9cd1b084f73c2f196b1f4bac4d0ceb7181318a349e650e00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 5e2371d32a5add48b728f7b8fbc6a5c4da3b142006b6b201d773648600000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block cf8a1242ff640edacdeb5da691072b5707161b6b13b9c6c24b6c427b00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block a4f44647ed61841be89dbde49dac2b60fa27263a58b676c2a51abddc00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 738d7a99063462550c0504015740ae54d585446a748bae17658e974200000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block db57c2c6b95119a1d20e130883c0b49308115461b5cea5d5345098de00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block d4b6df4891125f33c3285029a58ca0984a6304169eba166efad45e9500000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 960edc462aa823dd5de024d1b602c82cd3a7de9376c4b336c7ea1d6b00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 44845bb0523b64b8105aa351aaa4b0bae40377cb2581b301e3070fdf00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 9260cb394bbec5deae0df84d8a6dcca4e777f9614c5412a67df4eca700000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block e512ac2388cef3296115cef96bb245898d4f9574ca051a9008aa7f8a00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 5a5584201165cfbd9f983ce614e05b01cb00699477434fe4b3d8001800000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block a5d1379139e0f9f4722a41017db87899b7e14a9c7bb1115aee38c92700000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 9b3f76a66dcc7001d0d15a45af0ade4f8d9bc60b293c1ab7eac1f1e800000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block ba70f5ee612ebe0894e7ec7e811f6b9ae520c40dd60673430e4657ce00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block adcd3ae50700effdb41305bf82a87cd54d03e7a2cd945e5ef14a89a800000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block c299c169c15b93a85a471bfc845fa3a4aa5196063c4cc9ef3af28b1800000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 5e46db6d43b2a32981f68c43016897eae1cc55b0f0386d9c1264b5d600000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block fdb789e6afecfb2c79dc804c816b5e7e21723028f2368c6477f70a1a00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 97e5c23f7fa9c2546d1d8514b926defef1e0b93d6cbda8b76357e2d900000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 9adf5cafc081d4508e1d7f26937b3121938d35ba346211233bb3b51b00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block d7c9d99d4c4ef9788f7c80c7cf9f6726ca2cd5437554951b28c5002b00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block bff6c1378302832a9030ee699f215c80ccd587cef9aaf6a294d72c2400000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 3d52d58ff1dc273bdcf91c8f938580ed7ed67579addf20f02eb6279400000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block e09a5058422432395a88a449d8568f974ce4d10694f038907feb4d5a00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block e3c12eececd0cbda35b9485b048a7a9a5f1f8cbbf80fdff11a3de22d00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block ad3b0df85274ec22949b9308c1c62013ff8b2fdf43bd55e6230d905700000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block a0d76d10c78f9a7ede4fa4a56c04e78c6292a5656af1183234a9edb900000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block dfda99c0c85105ef57e4d43767a75beac162659246d0116cc52d2fc000000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 213a631c4403c1af86419493a8d88ddb5a58d5b970233fb3fc62720b00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 70395438608f02836db77180d350a728802d5d9e35d7fef4bc1b23b500000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 10dd505821cdd8ddd28192eb3b46e3b3430124e8991f3da103527db000000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 16ae1b6d9427d139fd9b9db7e1e361279cbff5698bc226909a1e9e7a00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block c9d75a180a20fee9fd2aa717b4a6d87308aa3b4b7b59280531de9be800000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block b04145754a2e15be94d9dbb89d06c1009db9f8d007d318c680de21d200000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block e1a0216739a579b504c83e8f01f549e041ad67b5fa0ddb8fc2640add00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 147ed2ea6f3a922319f0fa54b380378984409c604bea311f8d2d2ea600000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 1e85be025093568fb10269f3bf5a3bad9d275f568470d51a8fe75b1200000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block bffd249d2e83cfeb1c9e6f8ad7061626896ba47f35932a188baaad8d00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block a86b6fbdb435793e19f4ca3e8fd5f9ea227cb4a493aaa79c8abf762300000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 00794e410a0d84143222fa0942cddc8b5eea777401e9fb6a46d5359d00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 283b75ba4fbc3f6631ba783a4594bc3b2df994149202d8b8813bb84600000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block e38bf89b1025754e27b102f6f8c3da5d74abc2588f507b595c80a25c00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block c4ed40f1549891ad41c61fee704c998a787c06cd860ae6b9fb17aac500000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 7889e78fdddbe5ada4b2f335fe281c51b8793f76da831a50caf439e000000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 54463e5a5d6abc46d7005c0afa8ae6e10dfa2b317041338b2f6bb91a00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block d7a860286e867e76c099f441d010638a8229d7c83cad3742f20b2a9600000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block f6782bcd05ff1fddf97d1a8ac4f2d35356cdd3d20bce94e16f346ce300000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 65d671ff8bf68ebb6df4b4833ced373c9f9abf025bd96cc1454382e700000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 2b4173373e5e7efd7193aab010f709e54ed7553686bb3c5a6003822300000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 347adef3a572054d2b37351021655d7bf681aababf456ec99f108c7500000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block e4cc5e071331a7ef7894089b39f41de3fb3bde14dd8fe5658db0600c00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block af3ee9656576686da092fb0532dd41974caf9e70f1169128bad6e89700000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block c6f9e37701cfab471d7fbc45628bdfb25a0d334573118e8395d72f9800000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block c803f6234296684391f69f10c28e82c48ad42ebcd1a7a160000d35b100000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block c0d43748f65f569b41eda689aab8bc7efb4f87c34ed0fce52d2b6f3000000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 039c7955f38a546a3542bafd182097707a91501d5ccaa3e578eaacef00000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000
WARN:sync::synchronization_client: Out-of-order block 10dd8fc14068ce2da2ebe7d43d1f828ce651e8e8542c9379c12c896700000000 was dropped. Expecting block with parent hash 4068b72fa6877c5204f8a85a0c9662c2cbc06d4d1629890316bf6e1400000000

Deadline blockers tracking issue

It would be good to deliver alpha version of client by dec 2. The client should be able to:

  • fully sync from network (both mainnet and testnet)
  • verify all the blocks along the way
  • fix regtests
  • load blockchain from file (using import functions)

We can discuss any blockers or long term issues here

Extend Serializable trait

with additional method

fn serialized_size(&self) -> usize {
  // fallback implementation
  serialize(self).len()
}

assertion in hash_queue failed

steps to reproduce. I connected to few peers in parallel

stacktrace

TRACE:p2p::p2p: Received block message from 62.195.227.101:8333
thread '<unnamed>' panicked at 'must be checked by caller', sync/src/hash_queue.rs:110
stack backtrace:
   1:        0x108f14c89 - std::sys::backtrace::tracing::imp::write::hd4b54a4a2078cb15
   2:        0x108f18490 - std::panicking::default_hook::_{{closure}}::h51a5ee7ba6a9fcef
   3:        0x108f172f0 - std::panicking::default_hook::hf823fce261e27590
   4:        0x108f17976 - std::panicking::rust_panic_with_hook::h8d486474663979b9
   5:        0x1081c3f43 - std::panicking::begin_panic::h94e6fb50d7864116
   6:        0x10820d3b2 - sync::hash_queue::HashQueue::push_back::h426cecef6e9035fc
   7:        0x10820df35 - sync::hash_queue::HashQueueChain::push_back_at::h843c024a27f0c42e
   8:        0x108218c4d - sync::synchronization_chain::Chain::verify_block_hash::ha6ebf7867a8d146d
   9:        0x1082152d8 - _<sync..synchronization..Synchronization<T>>::process_peer_block::h06d388b235744721
  10:        0x108213eb5 - _<sync..synchronization..Synchronization<T>>::on_peer_block::hd460e5f7ffcc49bd
  11:        0x1082114ac - _<sync..local_node..LocalNode<T>>::on_peer_block::hb3f5948ea38fff7d
  12:        0x10820ea27 - _<sync..inbound_connection..InboundConnection as p2p..protocol..sync..InboundSyncConnection>::on_block::ha5847bdd63bef22a
  13:        0x108b5dae8 - _<p2p..protocol..sync..SyncProtocol as p2p..protocol..Protocol>::on_message::h110f48e2c3a9110d
  14:        0x108b74647 - p2p::session::Session::on_message::_{{closure}}::hbdf798987c9852da
  15:        0x108aaaaaf - core::ops::impls::_<impl core..ops..FnOnce<A> for &'a mut F>::call_once::hb8a17e480083c4bc
  16:        0x108a6de2e - _<core..option..Option<T>>::map::h5575252957ab3335
  17:        0x108b27c34 - _<core..iter..Map<I, F> as core..iter..iterator..Iterator>::next::h432ca8fe64986608
  18:        0x108a6012b - _<<core..result..Result<V, E> as core..iter..traits..FromIterator<core..result..Result<A, E>>>..from_iter..Adapter<Iter, E> as core..iter..iterator..Iterator>::next::h1ad1b82d739008fc
  19:        0x108b0074f - _<&'a mut I as core..iter..iterator..Iterator>::next::h14eaed9e07d627fc
  20:        0x108a75743 - _<collections..vec..Vec<T>>::extend_desugared::h8258e2323939c2c9
  21:        0x108b40a3f - _<collections..vec..Vec<T> as core..iter..traits..FromIterator<T>>::from_iter::ha5b15a415a92594d
  22:        0x108a53536 - _<core..result..Result<V, E> as core..iter..traits..FromIterator<core..result..Result<A, E>>>::from_iter::h925a53f681543508
  23:        0x108aaebbe - core::iter::iterator::Iterator::collect::h3aeddbd3c3f4458b
  24:        0x108b607ff - p2p::session::Session::on_message::h30e1ddd4d2753521
  25:        0x108b83fc4 - p2p::p2p::Context::on_message::_{{closure}}::hcd2fcbf2ea63bcb4
  26:        0x108b76e2f - _<futures..then..Then<A, B, F> as futures..Future>::poll::_{{closure}}::h54ffd8e1dab74ed8
  27:        0x108ade83b - _<futures..chain..Chain<A, B, C>>::poll::hb8e1e68befd5fec9
  28:        0x108b26b2b - _<futures..then..Then<A, B, F> as futures..Future>::poll::hd7a60240222261af
  29:        0x108a93270 - _<Box<F> as futures..Future>::poll::h9c4857a46bc043fa
  30:        0x108b0e07b - futures::catch_unwind::_<impl futures..Future for std..panic..AssertUnwindSafe<F>>::poll::h9fed03d959db7b2d
  31:        0x108b73cb6 - _<futures..catch_unwind..CatchUnwind<F> as futures..Future>::poll::_{{closure}}::h319bc65a636e10d5
  32:        0x108a7e65d - std::panicking::try::do_call::h4339b32eb3c34ab7
  33:        0x108f18a7a - __rust_maybe_catch_panic
  34:        0x108a7d9ac - std::panicking::try::h860fd8c2f6720b53
  35:        0x108a7cdbe - std::panic::catch_unwind::h4aa44042fd78f088
  36:        0x108b0bf9f - _<futures..catch_unwind..CatchUnwind<F> as futures..Future>::poll::h313e76fda1382e95
  37:        0x108a5e257 - _<futures_cpupool..Sender<F, core..result..Result<<F as futures..Future>..Item, <F as futures..Future>..Error>> as futures..Future>::poll::h7802b20ae1bda7db
  38:        0x108d1c081 - _<Box<F> as futures..Future>::poll::h683f5c6503df1de0
  39:        0x108d1c39c - _<futures..task..Spawn<F>>::poll_future::_{{closure}}::h1b50c409ba616ea9
  40:        0x108d1c2fe - _<futures..task..Spawn<T>>::enter::_{{closure}}::h5f6adcc56eff7c14
  41:        0x108d1c1df - futures::task::set::_{{closure}}::h3ab58225858f7fb4
  42:        0x108d15c8a - _<std..thread..local..LocalKey<T>>::with::h6e17502a5d65411d
  43:        0x108d1ae2a - futures::task::set::he94844b036bd9d85
  44:        0x108d1b361 - _<futures..task..Spawn<T>>::enter::hf171e31bfacb20c6
  45:        0x108d1b1b2 - _<futures..task..Spawn<F>>::poll_future::hde89f4cf6464c5ac
  46:        0x108d1b5c2 - futures::task::Run::run::h8fe690a96be24805
  47:        0x108d0af75 - futures_cpupool::work::hbfdd44854e0914ea
  48:        0x108d0bddd - futures_cpupool::Builder::create::_{{closure}}::hae1b82701e391f9d
  49:        0x108d0a6eb - _<std..panic..AssertUnwindSafe<F> as core..ops..FnOnce<()>>::call_once::hd9843cd8ca7e484f
  50:        0x108d00c9a - std::panicking::try::do_call::h2c16039dba30e2a0
  51:        0x108f18a7a - __rust_maybe_catch_panic
  52:        0x108d00a29 - std::panicking::try::hc122fe0b368cf21a
  53:        0x108cffdfa - std::panic::catch_unwind::hc68481d4edb4a92b
  54:        0x108d0ba75 - std::thread::Builder::spawn::_{{closure}}::h44203a85c8a5bde2
  55:        0x108d052e3 - _<F as alloc..boxed..FnBox<A>>::call_box::h25d897ee5767a716
  56:        0x108f16a25 - std::sys::thread::Thread::new::thread_start::h57f688c224d4fa4d
  57:     0x7fff8d451aaa - _pthread_body
  58:     0x7fff8d4519f6 - _pthread_start

roadmap

  • primitives
    • hash
    • bytes
  • serialization
    • serialize trait
    • deserialize trait
    • compact integers
    • serialization of primitives
  • crypto
    • ripemd160
    • sha1
    • sha256
    • dhash160
    • dhash256
  • chain
    • transaction
      • serialization
      • tx hash
    • block_header
      • serialization
    • block
      • serialization
      • hash
    • merkle_root
  • base58
  • keys
    • random generation
    • compressed keys
    • addresses
      • P2PKH
      • P2SH
      • serialization to/from string
    • signatures
      • sign
      • sign_compact
      • recover_compact
      • verify
  • script
    • interpreter
      • eval
      • verify
    • pretty display
    • signing transaction input
  • message
    • common
    • message types
    • serialization
  • p2p
    • handshake
    • dispatching messages
  • CI
    • travis for private repos
    • coveralls
    • documentation

Panic in HashQueue when block verification failed (BIP65)

Block https://blockexplorer.com/block/000000000000074006e067120f51b576e9cfb31f31d8d9212d6416748e650685 verification error because of BIP65

thread '<unnamed>' panicked at 'must be checked by caller', sync/src/hash_queue.rs:122
stack backtrace:
   1:     0x55bc36bd47ea - std::sys::imp::backtrace::tracing::imp::write::he3d1bfbdbf113480
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x55bc36bda27f - std::panicking::default_hook::{{closure}}::h575f1b40d2e88f07
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:247
   3:     0x55bc36bd8126 - std::panicking::default_hook::h3d5dccce8125d0cf
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:263
   4:     0x55bc36bd87d7 - std::panicking::rust_panic_with_hook::h00b81bb3dcbd51f2
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/panicking.rs:451
   5:     0x55bc369124cf - std::panicking::begin_panic::h70ee11343cda1bc2
   6:     0x55bc3692cbbd - sync::hash_queue::HashQueueChain::push_back_n_at::h5be7409bd168bbd5
   7:     0x55bc36933017 - sync::synchronization_chain::Chain::request_blocks_hashes::hf88095bbef93202b
   8:     0x55bc36934a9f - <sync::synchronization_client::SynchronizationClient<T>>::execute_synchronization_tasks::hd00ffecdc1df6217
   9:     0x55bc3693171f - <sync::inbound_connection::InboundConnection as p2p::protocol::sync::InboundSyncConnection>::on_headers::h5c6c090821eaac05
  10:     0x55bc3698135f - <p2p::protocol::sync::SyncProtocol as p2p::protocol::Protocol>::on_message::h6933d7e71e756fe1
  11:     0x55bc36984042 - p2p::session::Session::on_message::hb886a4df390ab75c
  12:     0x55bc369654a1 - <futures::then::Then<A, B, F> as futures::Future>::poll::h648648bd855e0428
  13:     0x55bc3694b070 - std::panicking::try::do_call::h0c5942bc7599637d
  14:     0x55bc36be1d5a - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libpanic_unwind/lib.rs:97
  15:     0x55bc3694796a - <futures_cpupool::Sender<F, core::result::Result<<F as futures::Future>::Item, <F as futures::Future>::Error>> as futures::Future>::poll::ha412df73c1eb960f
  16:     0x55bc36a2405b - futures::task::Run::run::h365a03c70d195c4b
  17:     0x55bc3699aa6f - std::panicking::try::do_call::h3aedbbe95cce7999
  18:     0x55bc36be1d5a - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libpanic_unwind/lib.rs:97
  19:     0x55bc3699b281 - <F as alloc::boxed::FnBox<A>>::call_box::h46003cea5b0ff514
  20:     0x55bc36bd7804 - std::sys::imp::thread::Thread::new::thread_start::h990fb082eb5abe34
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/liballoc/boxed.rs:605
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys_common/thread.rs:21
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/obj/../src/libstd/sys/unix/thread.rs:84
  21:     0x7f6bc49de709 - start_thread
  22:     0x7f6bc44fe82c - clone
  23:                0x0 - <unknown>

bip30 implemented in chain_verifier is suboptimal and may lead to fork

the following scenario is possible in pr #199

The solution is checking bip30 inside during block canonization in Storage::upate_transactions_meta. The disadvantage of this solution is that Storage would have to now about bip30 exceptions.

BIP30

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.