The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.

Overview

Nervos CKB - The Common Knowledge Base

Version Telegram Group Nervos Talk

master develop
TravisCI TravisCI

About CKB

CKB is the layer 1 of Nervos Network, a public/permissionless blockchain. CKB uses Proof of Work and improved Nakamoto consensus to achieve maximized performance on average hardware and internet condition, without sacrificing decentralization and security which are the core value of blockchain.

CKB supports scripting in any programming language with its own CKB-VM, a virtual machine fully compatible with RISC-V ISA. CKB is a General Verification Network, its programming model focuses on state verification, leaves state generation to layer 2 applications/protocols.

Nervos project defines a suite of scalable and interoperable blockchain protocols to create a self-evolving distributed economy, CKB is among them.

Support for different platforms are organized into three tiers, each with a different set of guarantees.

Notice: The ckb process will send stack trace to sentry on Rust panics. This is enabled by default before mainnet, which can be opted out by setting the option dsn to empty in the config file.

Join a Network

  • Mainnet Lina: Use the latest release and run ckb init --chain mainnet to initialize the node.
  • Testnet Aggron: Use the latest release and run ckb init --chain testnet to initialize the node.

See more networks to join in the wiki.

Mining

CKB uses the Eaglesong mining algorithm.

License FOSSA Status

Nervos CKB is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

This project is still in development, and it's NOT in production-ready status. The board also lists some known issues that we are currently working on.

The master branch is regularly built and tested, however, it is not guaranteed to be completely stable; The develop branch is the work branch to merge new features, and it's not stable. The CHANGELOG is available in Releases and CHANGELOG.md in the master branch.

How to Contribute

The contribution workflow is described in CONTRIBUTING.md, and security policy is described in SECURITY.md. To propose new protocol or standard for Nervos, see Nervos RFC.

Minimum Supported Rust Version policy (MSRV)

The crate ckb's minimum supported rustc version is 1.46.0.


Documentations

Latest version is hosted in GitHub.

The default branch in GitHub is develop, if you are looking for docs for the Mainnet Lina or Testnet Aggron, switch to the branch master.

You can find a more comprehensive document website at https://docs.nervos.org.

