Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ᚬmaster] 🎉 Rc/v0.14.0 #940

Closed
wants to merge 77 commits into from
Closed

[ᚬmaster] 🎉 Rc/v0.14.0 #940

wants to merge 77 commits into from

Conversation

doitian
Copy link
Member

@doitian doitian commented Jun 3, 2019

This is the release for Rylai V3. The testnet will reset and deploy this version on Jun 15.


Features

  • feat: Peers handle disconnect #908: Peers handle disconnect (@keroro520)

    • Handle disconnected inside Peers
    • Rename n_sync_started/n_protected_outbound_peers
    • Remove imlicitly clone for Peers
  • feat: secp256k1 multisig #891: Secp256k1 multisig (@jjyr)

    Used in alert system feat: Alert system #887

  • feat: limit TXO set memory usage #845: Limit TXO set memory usage (@yangby-cryptape)

    This is a breaking change: b:database

    Commits

    • feat: add a function to traverse all keys for database

    • feat: save cell set into database (but not used)

      BREAKING CHANGE: Add new column to store cell set into database.

    • refactor: loading CellSet do not have to load all blocks

    • perf: delete transactions whose all cells are dead

    • fix: the order to apply cell set diff is very important

    Issue

    Limit TXO set memory usage #228

    Notes

    • I insist on the opinion: save live cells is better than save transactions which include at least one live cell.

      We can use a only-key-and-no-value database (for example, Redis) to store live cells (CellOutPoint as key).

      I tried, but it's too difficult to adapt to current logic, so I gave up.

    • I didn't change current design about how to use CellSet, I just made them be persisted.

    • All transactions which include at least one live cell, are still kept in memory.

      But the transactions which don't have any live cells are removed from memory.

  • feat: revise uncle rule #874: Revise uncle rule (@zhangsoledad)

    This is a breaking change: b:consensus, b:database

    1. get rid uncle age limit
    2. try include disconnected block as uncle
  • feat: tweak consensus params #920: Tweak consensus params (@zhangsoledad)

    This is a breaking change: b:consensus

    tweak block_cycles_limit and min_block_interval

  • feat: wrap the log macros to fix ill formed macros  #897: Wrap the log macros to fix ill formed macros (@yangby-cryptape)

    Commits:

    • chore: update the log filter template in configuration
    • chore: apply new log macros to sync & relay
    • chore: apply new log macros to util/* & ckb-bin
    • chore: apply new log macros to verification & shared
    • chore: apply new log macros to rpc & notify
    • chore: apply new log macros to network
    • chore: apply new log macros to miner
    • chore: apply new log macros to chain
    • (important) feat: wrap the log macros to fix ill formed macros

    And, we have to update the log filters, add prefix ckb- for all our crates, since I use target: env!("CARGO_PKG_NAME").

  • feat: synchronizer and relayer share BlocksInflight #919: Synchronizer and relayer share BlocksInflight (@keroro520)

    • test: Add test for losing BlockTXN messages

    • fix: Remove relayer's compact_block_filter, filter duplicated compact blocks via BlocksInFlight
      Currently, we discard the new arriving compact blocks if we had already received the same one, via RelayState::compact_block_filter. The purpose is avoiding re-processing/re-requesting the same compact blocks. But the problem is, if we failed to reconstruct a compact block, we cannot process this compact block anymore, before receiving the corresponding transactions from peer1. That's terrible if peer1's inventory was lost on the way.

      Here I remove RelayState::compact_block_filter, and insteadly use Peers::blocks_inflight to avoid re-requesting to same peers.

    • fix: Cache pending compact block at peer-level, but not global-level

  • feat: add a transaction error InsufficientCellCapacity #924: Add a transaction error InsufficientCellCapacity (@yangby-cryptape)

    For Do not reuse the error CapacityOverflow #900.

  • feat: make a better error message for miner when method not found #926: Make a better error message for miner when method not found (@yangby-cryptape)

    For Optimize error message on rpc call get_block_template MethodNotFound #904.

Bug Fixes

Improvements

Misc

  • New verification model #913: New verification model (@xxuejie)

    This is a breaking change: b:consensus, b:database, b:p2p, b:rpc

    Based on feedbacks gathered earlier, we are revising our verification
    model with the following changes:

    • When validating a transaction, CKB will grab all lock scripts from
      all inputs, and group them based on lock script hash. The script in
      each group will only be run once. The lock script itself will have
      to do the validation task for all inputs in the same group
    • CKB will also grab all type scripts from inputs and outputs(notice
      different from previous version, the type scripts in inputs are
      included here as well), and group them based on type script hash as
      well. Each type script in each group will also be run once. The type
      script itself needs to handle the validation task within the group
    • Syscalls are also revised to allow fetching all the
      inputs/outputs/witnesses within a single group.
    • Input args is removed since the functionality can be replicated elsewhere

doitian and others added 30 commits May 24, 2019 21:05
Original implementation use [Tip-BlockMedianCount .. Tip-1] to calculate the
current block median time. According to the notion of BlockMedianTime in
https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki#specification ,
here change to use [Tip-BlockMedianCount+1 .. Tip] instead.
BREAKING CHANGE: Add new column to store cell set into database.
fix: calculate the current median time from tip
feat: limit TXO set memory usage
doitian and others added 21 commits June 1, 2019 12:31
feat: synchronizer and relayer share BlocksInflight
…acity

feat: add a transaction error `InsufficientCellCapacity`
feat: make a better error message for miner when method not found
Based on feedbacks gathered earlier, we are revising our verification
model with the following changes:

* When validating a transaction, CKB will grab all lock scripts from
  all inputs, and group them based on lock script hash. The script in
  each group will only be run once. The lock script itself will have
  to do the validation task for all inputs in the same group
* CKB will also grab all type scripts from inputs and outputs(notice
  different from previous version, the type scripts in inputs are
  included here as well), and group them based on type script hash as
  well. Each type script in each group will also be run once. The type
  script itself needs to handle the validation task within the group
* Syscalls are also revised to allow fetching all the
  inputs/outputs/witnesses within a single group.

The default secp256k1_blake160_sighash_all lock script is compiled
from the following source:

https://github.com/nervosnetwork/ckb-system-scripts/blob/e00ba451dccb7a516454ea9606de3a21c8f9a80c/c/secp256k1_blake160_sighash_all.c

The exact gcc version used in the compilation can be located in the
following docker image:

xxuejie/riscv-gnu-toolchain-rv64imac:20190529
The default secp256k1_blake160_sighash_all lock script is compiled
from the following source:

https://github.com/nervosnetwork/ckb-system-scripts/blob/680f4287ab3211025761aaf5cae3727fb4ea7241/c/secp256k1_blake160_sighash_all.c

The exact gcc version used in the compilation can be located in the
following docker image:

xxuejie/riscv-gnu-toolchain-rv64imac:20190529
@doitian doitian requested a review from a team June 3, 2019 16:30
@nervos-bot nervos-bot bot changed the title 🎉 Rc/v0.14.0 [ᚬmaster] 🎉 Rc/v0.14.0 Jun 3, 2019
@nervos-bot
Copy link

nervos-bot bot commented Jun 3, 2019

@xxuejie is assigned as the chief reviewer

@nervos-bot nervos-bot bot added the breaking change The feature breaks consensus, database, message schema or RPC interface. label Jun 3, 2019
@doitian
Copy link
Member Author

doitian commented Jun 4, 2019

Close because of the wrong source repo

@doitian doitian closed this Jun 4, 2019
@doitian doitian deleted the rc/v0.14.0 branch June 4, 2019 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change The feature breaks consensus, database, message schema or RPC interface.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants