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.

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.

    u: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
    u:ckb2021 
    opened by driftluo 13
  • chore(deps): bump tokio from 1.23.0 to 1.24.1

    chore(deps): bump tokio from 1.23.0 to 1.24.1

    Bumps tokio from 1.23.0 to 1.24.1.

    Release notes

    Sourced from tokio's releases.

    Tokio v1.24.1

    This release fixes a compilation failure on targets without AtomicU64 when using rustc older than 1.63. (#5356)

    #5356: tokio-rs/tokio#5356

    Tokio v1.24.0

    The highlight of this release is the reduction of lock contention for all I/O operations (#5300). We have received reports of up to a 20% improvement in CPU utilization and increased throughput for real-world I/O heavy applications.

    Fixed

    • rt: improve native AtomicU64 support detection (#5284)

    Added

    • rt: add configuration option for max number of I/O events polled from the OS per tick (#5186)
    • rt: add an environment variable for configuring the default number of worker threads per runtime instance (#4250)

    Changed

    • sync: reduce MPSC channel stack usage (#5294)
    • io: reduce lock contention in I/O operations (#5300)
    • fs: speed up read_dir() by chunking operations (#5309)
    • rt: use internal ThreadId implementation (#5329)
    • test: don't auto-advance time when a spawn_blocking task is running (#5115)

    #5186: tokio-rs/tokio#5186 #5294: tokio-rs/tokio#5294 #5284: tokio-rs/tokio#5284 #4250: tokio-rs/tokio#4250 #5300: tokio-rs/tokio#5300 #5329: tokio-rs/tokio#5329 #5115: tokio-rs/tokio#5115 #5309: tokio-rs/tokio#5309

    Tokio v1.23.1

    This release forward ports changes from 1.18.4.

    Fixed

    • net: fix Windows named pipe server builder to maintain option when toggling pipe mode (#5336).

    #5336: tokio-rs/tokio#5336

    Commits
    • 31c7e82 chore: prepare Tokio v1.24.1 (#5357)
    • 8d8db27 tokio: add load and compare_exchange_weak to loom StaticAtomicU64 (#5356)
    • dfe252d chore: prepare Tokio v1.24.0 release (#5353)
    • 21b233f test: bump version of async-stream (#5347)
    • 7299304 Merge branch 'tokio-1.23.x' into master
    • 1a997ff chore: prepare Tokio v1.23.1 release
    • a8fe333 Merge branch 'tokio-1.20.x' into tokio-1.23.x
    • ba81945 chore: prepare Tokio 1.20.3 release
    • 763bdc9 ci: run WASI tasks using latest Rust
    • 9f98535 Merge remote-tracking branch 'origin/tokio-1.18.x' into fix-named-pipes-1.20
    • Additional commits viewable in compare view

    Dependabot compatibility score

    You can trigger a rebase of this PR by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
    dependencies rust 
    opened by dependabot[bot] 0
  • feat: fee-rate estimator

    feat: fee-rate estimator

    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
  • chore(deps): bump rhai from 1.10.1 to 1.12.0

    chore(deps): bump rhai from 1.10.1 to 1.12.0

    Bumps rhai from 1.10.1 to 1.12.0.

    Dependabot compatibility score

    You can trigger a rebase of this PR by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies rust 
    opened by dependabot[bot] 0
  • Yank CKB v0.105.x

    Yank CKB v0.105.x

    Because of a bug, the version v0.105.x can cause trouble after the light client soft fork activation.

    • [ ] Yank all the v0.105.x releases
    • [ ] Send CKB alerts to nodes running v0.105.x versions.
    t:bug 
    opened by doitian 0
  • Add new testnet bootnodes in the next release

    Add new testnet bootnodes in the next release

    Feature Request

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

    Add more bootnodes so new nodes can find better nodes to start discover the p2p network.

    t:enhancement 
    opened by doitian 0
  • Remove nervosnetwork/faketime, replace cargo test by nextest-rs/nextest

    Remove nervosnetwork/faketime, replace cargo test by nextest-rs/nextest

    What problem does this PR solve?

    Issue Number: close #3729

    Problem Summary:

    This PR want to remove nervosnetwork/faketime, and simply use static atomics and nextest to organize ckb's unit tests.

    What is changed and how it works?

    The nervosnetwork/faketime is complicated, and when we specified --test-threads=1 flag to cargo test, these thread_local ( https://github.com/nervosnetwork/faketime/blob/1ead0aba139f0893d04aa95c35e0179c3b4482c7/src/faketime.rs#L109-L115 ) behave like global variables, then some tests will fail.

    The cargo test run all unit test in a single process, and many unit tests may run on a same thread. And there exists some faketime related test want to change the whole process's faketime by set current process's environment like this: https://github.com/nervosnetwork/ckb/blob/fafa37d979bd83f867358efb7aa176a0ec295bbd/chain/src/tests/block_assembler.rs#L135

    this may affect other non-faketime related unit tests.

    Fortunately, there is nextest-rs/nextest which will run every unit function on single process, providing process-level isolation granularity.

    What's Changed:

    Related changes

    • remove nervosnetwork/faketime
    • add util/systemtime to provide real systemtime, and provide faketime when enable_faketime feature is enabled
    • use nextest-rs/nextest to run all unit tests

    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

    • None

    Release note

    Title Only: Include only the PR title in the release note.
    
    opened by eval-exec 1
Releases(v0.106.0)
Owner
Nervos Network
Nervos Network
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 297 Jan 3, 2023
The Zenotta Network Protocol (ZNP), the network that supports the Zenotta blockchain

Zenotta Network Protocol A repo for the development of the Zenotta Network Protocol (ZNP). We will regularly be updating links and easter eggs inside

Zenotta AG 10 Apr 2, 2023
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™ 9 Nov 4, 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 4.7k Jan 6, 2023
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 16 Nov 29, 2022
The Phala Network Blockchain, pRuntime and the bridge.

Phala Blockchain Phala Network is a TEE-Blockchain hybrid architecture implementing Confidential Contract. This repo includes: node/: the main blockch

Phala Network 314 Jan 6, 2023
A value transfer bridge between the Monero blockchain and the Secret Network.

Secret-Monero-Bridge A value transfer bridge between the Monero blockchain and the Secret Network. Proof-of-Concept Video Demonstration: https://ipfs.

null 28 Dec 7, 2022
xx network Substrate based blockchain node

xx network Substrate based blockchain node Rust Setup First, complete the basic Rust setup instructions. MacOS users: setup to compile for Linux Befor

xx network 11 Dec 20, 2022
A Rust-based CustomVM for the Avalanche blockchain network

A rust-based Custom VM for Avalanche Subnets Curious about how to run Rust-based smart contracts, or just custom VMs for Avalanche blockchain? You're

Archis 11 Dec 29, 2022
ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot network.

ARYA Network ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot n

Pankaj Chaudhary 6 Dec 20, 2022
Cross-chain bridge message delivery network. We are hiring, [email protected]

Introduction Implementation of a https://darwinia.network node in Rust based on the Substrate framework. This repository contains runtimes for the Dar

Darwinia Network 225 Nov 8, 2022
dWallet Network, a composable modular signature network is the home of dWallets

Welcome to dWallet Network dWallet Network, a composable modular signature network is the home of dWallets. A dWallet is a noncollusive and massively

dWallet Labs 8 Feb 26, 2024
The public source and documentation for Xenon iOS tweak.

THE GUIDE HAS BEEN MOVED TO THE WIKI This is the public source for the Xenon iOS tweak. The full version is available for $1.99 on Chariz. Differences

aspen 1 Dec 28, 2022
Zei is a library that provide tools to create and verify public transaction with confidential data.

#Zei: Findora's Cryptographic Library Zei is a library that provide tools to create and verify public transaction with confidential data. Support: Bas

Findora Foundation 0 Oct 23, 2022
Rust crate to retrieve public IP address and geolocation data. 🦀

?? Public IP Address Lookup and Geolocation Information public-ip-address is a simple Rust library for performing public IP lookups from over a dozen

Tomash Ghz 6 Apr 25, 2024
Manage secret values in-repo via public key cryptography

amber Manage secret values in-repo via public key cryptography. See the announcement blog post for more motivation. Amber provides the ability to secu

FP Complete 82 Nov 10, 2022
Composable proof transcripts for public-coin arguments of knowledge

Merlin: composable proof transcripts for public-coin arguments of knowledge Merlin is a STROBE-based transcript construction for zero-knowledge proofs

dalek cryptography 99 Dec 22, 2022
The Hybrid Public Key Encryption (HPKE) standard in Python

Hybrid PKE The Hybrid Public Key Encryption (HPKE) standard in Python. hybrid_pke = hpke-rs ➕ PyO3 This library provides Python bindings to the hpke-r

Cape Privacy 4 Nov 7, 2022