Comments
  • feat: Optimize block download tasks with a simple task scheduler

    feat: Optimize block download tasks with a simple task scheduler

    This implementation aims to optimize the task scheduling of the download block.

    It contains a simple task counter to allocate the number of tasks for each node, record and filter the relatively good nodes for download.

    After about a week of testing and continuous adjustments, the current PR data is relatively satisfactory, but the possibility of continued adjustments in the future is not ruled out

    This PR changes a number of things, including but not limited:

    1. Raise the maximum inflight block limit per node to 32-128, but the default is 16, and dynamically adjust this data
    2. Remove redundant designs where the same block can be requested from two nodes
    3. ~When inserting a orphan block, the countdown for 1 second at the tip + 1 corresponding to trace_number, if still not completed, clear the task and send it to another node for download (exponentially decreasing the task limit of the corresponding node)~
    4. Split the getBlockTransaction task from the getBlocks task, keeping the design that getBlockTransaction can request from 2 nodes
    5. Clearing out nodes that are peer_best_known < tip in IBD time
    6. Separating the block fetch process
    7. Clearing nodes that do not respond to getblock requests for 30 seconds
    8. mark timeout on all < tip +1 block request if request window > tip + 512
    9. Reduce the consumption of checking the maximum timeout time, from check all inflight to check all Less than tip + 20

    Test machine configuration: 2 core 8G RAM IP Location on Hong Kong

    $ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
    2  Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
    

    before:

    | net state | outbound | average speed | CPU occupancy | Bandwidth consumption | - | - | - | - | - | | relatively good | 8 peer | 102-120 block/s | average 70.49%, max 92.77% | average 4 Mbps, max 7.12 Mbps | relatively poor | 8 peer | 93-100 block/s | average 49.99%, max 74.37% | average 4 Mbps, max 7.12 Mbps

    after:

    | net state | outbound | average speed | CPU occupancy | Bandwidth consumption | - | - | - | - | - | | relatively good | 8 peer | 219-240 block/s | average 78.34%, max 93.17% | average 2Mbps, max 5.52 Mbps | relatively poor | 8 peer | 200-220 block/s | average 70.06%, max 85.83% | average 3 Mbps, max 19.55 Mbps

    opened by driftluo 33
  • Revert chain_root field

    Revert chain_root field

    Need more research on light client protocol, revert the chain_root for now, we can make a hard-fork to add it back after we decide the light client protocol.

    revert https://github.com/nervosnetwork/ckb/pull/1518

    s:ready-to-merge 
    opened by jjyr 25
  • perf: use KeyedPriorityQueue to replace BTreeMap/HashSet

    perf: use KeyedPriorityQueue to replace BTreeMap/HashSet

    This PR optimized tx_ask_for related code, replace tx_ask_for_map/tx_ask_for_set with one KeyedPriorityQueue, avoids unnecessary hashset operation in remove_ask_for_tx and pop_ask_for_txs fn.

    And the memory layout is also optimized:

    1. the vec in tx_ask_for_map is removed.
    2. inflight_transactions is removed.
    3. tx_ask_for is traced in the global state (renamed to unknown_tx_hashes)
    opened by quake 23
  • feat(hardfork): ckb2021 hardfork features

    feat(hardfork): ckb2021 hardfork features

    Suggestions for Review

    The best way to review this PR is reviewing each commit independently.

    Brief introduction for Commits

    New hardfork Features

    All following features can be found in RFC PRs.

    Other Important Commits

    • feat(hardfork): setup the components for hard fork features

    • refactor: let verifiers know the real environment that the transaction is in

      Almost all features require this refactor commit.

    • refactor: remove useless parameter "with_data" because it always be true (tricky)

      So I can change less APIs and less code to apply the feature: allow loading uncommitted cell data hashes from tx pool.

    About Tests

    Almost all features have detailed integration tests (or unit tests):

    • Many blocks before hardfork;
    • Only one block before hardfork;
    • The block at hardfork;
    • Many blocks after hardfork.

    All commits can passed all integration tests and unit tests.

    ckb2021 
    opened by yangby-cryptape 20
  • feat: sort txs by indirect dep

    feat: sort txs by indirect dep

    Previously, BlockAssembler selection has not considered such a situation

    This pr rewrite this part, make sure transaction selection including all unconfirmed ancestors.

    opened by zhangsoledad 19
  • fix: remove unsupport configurations in Cargo.toml

    fix: remove unsupport configurations in Cargo.toml

    The Issue

    Here is a potential issue which was introduced by #1940.

    • Since our rust-toolchain is still be 1.41.0, there will be no errors or warnings when we build the project. (This is why #1940 was merged)

      https://github.com/nervosnetwork/ckb/blob/22829ae85db1643480bd810150f9619250aac92e/rust-toolchain#L1

    • But if you update the rust-toolchain to 1.42.0, when you build the whole project (just execute make prod), you will get two warnings:

      warning: ckb/Cargo.toml: Found feature = ... in target.'cfg(...)'.dependencies. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html warning: ckb/Cargo.toml: Found feature = ... in target.'cfg(...)'.dependencies. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html

    ~~Although I haven't found any evidences now, I still strongly suspect that it was related to our recent memory leak.~~ After a lot of tests, I think this issue was not related to our recent memory leak. But it's still a bug.

    My Solution

    I read a lot of issues about cargo in few weeks, I didn't find any official / standard solution to fix it, and I thought they wouldn't fix it in few months. (build.rs can't fix it, too)

    So, I use a complex and dirty way to fix it, just review the code, please.

    How can I prove my modification was valid?

    • Please check this example, I have run it under Debian Buster and Windows 10.

    • I have build various kinds of CKB with different features and check a lot logs of them under Debian Buster.

    A Very Important Note

    If any features of a rust bindings (to c library) crate was changed, please do cargo clean before build the project.

    Some C libraries wouldn't re-compile by cargo after features changed, for example, jemalloc-sys.

    opened by yangby-cryptape 15
  • fix: tx sorted_keys order by relation

    fix: tx sorted_keys order by relation

    Before this part, https://github.com/nervosnetwork/ckb/blob/develop/test/src/specs/indexer/basic.rs#L59-L75 code's log is that

    2019-10-15 11:49:52.672 +08:00 ChainService INFO ckb-chain  block: 13, hash: Byte32(0x75cddba4ee0b6b15a03be7667c3e44af045282dfc0b151699be84cd4eb275556), total_diff: 0xe00, txs: 1
    2019-10-15 11:49:52.673 +08:00 http.worker3 DEBUG ckb-rpc  [block_relay] announce new block 13 Byte32(0x75cddba4ee0b6b15a03be7667c3e44af045282dfc0b151699be84cd4eb275556) 1571111392673
    2019-10-15 11:49:52.675 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0x569c112c72a1248a12ece2bd1c1fbdd793d9b4ea698b93c60af21fe45efd9f42)
    2019-10-15 11:49:52.676 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0x2ab01fcf0ab6fa29d8ce39f61285002ec69d30d70257aac9e0b216b856642b35)
    2019-10-15 11:49:53.614 +08:00 NetworkRuntime-8 DEBUG ckb-sync  no peers connected
    2019-10-15 11:49:52.678 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  Failed to add tx to gap Byte32(0x2ab01fcf0ab6fa29d8ce39f61285002ec69d30d70257aac9e0b216b856642b35), reason: Error { kind: Unknown([OutPoint(0x932358f16963610f3cd38fda5ed55c85b1aca0c37faeecece79fec1471b1013700000000)])
    
    stack backtrace:
       0: failure::backtrace::internal::InternalBacktrace::new
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/internal.rs:44
       1: failure::backtrace::Backtrace::new
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/mod.rs:111
       2: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/error_impl.rs:19
       3: <failure::error::Error as core::convert::From<F>>::from
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/mod.rs:36
       4: <T as core::convert::Into<U>>::into
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/convert.rs:544
       5: failure::context::Context<D>::with_err
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/context.rs:105
       6: failure::Fail::context
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/lib.rs:160
       7: ckb_types::core::error::<impl core::convert::From<ckb_types::core::error::OutPointError> for ckb_error::Error>::from
                 at util/types/src/core/error.rs:36
       8: <T as core::convert::Into<U>>::into
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/convert.rs:544
       9: ckb_types::core::cell::resolve_transaction
                 at /home/u2/nervos/ckb/util/types/src/core/cell.rs:445
      10: ckb_tx_pool::pool::TxPool::resolve_tx_from_pending_and_proposed
                 at tx-pool/src/pool.rs:324
      11: ckb_tx_pool::pool::TxPool::gap_tx
                 at tx-pool/src/pool.rs:560
      12: ckb_tx_pool::process::chain_reorg::update_tx_pool_for_reorg
                 at tx-pool/src/process/chain_reorg.rs:197
      13: <ckb_tx_pool::process::chain_reorg::ChainReorgProcess as futures::future::Future>::poll
                 at tx-pool/src/process/chain_reorg.rs:57
      14: futures::future::chain::Chain<A,B,C>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/chain.rs:42
      15: <futures::future::and_then::AndThen<A,B,F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/and_then.rs:32
      16: <futures::future::map::Map<A,F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/map.rs:30
      17: <alloc::boxed::Box<F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
      18: <alloc::boxed::Box<F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
      19: futures::task_impl::Spawn<T>::poll_future_notify::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
      20: futures::task_impl::Spawn<T>::enter::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
      21: futures::task_impl::std::set
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/std/mod.rs:83
      22: futures::task_impl::Spawn<T>::enter
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
      23: futures::task_impl::Spawn<T>::poll_fn_notify
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:291
      24: futures::task_impl::Spawn<T>::poll_future_notify
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
      25: tokio_threadpool::task::Task::run::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/task/mod.rs:145
      26: core::ops::function::FnOnce::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/ops/function.rs:235
      27: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:315
      28: std::panicking::try::do_call
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:296
      29: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:80
      30: std::panicking::try
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:275
      31: std::panic::catch_unwind
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:394
      32: tokio_threadpool::task::Task::run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/task/mod.rs:130
      33: tokio_threadpool::worker::Worker::run_task2
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:567
      34: tokio_threadpool::worker::Worker::run_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:459
      35: tokio_threadpool::worker::Worker::try_steal_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:416
      36: tokio_threadpool::worker::Worker::try_run_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:301
      37: tokio_threadpool::worker::Worker::run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:241
      38: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:390
      39: tokio_timer::timer::handle::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/timer/handle.rs:94
      40: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      41: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      42: tokio_timer::timer::handle::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/timer/handle.rs:81
      43: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:382
      44: tokio_timer::clock::clock::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/clock/clock.rs:141
      45: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      46: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      47: tokio_timer::clock::clock::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/clock/clock.rs:124
      48: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:381
      49: tokio_reactor::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.9/src/lib.rs:237
      50: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      51: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      52: tokio_reactor::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.9/src/lib.rs:217
      53: tokio::runtime::threadpool::builder::Builder::build::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:380
      54: tokio_threadpool::callback::Callback::call
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/callback.rs:22
      55: tokio_threadpool::worker::Worker::do_run::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:127
      56: tokio_executor::global::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:209
      57: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      58: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      59: tokio_executor::global::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:178
      60: tokio_threadpool::worker::Worker::do_run::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:125
      61: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      62: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      63: tokio_threadpool::worker::Worker::do_run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:116
      64: tokio_threadpool::pool::Pool::spawn_thread::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/pool/mod.rs:344
      65: std::sys_common::backtrace::__rust_begin_short_backtrace
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/sys_common/backtrace.rs:77
      66: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/mod.rs:470
      67: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:315
      68: std::panicking::try::do_call
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:296
      69: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:80
      70: std::panicking::try
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:275
      71: std::panic::catch_unwind
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:394
      72: std::thread::Builder::spawn_unchecked::{{closure}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/mod.rs:469
      73: core::ops::function::FnOnce::call_once{{vtable.shim}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/ops/function.rs:235
      74: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/boxed.rs:787
      75: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/boxed.rs:787
          std::sys_common::thread::start_thread
                 at src/libstd/sys_common/thread.rs:13
          std::sys::unix::thread::Thread::new::thread_start
                 at src/libstd/sys/unix/thread.rs:79
      76: start_thread
      77: clone
    
    
    OutPoint }
    2019-10-15 11:49:54.378 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0x932358f16963610f3cd38fda5ed55c85b1aca0c37faeecece79fec1471b10137)
    2019-10-15 11:49:54.380 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  Failed to add tx to gap Byte32(0x932358f16963610f3cd38fda5ed55c85b1aca0c37faeecece79fec1471b10137), reason: Error { kind: Unknown([OutPoint(0xe8886863772aee87460dbfff3ddbb06adcc4c7286492b49a13bcc82ec667bf7800000000)])
    
    stack backtrace:
       0: failure::backtrace::internal::InternalBacktrace::new
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/internal.rs:44
       1: failure::backtrace::Backtrace::new
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/mod.rs:111
       2: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/error_impl.rs:19
       3: <failure::error::Error as core::convert::From<F>>::from
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/mod.rs:36
       4: <T as core::convert::Into<U>>::into
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/convert.rs:544
       5: failure::context::Context<D>::with_err
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/context.rs:105
       6: failure::Fail::context
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/lib.rs:160
       7: ckb_types::core::error::<impl core::convert::From<ckb_types::core::error::OutPointError> for ckb_error::Error>::from
                 at util/types/src/core/error.rs:36
       8: <T as core::convert::Into<U>>::into
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/convert.rs:544
       9: ckb_types::core::cell::resolve_transaction
                 at /home/u2/nervos/ckb/util/types/src/core/cell.rs:445
      10: ckb_tx_pool::pool::TxPool::resolve_tx_from_pending_and_proposed
                 at tx-pool/src/pool.rs:324
      11: ckb_tx_pool::pool::TxPool::gap_tx
                 at tx-pool/src/pool.rs:560
      12: ckb_tx_pool::process::chain_reorg::update_tx_pool_for_reorg
                 at tx-pool/src/process/chain_reorg.rs:197
      13: <ckb_tx_pool::process::chain_reorg::ChainReorgProcess as futures::future::Future>::poll
                 at tx-pool/src/process/chain_reorg.rs:57
      14: futures::future::chain::Chain<A,B,C>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/chain.rs:42
      15: <futures::future::and_then::AndThen<A,B,F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/and_then.rs:32
      16: <futures::future::map::Map<A,F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/map.rs:30
      17: <alloc::boxed::Box<F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
      18: <alloc::boxed::Box<F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
      19: futures::task_impl::Spawn<T>::poll_future_notify::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
      20: futures::task_impl::Spawn<T>::enter::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
      21: futures::task_impl::std::set
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/std/mod.rs:83
      22: futures::task_impl::Spawn<T>::enter
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
      23: futures::task_impl::Spawn<T>::poll_fn_notify
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:291
      24: futures::task_impl::Spawn<T>::poll_future_notify
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
      25: tokio_threadpool::task::Task::run::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/task/mod.rs:145
      26: core::ops::function::FnOnce::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/ops/function.rs:235
      27: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:315
      28: std::panicking::try::do_call
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:296
      29: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:80
      30: std::panicking::try
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:275
      31: std::panic::catch_unwind
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:394
      32: tokio_threadpool::task::Task::run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/task/mod.rs:130
      33: tokio_threadpool::worker::Worker::run_task2
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:567
      34: tokio_threadpool::worker::Worker::run_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:459
      35: tokio_threadpool::worker::Worker::try_steal_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:416
      36: tokio_threadpool::worker::Worker::try_run_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:301
      37: tokio_threadpool::worker::Worker::run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:241
      38: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:390
      39: tokio_timer::timer::handle::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/timer/handle.rs:94
      40: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      41: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      42: tokio_timer::timer::handle::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/timer/handle.rs:81
      43: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:382
      44: tokio_timer::clock::clock::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/clock/clock.rs:141
      45: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      46: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      47: tokio_timer::clock::clock::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/clock/clock.rs:124
      48: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:381
      49: tokio_reactor::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.9/src/lib.rs:237
      50: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      51: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      52: tokio_reactor::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.9/src/lib.rs:217
      53: tokio::runtime::threadpool::builder::Builder::build::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:380
      54: tokio_threadpool::callback::Callback::call
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/callback.rs:22
      55: tokio_threadpool::worker::Worker::do_run::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:127
      56: tokio_executor::global::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:209
      57: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      58: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      59: tokio_executor::global::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:178
      60: tokio_threadpool::worker::Worker::do_run::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:125
      61: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      62: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      63: tokio_threadpool::worker::Worker::do_run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:116
      64: tokio_threadpool::pool::Pool::spawn_thread::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/pool/mod.rs:344
      65: std::sys_common::backtrace::__rust_begin_short_backtrace
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/sys_common/backtrace.rs:77
      66: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/mod.rs:470
      67: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:315
      68: std::panicking::try::do_call
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:296
      69: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:80
      70: std::panicking::try
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:275
      71: std::panic::catch_unwind
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:394
      72: std::thread::Builder::spawn_unchecked::{{closure}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/mod.rs:469
      73: core::ops::function::FnOnce::call_once{{vtable.shim}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/ops/function.rs:235
      74: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/boxed.rs:787
      75: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/boxed.rs:787
          std::sys_common::thread::start_thread
                 at src/libstd/sys_common/thread.rs:13
          std::sys::unix::thread::Thread::new::thread_start
                 at src/libstd/sys/unix/thread.rs:79
      76: start_thread
      77: clone
    
    
    OutPoint }
    2019-10-15 11:49:54.388 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0xe8886863772aee87460dbfff3ddbb06adcc4c7286492b49a13bcc82ec667bf78)
    2019-10-15 11:49:54.389 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  Failed to add tx to gap Byte32(0xe8886863772aee87460dbfff3ddbb06adcc4c7286492b49a13bcc82ec667bf78), reason: Error { kind: Unknown([OutPoint(0xd7e002e771e6e71f2bb82f5dea563c88b87bf0a42855e92b05619186e7b59aaf00000000)])
    
    stack backtrace:
       0: failure::backtrace::internal::InternalBacktrace::new
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/internal.rs:44
       1: failure::backtrace::Backtrace::new
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/mod.rs:111
       2: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/error_impl.rs:19
       3: <failure::error::Error as core::convert::From<F>>::from
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/mod.rs:36
       4: <T as core::convert::Into<U>>::into
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/convert.rs:544
       5: failure::context::Context<D>::with_err
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/context.rs:105
       6: failure::Fail::context
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/lib.rs:160
       7: ckb_types::core::error::<impl core::convert::From<ckb_types::core::error::OutPointError> for ckb_error::Error>::from
                 at util/types/src/core/error.rs:36
       8: <T as core::convert::Into<U>>::into
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/convert.rs:544
       9: ckb_types::core::cell::resolve_transaction
                 at /home/u2/nervos/ckb/util/types/src/core/cell.rs:445
      10: ckb_tx_pool::pool::TxPool::resolve_tx_from_pending_and_proposed
                 at tx-pool/src/pool.rs:324
      11: ckb_tx_pool::pool::TxPool::gap_tx
                 at tx-pool/src/pool.rs:560
      12: ckb_tx_pool::process::chain_reorg::update_tx_pool_for_reorg
                 at tx-pool/src/process/chain_reorg.rs:197
      13: <ckb_tx_pool::process::chain_reorg::ChainReorgProcess as futures::future::Future>::poll
                 at tx-pool/src/process/chain_reorg.rs:57
      14: futures::future::chain::Chain<A,B,C>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/chain.rs:42
      15: <futures::future::and_then::AndThen<A,B,F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/and_then.rs:32
      16: <futures::future::map::Map<A,F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/map.rs:30
      17: <alloc::boxed::Box<F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
      18: <alloc::boxed::Box<F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
      19: futures::task_impl::Spawn<T>::poll_future_notify::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
      20: futures::task_impl::Spawn<T>::enter::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
      21: futures::task_impl::std::set
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/std/mod.rs:83
      22: futures::task_impl::Spawn<T>::enter
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
      23: futures::task_impl::Spawn<T>::poll_fn_notify
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:291
      24: futures::task_impl::Spawn<T>::poll_future_notify
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
      25: tokio_threadpool::task::Task::run::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/task/mod.rs:145
      26: core::ops::function::FnOnce::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/ops/function.rs:235
      27: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:315
      28: std::panicking::try::do_call
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:296
      29: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:80
      30: std::panicking::try
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:275
      31: std::panic::catch_unwind
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:394
      32: tokio_threadpool::task::Task::run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/task/mod.rs:130
      33: tokio_threadpool::worker::Worker::run_task2
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:567
      34: tokio_threadpool::worker::Worker::run_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:459
      35: tokio_threadpool::worker::Worker::try_steal_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:416
      36: tokio_threadpool::worker::Worker::try_run_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:301
      37: tokio_threadpool::worker::Worker::run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:241
      38: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:390
      39: tokio_timer::timer::handle::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/timer/handle.rs:94
      40: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      41: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      42: tokio_timer::timer::handle::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/timer/handle.rs:81
      43: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:382
      44: tokio_timer::clock::clock::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/clock/clock.rs:141
      45: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      46: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      47: tokio_timer::clock::clock::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/clock/clock.rs:124
      48: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:381
      49: tokio_reactor::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.9/src/lib.rs:237
      50: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      51: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      52: tokio_reactor::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.9/src/lib.rs:217
      53: tokio::runtime::threadpool::builder::Builder::build::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:380
      54: tokio_threadpool::callback::Callback::call
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/callback.rs:22
      55: tokio_threadpool::worker::Worker::do_run::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:127
      56: tokio_executor::global::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:209
      57: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      58: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      59: tokio_executor::global::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:178
      60: tokio_threadpool::worker::Worker::do_run::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:125
      61: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      62: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      63: tokio_threadpool::worker::Worker::do_run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:116
      64: tokio_threadpool::pool::Pool::spawn_thread::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/pool/mod.rs:344
      65: std::sys_common::backtrace::__rust_begin_short_backtrace
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/sys_common/backtrace.rs:77
      66: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/mod.rs:470
      67: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:315
      68: std::panicking::try::do_call
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:296
      69: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:80
      70: std::panicking::try
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:275
      71: std::panic::catch_unwind
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:394
      72: std::thread::Builder::spawn_unchecked::{{closure}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/mod.rs:469
      73: core::ops::function::FnOnce::call_once{{vtable.shim}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/ops/function.rs:235
      74: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/boxed.rs:787
      75: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/boxed.rs:787
          std::sys_common::thread::start_thread
                 at src/libstd/sys_common/thread.rs:13
          std::sys::unix::thread::Thread::new::thread_start
                 at src/libstd/sys/unix/thread.rs:79
      76: start_thread
      77: clone
    
    
    OutPoint }
    2019-10-15 11:49:54.399 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0xd7e002e771e6e71f2bb82f5dea563c88b87bf0a42855e92b05619186e7b59aaf)
    2019-10-15 11:49:54.400 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  Failed to add tx to gap Byte32(0xd7e002e771e6e71f2bb82f5dea563c88b87bf0a42855e92b05619186e7b59aaf), reason: Error { kind: Unknown([OutPoint(0xcfb64326fb6bd8f244e0370f350786ce932deb97d829f176687f215e487e7f0d00000000)])
    
    stack backtrace:
       0: failure::backtrace::internal::InternalBacktrace::new
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/internal.rs:44
       1: failure::backtrace::Backtrace::new
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/backtrace/mod.rs:111
       2: <failure::error::error_impl::ErrorImpl as core::convert::From<F>>::from
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/error_impl.rs:19
       3: <failure::error::Error as core::convert::From<F>>::from
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/error/mod.rs:36
       4: <T as core::convert::Into<U>>::into
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/convert.rs:544
       5: failure::context::Context<D>::with_err
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/context.rs:105
       6: failure::Fail::context
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/src/lib.rs:160
       7: ckb_types::core::error::<impl core::convert::From<ckb_types::core::error::OutPointError> for ckb_error::Error>::from
                 at util/types/src/core/error.rs:36
       8: <T as core::convert::Into<U>>::into
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/convert.rs:544
       9: ckb_types::core::cell::resolve_transaction
                 at /home/u2/nervos/ckb/util/types/src/core/cell.rs:445
      10: ckb_tx_pool::pool::TxPool::resolve_tx_from_pending_and_proposed
                 at tx-pool/src/pool.rs:324
      11: ckb_tx_pool::pool::TxPool::gap_tx
                 at tx-pool/src/pool.rs:560
      12: ckb_tx_pool::process::chain_reorg::update_tx_pool_for_reorg
                 at tx-pool/src/process/chain_reorg.rs:197
      13: <ckb_tx_pool::process::chain_reorg::ChainReorgProcess as futures::future::Future>::poll
                 at tx-pool/src/process/chain_reorg.rs:57
      14: futures::future::chain::Chain<A,B,C>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/chain.rs:42
      15: <futures::future::and_then::AndThen<A,B,F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/and_then.rs:32
      16: <futures::future::map::Map<A,F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/map.rs:30
      17: <alloc::boxed::Box<F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
      18: <alloc::boxed::Box<F> as futures::future::Future>::poll
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/future/mod.rs:113
      19: futures::task_impl::Spawn<T>::poll_future_notify::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
      20: futures::task_impl::Spawn<T>::enter::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
      21: futures::task_impl::std::set
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/std/mod.rs:83
      22: futures::task_impl::Spawn<T>::enter
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:399
      23: futures::task_impl::Spawn<T>::poll_fn_notify
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:291
      24: futures::task_impl::Spawn<T>::poll_future_notify
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.29/src/task_impl/mod.rs:329
      25: tokio_threadpool::task::Task::run::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/task/mod.rs:145
      26: core::ops::function::FnOnce::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/ops/function.rs:235
      27: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:315
      28: std::panicking::try::do_call
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:296
      29: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:80
      30: std::panicking::try
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:275
      31: std::panic::catch_unwind
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:394
      32: tokio_threadpool::task::Task::run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/task/mod.rs:130
      33: tokio_threadpool::worker::Worker::run_task2
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:567
      34: tokio_threadpool::worker::Worker::run_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:459
      35: tokio_threadpool::worker::Worker::try_steal_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:416
      36: tokio_threadpool::worker::Worker::try_run_task
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:301
      37: tokio_threadpool::worker::Worker::run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:241
      38: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:390
      39: tokio_timer::timer::handle::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/timer/handle.rs:94
      40: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      41: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      42: tokio_timer::timer::handle::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/timer/handle.rs:81
      43: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:382
      44: tokio_timer::clock::clock::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/clock/clock.rs:141
      45: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      46: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      47: tokio_timer::clock::clock::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.10/src/clock/clock.rs:124
      48: tokio::runtime::threadpool::builder::Builder::build::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:381
      49: tokio_reactor::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.9/src/lib.rs:237
      50: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      51: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      52: tokio_reactor::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.9/src/lib.rs:217
      53: tokio::runtime::threadpool::builder::Builder::build::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/builder.rs:380
      54: tokio_threadpool::callback::Callback::call
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/callback.rs:22
      55: tokio_threadpool::worker::Worker::do_run::{{closure}}::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:127
      56: tokio_executor::global::with_default::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:209
      57: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      58: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      59: tokio_executor::global::with_default
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.8/src/global.rs:178
      60: tokio_threadpool::worker::Worker::do_run::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:125
      61: std::thread::local::LocalKey<T>::try_with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:262
      62: std::thread::local::LocalKey<T>::with
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/local.rs:239
      63: tokio_threadpool::worker::Worker::do_run
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/worker/mod.rs:116
      64: tokio_threadpool::pool::Pool::spawn_thread::{{closure}}
                 at /home/u2/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.14/src/pool/mod.rs:344
      65: std::sys_common::backtrace::__rust_begin_short_backtrace
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/sys_common/backtrace.rs:77
      66: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/mod.rs:470
      67: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:315
      68: std::panicking::try::do_call
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:296
      69: __rust_maybe_catch_panic
                 at src/libpanic_unwind/lib.rs:80
      70: std::panicking::try
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panicking.rs:275
      71: std::panic::catch_unwind
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/panic.rs:394
      72: std::thread::Builder::spawn_unchecked::{{closure}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/thread/mod.rs:469
      73: core::ops::function::FnOnce::call_once{{vtable.shim}}
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/ops/function.rs:235
      74: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/boxed.rs:787
      75: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
                 at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/liballoc/boxed.rs:787
          std::sys_common::thread::start_thread
                 at src/libstd/sys_common/thread.rs:13
          std::sys::unix::thread::Thread::new::thread_start
                 at src/libstd/sys/unix/thread.rs:79
      76: start_thread
      77: clone
    
    
    OutPoint }
    2019-10-15 11:49:54.408 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0xcfb64326fb6bd8f244e0370f350786ce932deb97d829f176687f215e487e7f0d)
    2019-10-15 11:49:54.425 +08:00 http.worker3 DEBUG ckb-rpc  [] submit block
    2019-10-15 11:49:54.430 +08:00 ChainService INFO ckb-chain  block: 14, hash: Byte32(0x8678fd4c3802753bc6644899f6d6d78248c1011f2efb60ce3e029e6979d2a6e4), total_diff: 0xf00, txs: 1
    2019-10-15 11:49:54.431 +08:00 http.worker3 DEBUG ckb-rpc  [block_relay] announce new block 14 Byte32(0x8678fd4c3802753bc6644899f6d6d78248c1011f2efb60ce3e029e6979d2a6e4) 1571111394431
    2019-10-15 11:49:54.448 +08:00 GlobalRuntime-2 INFO ckb-tx-pool  [get_block_template] candidate txs count: 6, size: 1452/2157853, cycles:3222/10000000000
    2019-10-15 11:49:54.488 +08:00 http.worker3 DEBUG ckb-rpc  [] submit block
    2019-10-15 11:49:54.517 +08:00 ChainService INFO ckb-chain  [block_verifier] block number: 15, hash: Byte32(0xe7085b46f48cef40cab4b8eb1e0397546287f01838986e4ce18460324778bf02), size:1974/2158375, cycles: 3222/10000000000
    2019-10-15 11:49:54.518 +08:00 ChainService INFO ckb-chain  block: 15, hash: Byte32(0xe7085b46f48cef40cab4b8eb1e0397546287f01838986e4ce18460324778bf02), total_diff: 0x1000, txs: 7
    2019-10-15 11:49:54.520 +08:00 http.worker3 DEBUG ckb-rpc  [block_relay] announce new block 15 Byte32(0xe7085b46f48cef40cab4b8eb1e0397546287f01838986e4ce18460324778bf02) 1571111394520
    
    

    What happened here? There are 6 transactions, tx1 -> tx2 -> tx3 -> tx4 -> tx5 -> tx6, -> means that the before tx is the parent of the after one.

    When we get transactions by sorted_keys, the return is that [tx1, tx6, tx5, tx4, tx3, tx2].

    At here https://github.com/nervosnetwork/ckb/blob/develop/tx-pool/src/process/chain_reorg.rs#L128, https://github.com/nervosnetwork/ckb/blob/develop/tx-pool/src/process/chain_reorg.rs#L197

    These transactions are added to gap, but because some transactions can not be resolved, they are added to orphan. So after https://github.com/nervosnetwork/ckb/blob/develop/test/src/specs/indexer/basic.rs#L62-L70, there are 2 transactions in gap, 4 transactions in orphan.

    When proposing stage https://github.com/nervosnetwork/ckb/blob/develop/tx-pool/src/process/chain_reorg.rs#L180, it will check the orphan again.

    The whole process is weird and complicated. I think all the transactions should be in gap or we should put the transactions in orphan at firstly.

    At firstly I tried to fix it by modifying this part of code https://github.com/nervosnetwork/ckb/blob/develop/tx-pool/src/process/chain_reorg.rs#L145-L162, but after that, I found that https://github.com/nervosnetwork/ckb/blob/develop/tx-pool/src/process/chain_reorg.rs#L128-L138 had the same problem, so I gave up this way, I think the sorted_keys should return the ordered keys by transaction relation.

    After this PR, the log is this

    2019-10-15 14:06:47.718 +08:00 ChainService INFO ckb-chain  block: 13, hash: Byte32(0x59cdd19f33d015c3b3cf0cd4f92e97712d926f112e9d653c65a090089aa841a1), total_diff: 0xe00, txs: 1
    2019-10-15 14:06:47.719 +08:00 http.worker0 DEBUG ckb-rpc  [block_relay] announce new block 13 Byte32(0x59cdd19f33d015c3b3cf0cd4f92e97712d926f112e9d653c65a090089aa841a1) 1571119607719
    2019-10-15 14:06:47.720 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0x569c112c72a1248a12ece2bd1c1fbdd793d9b4ea698b93c60af21fe45efd9f42)
    2019-10-15 14:06:47.721 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0xcfb64326fb6bd8f244e0370f350786ce932deb97d829f176687f215e487e7f0d)
    2019-10-15 14:06:47.722 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0xd7e002e771e6e71f2bb82f5dea563c88b87bf0a42855e92b05619186e7b59aaf)
    2019-10-15 14:06:47.723 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0xe8886863772aee87460dbfff3ddbb06adcc4c7286492b49a13bcc82ec667bf78)
    2019-10-15 14:06:47.723 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0x932358f16963610f3cd38fda5ed55c85b1aca0c37faeecece79fec1471b10137)
    2019-10-15 14:06:47.724 +08:00 GlobalRuntime-1 DEBUG ckb-tx-pool  tx proposed, add to gap Byte32(0x2ab01fcf0ab6fa29d8ce39f61285002ec69d30d70257aac9e0b216b856642b35)
    2019-10-15 14:06:47.738 +08:00 http.worker0 DEBUG ckb-rpc  [] submit block
    2019-10-15 14:06:47.742 +08:00 ChainService INFO ckb-chain  block: 14, hash: Byte32(0x2c4e70c19979bc532abaf6b145a0305501fae885c9ffe37485e31325f36381a2), total_diff: 0xf00, txs: 1
    2019-10-15 14:06:47.742 +08:00 http.worker0 DEBUG ckb-rpc  [block_relay] announce new block 14 Byte32(0x2c4e70c19979bc532abaf6b145a0305501fae885c9ffe37485e31325f36381a2) 1571119607742
    2019-10-15 14:06:47.754 +08:00 GlobalRuntime-2 INFO ckb-tx-pool  [get_block_template] candidate txs count: 6, size: 1452/2157853, cycles:3222/10000000000
    2019-10-15 14:06:47.769 +08:00 http.worker0 DEBUG ckb-rpc  [] submit block
    2019-10-15 14:06:47.781 +08:00 ChainService INFO ckb-chain  [block_verifier] block number: 15, hash: Byte32(0xc73b430bcf9dac68077d860a582e0728fe60fa7ebb732856e6a02eb3a3a285fc), size:1974/2158375, cycles: 3222/10000000000
    2019-10-15 14:06:47.782 +08:00 ChainService INFO ckb-chain  block: 15, hash: Byte32(0xc73b430bcf9dac68077d860a582e0728fe60fa7ebb732856e6a02eb3a3a285fc), total_diff: 0x1000, txs: 7
    2019-10-15 14:06:47.782 +08:00 http.worker0 DEBUG ckb-rpc  [block_relay] announce new block 15 Byte32(0xc73b430bcf9dac68077d860a582e0728fe60fa7ebb732856e6a02eb3a3a285fc) 1571119607782
    2019-10-15 14:06:48.082 +08:00 NetworkRuntime-7 DEBUG ckb-sync  no peers connected
    

    Because of the sorted_keys returned the ordered transactions, the transactions will add to gap instead of orphan.

    t:bug s:ready-to-merge 
    opened by u2 15
  • Upgrade to GitHub-native Dependabot

    Upgrade to GitHub-native Dependabot

    Dependabot Preview will be shut down on August 3rd, 2021. In order to keep getting Dependabot updates, please merge this PR and migrate to GitHub-native Dependabot before then.

    Dependabot has been fully integrated into GitHub, so you no longer have to install and manage a separate app. This pull request migrates your configuration from Dependabot.com to a config file, using the new syntax. When merged, we'll swap out dependabot-preview (me) for a new dependabot app, and you'll be all set!

    With this change, you'll now use the Dependabot page in GitHub, rather than the Dependabot dashboard, to monitor your version updates, and you'll configure Dependabot through the new config file rather than a UI.

    If you've got any questions or feedback for us, please let us know by creating an issue in the dependabot/dependabot-core repository.

    Learn more about migrating to GitHub-native Dependabot

    Please note that regular @dependabot commands do not work on this pull request.

    dependencies 
    opened by dependabot-preview[bot] 14
  • small tx-pool refactoring

    small tx-pool refactoring

    proposal changes:

    • rename ContextualTransactionVerifier -> TimeRelativeTransactionVerifier
    • split NonContextualTransactionVerifier from TransactionVerifier
    • check syntactic correctness first before
    • refactory tx-pool rejection error
    • re-broadcast when duplicated tx submit
    p:must-have 
    opened by zhangsoledad 14
  • refactor: Revise script structure

    refactor: Revise script structure

    • [x] rfc changes: https://github.com/nervosnetwork/rfcs/pull/91
    • [x] ckb-system-scripts: https://github.com/nervosnetwork/ckb-system-scripts/pull/2
    • [x] mruby-contracts: https://github.com/nervosnetwork/mruby-contracts/pull/7
    • [x] ruby sdk: https://github.com/nervosnetwork/ckb-demo-ruby/pull/76
    • [x] ruby scripts: https://github.com/nervosnetwork/ckb-ruby-scripts/pull/9
    • [x] swift sdk
    • [x] java sdk
    • [x] js sdk

    This is a BREAKING CHANGE.

    hotfix s:waiting-on-sdks 
    opened by xxuejie 14
  • feat: remove old version peer from peer store on fork

    feat: remove old version peer from peer store on fork

    1. Remove the behavior of joining the peer store when the session is established, and now only operate the peer store after the identify or feeler is successfully established
    2. After the fork switch, the non-latest version of the node information will be slowly cleaned up, and no longer added to the peer store
    3. Remove unnecessary runtime judgment RefCell
    ckb2021 
    opened by driftluo 13
  • Open Transaction: An Extensible Transaction Format

    Open Transaction: An Extensible Transaction Format

    Project Resources

    Milestones and Deliverables

    • [ ] User Stories Analysis (due:: 2022-10-14)
      • [ ] User Stories Analysis Report
      • [ ] PoC Scope Definition
    • [ ] PoC Development (due:: 2022-11-11)
      • [ ] Open Transaction PoC
    • [ ] Product Design (due:: 2022-12-09)
      • [ ] Product Analysis Report
      • [ ] Alpha Scope Definition
      • [ ] RFCs Proposals
    • [ ] Alpha Development (due:: 2022-01-20)
      • [ ] Open Transaction Alpha

    Project Updates

    I will lock this issue and post updates here as comments. Please subscribe to this issue and use this thread for discussions.

    t:enhancement 
    opened by doitian 0
  • chore: organizing dependencies

    chore: organizing dependencies

    What problem does this PR solve?

    Upgrade some packages to remove duplicate dependencies

        Updating flate2 v1.0.22 -> v1.0.24
        Removing miniz_oxide v0.4.4
    
        Removing hashbrown v0.11.2
        Updating indexmap v1.8.0 -> v1.9.1
    
        Updating getrandom v0.2.4 -> v0.2.7
        Removing wasi v0.10.2+wasi-snapshot-preview1
    
        Removing cast v0.2.7
        Updating criterion-plot v0.4.4 -> v0.4.5
    
        Updating enum-as-inner v0.3.3 -> v0.3.4
        Updating heck v0.3.3 -> v0.4.0
        Removing unicode-segmentation v1.9.0
    

    Check List

    Tests

    • Unit test
    • Integration test

    Release note

    None: Exclude this PR from the release note.
    
    opened by zhangsoledad 0
  • merge indexer

    merge indexer

    What problem does this PR solve?

    Early on, CKB had built-in indexer-related functionality, but because of implementation issues and driven by the micro-kernel design philosophy at the time, we decided to make the indexer independent. As more and more developers gave us feedback about the convenience, the indexer service was an extra burden for development convenience and maintenance, so we rethought the relationship between indexer and ckb-core, and decided to merge indexer into ckb-core, so that developers can start the built-in indexer simply by command-line arguments or configuration

    ckb run -C <path>  --indexer
    

    or

    [rpc]
    modules = ["...", "Indexer"]
    

    instead of downloading a binary and running a separate service.

    Technically speaking, the built-in indexer also has some advantages. With rocksdb's support for second instances, the built-in indexer can directly synchronize data as a secondary_db instead of rpc, building indexes at a speed of about 26%.

    Some notes

    • https://github.com/nervosnetwork/ckb/pull/3598/commits/f42ff4a7e2ef0ab33a3f4a1946ca282bbba994b8 The reason this refactoring is included in this PR is that the original notify uses crossbeam's blocking channel, and the indexer currently spawn into the tokio runtime, so if the indexer needs to subscribe to the transaction pool, it needs to use notify, but the blocking channel is not well handled in tokio's environment, and the spawn_blocking like tokio provides is not very applicable, spawn_blocking feature is intended for blocking operations that eventually finish, the async channel provided by Tokio can call outside of asynchronous contexts, but in turn the blocking channel is not really suitable for async, so here by the way the notify is completely replaced by async channel.

    • util/indexer is based on ckb-indexer v0.4.1, some types used for serialization in util/indexer/src/service.rs should be merged into ckb-json-type, and the PR after this one may do the related refactoring.

    • To distinguish it from the original legacy configuration, the indexer configuration now has v2 as a suffix

    [indexer_v2]
    # Indexing the pending txs in the ckb tx-pool
    index_tx_pool = false
    

    Check List

    Tests

    • Unit test
    • Integration test

    Release note

    Title Only: Include only the PR title in the release note.
    
    opened by zhangsoledad 0
  • feat: Flags features

    feat: Flags features

    What problem does this PR solve?

    Expand the identify flags feature, and introduce some new concepts:

    bitflags::bitflags! {
        pub struct Flags: u64 {
            /// Compatibility reserved
            const COMPATIBILITY = 0b1;
            /// Discovery protocol, which can provide peers data service
            const DISCOVERY = 0b10;
            /// Sync protocol can provide Block and Header download service
            const SYNC = 0b100;
            /// Relay protocol, which can provide CompactBlock and Transaction broadcast/forwarding services
            const RELAY = 0b1000;
            /// Light client protocol, which can provide Block / Transaction data and existence-proof services
            const LIGHT_CLIENT = 0b10000;
            /// Client-side block filter protocol can provide BlockFilter download service
            const BLOCK_FILTER = 0b100000;
        }
    }
    
    1. discovery peer address with flags
    2. extended flags semantics
    3. allow discovery messages to specify the address of the flags corresponding to the request
    4. introduction of three concepts: target_flags_filter, required_flags, identify_announce, used to determine, respectively, the address to which this node will try to connect, the address to which this node will request from the remote end, and the attributes of this node to declare itself

    Considering the emergence of light nodes, the above three concepts are not entirely consistent and must be configured externally. By default, this node is considered a full node, and there are not too many restrictions on discovery messages.

    It is important to note that the discovery protocol does not verify the data given by the remote end, but stores it in the peer store and then checks the connection through the feeler. The advantage of this is that the peer store data is relatively even across the network, so that nodes with special needs can request some of the data, but cannot deny the data it does not need to spread across the network.

    Check List

    Tests

    • Unit test
    • Integration test
    • Manual test

    Release note

    Title Only: Include only the PR title in the release note.
    
    opened by driftluo 0
  • upgrade vm 0.21.5

    upgrade vm 0.21.5

    What problem does this PR solve?

    Issue Number: close #xxx

    Problem Summary:

    What is changed and how it works?

    Proposal: xxx

    What's Changed:

    Related changes

    • PR to update owner/repo:
    • Need to cherry-pick to the release branch

    Check List

    Tests

    • Unit test
    • Integration test
    • Manual test (add detailed scripts or steps below)
    • No code ci-runs-only: [ quick_checks,linters ]

    Side effects

    • Performance regression
    • Breaking backward compatibility

    Release note

    None: Exclude this PR from the release note.
    Title Only: Include only the PR title in the release note.
    Note: Add a note under the PR title in the release note.
    
    opened by zhangsoledad 0
  • Split Mainnet Sync CI job into two test suites

    Split Mainnet Sync CI job into two test suites

    Feature Request

    Is your feature request related to a problem? Please describe.

    The mainnet takes longer and longer to sync. We cannot sync from ground in CI any longer.

    Describe the solution you'd like

    Split it into two different test suites:

    • Keep the current mainnet sync CI job, but stop the job after it catches up to a specified height X. Choose X so that the job can finish in an hour.
    • Create a new job that starts synching from a specified height Y. The job stops after it catches up to the latest tip. Choose Y so that the job can finish in an hour and update the value of Y daily or weekly. This job requires importing the chain at the height Y.
    help wanted t:enhancement t:ci 
    opened by doitian 1
Releases(v0.104.1)
Owner
Nervos Network
Nervos Network
Official implementation of the YeeCo Root Chain (Layer 1)

yeeroot Official implementation of the YeeCo Root Chain (Layer 1) YeeCo is a permissionless, secure, high performance and scalable public blockchain p

YeeCo 29 Sep 20, 2022
A high performance blockchain kernel for enterprise users.

English | 简体中文 What is CITA CITA is a fast and scalable blockchain kernel for enterprises. CITA supports both native contract and EVM contract, by whi

CITAHub 1.3k Sep 21, 2022
Substrate: The platform for blockchain innovators

Substrate · Substrate is a next-generation framework for blockchain innovation ?? . Trying it out Simply go to substrate.dev and follow the installati

Parity Technologies 7.4k Sep 22, 2022
Blockchain written with educational purpose

Blockchain written with educational purpose

Learn Together 5 Aug 16, 2022
CosmWasm Multisend Contract on Terra Blockchain

CosmWasm Multisend Contract on Terra Blockchain This is a multisend smart contracts in Rust built to run on Cosmos SDK module on all chains that enabl

smaster0517 4 Mar 31, 2022
Diem’s mission is to build a trusted and innovative financial network that empowers people and businesses around the world.

Note to readers: On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. A

Diem 16.5k Sep 22, 2022
IBC modules and relayer - Formal specifications and Rust implementation

ibc-rs Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project comprises primarily four crates: The ibc crate defines t

Informal Systems 251 Sep 15, 2022
The new, performant, and simplified version of Holochain on Rust (sometimes called Holochain RSM for Refactored State Model)

Holochain License: This repository contains the core Holochain libraries and binaries. This is the most recent and well maintained version of Holochai

Holochain 708 Sep 23, 2022
The fast, light, and robust client for the Ethereum mainnet.

OpenEthereum Fast and feature-rich multi-network Ethereum client. » Download the latest release « Table of Contents Description Technical Overview Bui

OpenEthereum 1.6k Sep 21, 2022
rage is a simple, modern, and secure file encryption tool, using the age format

A simple, secure and modern encryption tool (and Rust library) with small explicit keys, no config options, and UNIX-style composability.

null 1.6k Sep 25, 2022
The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.

Nervos CKB - The Common Knowledge Base master develop About CKB CKB is the layer 1 of Nervos Network, a public/permissionless blockchain. CKB uses Pro

Nervos Network 1k Sep 23, 2022
List public items (public API) of library crates. Enables diffing public API between releases.

cargo-public-items List public items (the public API) of a Rust library crate by analyzing the rustdoc JSON of the crate. Automatically builds the rus

Martin Nordholts 187 Sep 21, 2022
List public items (public API) of Rust library crates. Enables diffing public API between releases.

cargo wrapper for this library You probably want the cargo wrapper to this library. See https://github.com/Enselic/cargo-public-items. public_items Li

Martin Nordholts 19 Aug 18, 2022
1️⃣ el lisp number uno - one lisp to rule them all 🏆

luno el lisp number uno luno is the one lisp to rule them all. Still experimental, do not use it in production yet. goals embeddable small size simple

Eva Pace 3 Apr 25, 2022
Fullstack development framework for UTXO-based dapps on Nervos Network

Trampoline-rs The framework for building powerful dApps on the number one UTXO chain, Nervos Network CKB. This is an early-stage, currently very incom

TannrA 2 Mar 25, 2022
CKB's vm, based on open source RISC-V ISA

Nervos CKB VM About CKB VM CKB VM is a pure software implementation of the RISC-V instruction set used as scripting VM in CKB. Right now it implements

Nervos Network 287 Sep 16, 2022
Transforms UDP stream into (fake) TCP streams that can go through Layer 3 & Layer 4 (NAPT) firewalls/NATs.

Phantun A lightweight and fast UDP to TCP obfuscator. Table of Contents Phantun Latest release Overview Usage 1. Enable Kernel IP forwarding 2. Add re

Datong Sun 544 Sep 22, 2022
As part of the IOP Stack™ Morpheus is a toolset to have gatekeeper-free identity management and verifiable claims as a 2nd layer on top of a blockchain

Internet of People Internet of People (IoP) is a software project creating a decentralized software stack that provides the building blocks and tools

We are building a complete decentralized ecosystem with the IOP Stack™ 6 Apr 27, 2022
Aptos-core strives towards being the safest and most scalable layer one blockchain solution.

Aptos-core strives towards being the safest and most scalable layer one blockchain solution. Today, this powers the Aptos Devnet, tomorrow Mainnet in order to create universal and fair access to decentralized assets for billions of people.

Aptos Labs 3.8k Sep 28, 2022
Selendra is a multichains interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications.

Selendra An interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications. Read

Selendra 15 Sep 19, 2022