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

Asynchronous Block Download and Verification #3958

Merged
merged 357 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
357 commits
Select commit Hold shift + click to select a range
5c49e58
Fix Unit test: ckb-light-client-protocol-server::tests/utils/chain.rs
eval-exec Oct 19, 2023
71bcaec
Fix Unit test: chain/src/tests/util.rs
eval-exec Oct 19, 2023
685387f
Fix Unit test: chain/src/tests/orphan_block_pool.rs
eval-exec Oct 19, 2023
2e46336
Add verify_failed_block channel to SharedPackage
eval-exec Oct 25, 2023
6248417
Construct ChainService with SharedPackage provided verify_failed_bloc…
eval-exec Oct 25, 2023
ee7508d
Remove ChainService::verify_failed_block_tx Option wrap
eval-exec Oct 25, 2023
1eb31e9
Remove useless import orphan_block_pool in ckb-sync
eval-exec Oct 25, 2023
a598082
Fix blocking process block usage in benches/benches/benchmarks/always…
eval-exec Oct 25, 2023
9fdd9df
Fix blocking process block usage in benches/benches/benchmarks/overal…
eval-exec Oct 25, 2023
797b3cd
Fix blocking process block usage in benches/benches/benchmarks/resolv…
eval-exec Oct 25, 2023
6491c75
Fix blocking process block usage in benches/benches/benchmarks/secp_2…
eval-exec Oct 25, 2023
2ae888d
let ckb-import and ckb-replay construct ChainService with SharedPackage
eval-exec Oct 25, 2023
369249b
Fix Unit test: ckb-light-client-protocol-server::tests/utils/chain.rs
eval-exec Oct 25, 2023
ffa8ea9
Fix Unit test: ckb-verification::contextual/src/tests/uncle_verifier.rs
eval-exec Oct 25, 2023
b1d1fcf
Fix Unit test: ckb-verification::contextual/src/tests/contextual_bloc…
eval-exec Oct 25, 2023
09467d5
Fix Unit test: ckb-sync::src/tests/util.rs
eval-exec Oct 25, 2023
c337a77
Fix blocking process block usage in sync/src/relayer/tests/helper.rs
eval-exec Oct 25, 2023
5c31f94
Fix Unit test of blocking process block usage in ckb-sync
eval-exec Oct 25, 2023
08015f0
Use blocking process_block method for benches/benches/benchmarks/secp…
eval-exec Oct 25, 2023
35fa579
Benches: Construct ChainService with SharedPackage provided verify_fa…
eval-exec Oct 25, 2023
52edf8b
Modify BlockStatus by SyncShared.Shared
eval-exec Oct 25, 2023
901bd22
Unit Test: Use SharedPackage to construct ChainService
eval-exec Oct 25, 2023
78ef52d
Unit Test: Use SharedPackage to construct ChainService in ckb-chain::…
eval-exec Oct 25, 2023
c5fdb48
Unit test: Modify `ChainService` initialization to include `pack.take…
eval-exec Oct 25, 2023
3adafba
Unit test: Modify the `new` function in `ChainService` to include ver…
eval-exec Oct 25, 2023
e49aa13
Unit test: Initialization of ChainService need pack.take_verify_faile…
eval-exec Oct 25, 2023
e31f9b3
Add more minor ticks to sync progress chart
eval-exec Oct 30, 2023
9c42f62
Add draft mermaid sequence diagram for develop branch
eval-exec Oct 30, 2023
c1bab43
Add draft mermaid sequence diagram for asynchronous block download
eval-exec Oct 30, 2023
e9aeb24
Add unverified block info to sync_state rpc
eval-exec Oct 30, 2023
ed87710
Upgrade Synchronizer disconnect log level from debug to info
eval-exec Oct 30, 2023
a811b3c
Add tip_hash and tip_number to sync_state rpc
eval-exec Oct 31, 2023
34f9c78
Set receive exit signal log from debug to info
eval-exec Oct 31, 2023
21dd012
Let HeaderMap stats feature use info log
eval-exec Oct 31, 2023
0143bc3
Activate HeaderMap stats profiling feature in `make profiling`
eval-exec Oct 31, 2023
98c77ae
Return removed inflight blocks count when disconnect
eval-exec Oct 31, 2023
9a63f2a
Remove log message time cost unit
eval-exec Nov 1, 2023
739d19c
Move ChainService proposal_table to the param for start method
eval-exec Nov 4, 2023
fd8724c
Remove proposal_table's RWLock
eval-exec Nov 4, 2023
339d762
Add VerifiedBlockStatus::PreviouslyVerified
eval-exec Nov 13, 2023
66ff797
Will move truncate process to consume_unverified_blocks
eval-exec Nov 13, 2023
d95efc0
Extract consume_orphan_blocks from ChainService
eval-exec Nov 13, 2023
9d3b643
Extract consume_unverified_blocks from ChainService
eval-exec Nov 13, 2023
73f8086
Move out consume_unverified_blocks and consume_orphan
eval-exec Nov 13, 2023
3493f91
Move LonelyBlock related struct to module root
eval-exec Nov 13, 2023
41f7b52
Fix LonelyBlockWithCallBack import path
eval-exec Nov 13, 2023
74ca009
Add ChainServicesBuilder to SharedPackage
eval-exec Nov 13, 2023
09c32f6
Launcher start chain_service by ChainServicesBuilder
eval-exec Nov 13, 2023
751102a
Fix ckb-sync VerifyResult import path
eval-exec Nov 13, 2023
ee9659a
Fix ckb-rpc VerifyResult import path
eval-exec Nov 13, 2023
cc4d1ac
Fix ChainService initialize for ckb import subcommand
eval-exec Nov 13, 2023
b151c8d
Fix ChainService initialize for ckb replay subcommand
eval-exec Nov 13, 2023
65d2136
Fix ChainService initialize for ckb run subcommand
eval-exec Nov 13, 2023
a306cca
Extract punish_bad_peer's params to peer_id and block_hash
eval-exec Nov 13, 2023
356f090
Fix tell_synchronizer_to_punish_the_bad_peer's params
eval-exec Nov 13, 2023
0724a3d
Remove search_orphan_pool's param
eval-exec Nov 13, 2023
12c915c
Add ConsumeUnverifiedBlockProcessor as child field of ConsumeUnverifi…
eval-exec Nov 17, 2023
a9dc5c8
Make `struct ChainService` private
eval-exec Nov 19, 2023
2991c51
Make `ConsumeUnverifiedBlockProcessor` public for crate
eval-exec Nov 19, 2023
13eca1a
Make `chain` module private, re-export `ChainController` and `ChainSe…
eval-exec Nov 19, 2023
a8c2b4c
Fix `find_fork` related unit test use `ConsumeUnverifiedBlockProcesso…
eval-exec Nov 19, 2023
0b66be3
Use `pack.take_chain_services_builder` to construct chain_controller for
eval-exec Nov 19, 2023
4e5dab0
Fix `ChainController`'s import path in `ckb-sync`
eval-exec Nov 19, 2023
984bed3
Fix `ChainController`'s import path in `ckb-verification`, `ckb-sync`,
eval-exec Nov 19, 2023
ee40e93
Fix start `ckb-chain`'s services by `pack.take_chain_services_builder`
eval-exec Nov 19, 2023
f908e57
Unit test: process block by blocking way
eval-exec Nov 19, 2023
703b7a9
Fix `ckb-sync` unit tests: Synchronizer need verify_failed_block_rx
eval-exec Nov 19, 2023
856f93b
Rename `VerifiedBlockStatus` variants to a more meaningfull name
eval-exec Nov 20, 2023
4e9b42f
Extract `ChainServicesBuilder` start method as an independent function
eval-exec Nov 21, 2023
8a56c64
Move ChainServicesBuilder to ckb_shared
eval-exec Nov 21, 2023
b0eaab0
Remove ChainServicesbuilder from ckb_chain
eval-exec Nov 21, 2023
72d23a2
Re-export `start_chain_services` in `ckb_chain`
eval-exec Nov 21, 2023
b5359cf
Re-sort shared_builder import statements
eval-exec Nov 22, 2023
44e58b2
Re-export ChainServicesBuilder in ckb_shared
eval-exec Nov 22, 2023
cc8e65c
Fix ckb-launcher start chain services
eval-exec Nov 22, 2023
5324afa
Fix subcommand::replay start chain_services
eval-exec Nov 22, 2023
166c3ea
Fix subcommand::import start chain services
eval-exec Nov 22, 2023
1907ead
Update `Cargo.lock` by `make prod`
eval-exec Nov 22, 2023
1a5c903
Fix ChainServicesBuilder import path in unit tests
eval-exec Nov 22, 2023
031f5a6
breadcast_compact_block only when FirstSeenAndVerified
eval-exec Nov 22, 2023
295a1b4
ChainService should execute non_contextual_verify when switch is None
eval-exec Nov 22, 2023
2cf6149
Extract `accept_descendants` from `ConsumeOrphan`
eval-exec Nov 22, 2023
dfd2a6e
Add `contains_block` for OrphanBlock
eval-exec Nov 22, 2023
bb1a176
Only insert new block to orphan pool if its parent not partial stored
eval-exec Nov 28, 2023
322f3f0
ConsumeOrphan::accept_descendant expect block is not stored
eval-exec Nov 28, 2023
ae38eb2
accept_descendant does not return None
eval-exec Nov 28, 2023
bcf7249
accept_descendants need not handle the case when accept_descendant re…
eval-exec Nov 28, 2023
24ad7a6
Remove `VerifiedBlockStatus::PreviouslySeenButNotVerified`
eval-exec Nov 28, 2023
7e51052
contains_block shoud not take ownership of self
eval-exec Nov 28, 2023
2f4c64d
Orphan: InnerPool shoud borrow self
eval-exec Nov 28, 2023
4082e27
Extract `process_descendant` from `accept_descendant`
eval-exec Nov 28, 2023
07eab23
Move ForkChanges to chain/src/utils
eval-exec Nov 28, 2023
5ea235f
Fix ForkChanges related import path
eval-exec Nov 28, 2023
69d2a98
Move OrphanBlocksPool to chain/src/utils
eval-exec Nov 28, 2023
bfafebb
Fix OrphanBlockPool related import path
eval-exec Nov 28, 2023
a40aedd
Trace last_common_ancestor timecost
eval-exec Nov 28, 2023
c530359
Fix module orphan_block_pool usage
eval-exec Nov 28, 2023
ecbfc8d
Fix last common_ancestor's log message
eval-exec Nov 28, 2023
9278e01
Rename FirstSeenButNotVerified to UncleBlockNotVerified
eval-exec Nov 29, 2023
1749057
Remove useless import statements, fix clippy
eval-exec Nov 29, 2023
00b4417
Using `ckb_chain::start_chain_services` to start ckb-chain services
eval-exec Nov 29, 2023
0b08884
Benches: Start chain services by start_chain_services
eval-exec Nov 29, 2023
0917d45
Fix Unit test in `ckb-rpc`: Start chain services by start_chain_services
eval-exec Nov 29, 2023
453e359
Fix Unit test in `ckb-chain`: Start chain services by start_chain_ser…
eval-exec Nov 29, 2023
692706d
Fix Unit test in `ckb-sync`: Start chain services by start_chain_serv…
eval-exec Nov 29, 2023
e5a37a2
Add blocking_insert_new_block for SyncState for Unit Test purpose
eval-exec Nov 29, 2023
1811bf5
Fix lifetime issue for Unit test in `ckb-chain`
eval-exec Nov 29, 2023
607b483
Comment out sync_shared.rs related unit test
eval-exec Nov 29, 2023
4267123
Remove Synchronizer::verify_failed_blocks_rx Option wrapper
eval-exec Nov 29, 2023
8ea7622
Fix Launcher construct Synchronizer
eval-exec Nov 29, 2023
08c405a
Remove Synchronizer::process_new_block to asynchronous_process_new_block
eval-exec Nov 29, 2023
939af6b
Add `blocking_execute` method for `BlockProcess` for the purpose of u…
eval-exec Nov 29, 2023
1c4fd55
Modify Synchronizer::blocking_process_new_block return Result<bool,Er…
eval-exec Nov 29, 2023
8c76b4e
Fix ckb-sync test_internal_db_error unit test
eval-exec Nov 29, 2023
e815a20
Fix cargo clippy warnings
eval-exec Nov 29, 2023
97288ac
Remove orphan_block_pool from ckb-sync
eval-exec Nov 29, 2023
1121cd1
Add Warning message for threads stop notify in ckb-chain
eval-exec Nov 29, 2023
157a16e
Fix ckb-chain consume_unveriifed_blocks stop handle
eval-exec Nov 29, 2023
5c7cb42
Pause chunk_process in consume_unverified_blocks thread
eval-exec Nov 29, 2023
7161ef8
Move truncate_block_request logic to consume_unverified_blocks
eval-exec Nov 29, 2023
a5da29c
ChainService won't need truncate_block_rx anymore
eval-exec Nov 29, 2023
9da728a
Remove ChainService::start, since it has replaced by start_process_block
eval-exec Nov 29, 2023
2004431
Fix ChainService stop_rx related handling
eval-exec Nov 29, 2023
4dca504
Fix consume_unverified truncate process
eval-exec Nov 29, 2023
3cf9525
Rename chain/src/chain.rs to chain/src/chain_service.rs
eval-exec Nov 29, 2023
ac1e219
Fix cargo clippy warnings
eval-exec Nov 29, 2023
9a6a126
Modify VerifyFailedBlockInfo::message_bytes to msg_bytes
eval-exec Nov 30, 2023
b59807c
Pass and return peer_id_with_msg_bytes in process_block
eval-exec Nov 30, 2023
1ffa39d
Fix peer_id_and_msg_bytes for ckb-chain unit tests
eval-exec Nov 30, 2023
470172f
Extract `ConsumeDescendantProcessor` from `ConsumeOrphan`
eval-exec Nov 30, 2023
de91b71
Attach `accept_descendant` method to `ConsumeDescendantProcessor`
eval-exec Nov 30, 2023
184ccc0
Public ConsumeDescendantProcessor struct fields
eval-exec Nov 30, 2023
88d0b7c
Fix ckb-chain find_fork related Unit Test
eval-exec Nov 30, 2023
82aa3f0
Fix Cargo fmt
eval-exec Nov 30, 2023
360cb04
Update sync_state RPC document
eval-exec Nov 30, 2023
732a7ab
Add docs for ckb-shared, fix clippy docs warnings
eval-exec Nov 30, 2023
cf06dd6
Add docs for ckb-chain, fix clippy warnings
eval-exec Nov 30, 2023
8abc4f0
Fix cargo clippy warnings for ckb-benches
eval-exec Nov 30, 2023
20bda7f
Fix cargo clippy warnings for ckb-sync
eval-exec Nov 30, 2023
04126ce
Broadcast compact block when VerifiedStatus is FirstSeenAndVerified o…
eval-exec Nov 30, 2023
740b0c1
Add extra comma for tip_hash in rpc example, execute make gen-rpc-doc
eval-exec Nov 30, 2023
f898492
Add `init_for_test` logger helper, only used by unit test
eval-exec Nov 30, 2023
ba11b60
Fix unit test for synchronizer::basic_sync
eval-exec Nov 30, 2023
139dd13
Improve sync chart drawer more friendly
eval-exec Dec 21, 2023
4c6b621
Fix ckb workspace members crate version to 0.114.0-pre
eval-exec Dec 26, 2023
c64c210
Fix unit test for ckb-rpc, use blocking_process_block
eval-exec Dec 26, 2023
02eeaba
Fix BlockFetcher fetch should not use unverified_tip to change last_c…
eval-exec Jan 9, 2024
c50197e
Fix unit test: `test_switch_valid_fork`
eval-exec Jan 9, 2024
20fa103
BlockFetcher should only set_last_common_header when status is BLOCK_…
eval-exec Jan 9, 2024
8da8c90
Simplify `ConsumeDescendantProcessor` unverified_blocks_tx send code
eval-exec Jan 11, 2024
5552e68
Fix matches result did not assert its result
eval-exec Jan 11, 2024
ef845c4
Split get_ancestor's logic to unverified_tip and tip
eval-exec Jan 11, 2024
c6d1d49
BlockFetcher get ancestor with unverified_tip
eval-exec Jan 11, 2024
7ef89df
Clean expired orphan blocks
eval-exec Jan 11, 2024
1486dac
Split ChainController out chain_service.rs
eval-exec Jan 11, 2024
f0c2b66
ChainService should mark block as BLOCK_INVALID if it does not pass n…
eval-exec Jan 11, 2024
fd65143
Change `VerifyResult` to `Result<bool, Error>`
eval-exec Jan 11, 2024
eb10c41
ConsumeUnverified do not need VerifiedBlockStatus enum type anymore
eval-exec Jan 11, 2024
4556e1a
Do not need VerifiedBlockStatus in ckb-rpc and ckb-sync
eval-exec Jan 11, 2024
e03d3c0
Fix unit test: do not need VerifiedBlockStatus
eval-exec Jan 11, 2024
cf02226
Remove VerifiedBlockStatus enum type and related imports statements
eval-exec Jan 11, 2024
9e6badf
Remove useless crate dependencies, fix warnings of check-cargotoml.sh
eval-exec Jan 11, 2024
4dcea97
Fix ConsumeUnverified: should return `Ok(false)` if it's a block which
eval-exec Jan 11, 2024
c2fc589
Fix lint, remove whitespace
eval-exec Jan 11, 2024
0e262b3
BlockFetcher calculate `start` and ancestor header should aware IBDState
eval-exec Jan 15, 2024
cc688cd
BlockFetcher check whether to request block from a peer should aware …
eval-exec Jan 15, 2024
b40d931
BlockFetcher should only return if best_known <= unverified_tip in IB…
eval-exec Jan 15, 2024
261a900
SyncShared::accept_block will mark the block as BLOCK_RECEIVED if its…
eval-exec Jan 15, 2024
70fac5d
Fix ckb-sync test_insert_parent_unknown_block
eval-exec Jan 15, 2024
cd3caeb
ConsumeOrphan should mark the block as PARTIAL_STORED before send it …
eval-exec Jan 15, 2024
0a80a78
Add more log message for debug
eval-exec Jan 16, 2024
8a11ece
Shared provide generic version of get_block_status for Snapshot and s…
eval-exec Jan 16, 2024
8da906c
ckb-chain load get_block_status from shared.store()
eval-exec Jan 16, 2024
621bee8
ActiveChain get_block_status from snapshot()
eval-exec Jan 16, 2024
aebac49
Fix SyncShared's field name in BlockFetcher and HeadersProcess
eval-exec Jan 16, 2024
5910012
Remove BlockStatus::BLOCK_PARTIAL_STORED
eval-exec Jan 16, 2024
291ed19
Change BLOCK_PARTIAL_STORED to BLOCK_STORED
eval-exec Jan 16, 2024
85885f1
Improve draw chart script add more major and minor ticks on x/yaxis
eval-exec Jan 17, 2024
1f73f46
Add log for `MinerRpcImpl::submit_block` new_block check
eval-exec Jan 17, 2024
6730eff
Comment out shrink_to_fit for header_map's MemoryMap
eval-exec Jan 17, 2024
18b2afa
ChainService should not punish remote peer if failed to send block to…
eval-exec Jan 17, 2024
8b9111d
Remove meaning less TODO note in test_internal_db_error, improve draw…
eval-exec Jan 18, 2024
fdfd725
test: randomly kill and restart node
contrun Jan 16, 2024
013104e
add integration test for sync with churn nodes
contrun Jan 17, 2024
15d59bc
test: make Node struct clonable
contrun Jan 17, 2024
d51b4f9
test: run SyncChurn mining and restart in different threads
contrun Jan 17, 2024
580b167
test: cargo {clippy,fmt}
contrun Jan 18, 2024
bf5b98f
test: document what SyncChurn does and its weakness
contrun Jan 18, 2024
3b77335
test: make two mining nodes in SyncChurn
contrun Jan 18, 2024
d26c625
test: don't mine too many blocks in SyncChurn
contrun Jan 18, 2024
e47684c
Improve draw chart script, no vertial line label overcover
eval-exec Jan 19, 2024
cfff87b
Add unverified tip related metrics to ckb_metrics
eval-exec Jan 22, 2024
44792e7
Add minstant to ckb_chain dependency
eval-exec Jan 22, 2024
f815526
Collect ckb_chain timecost and unverified_tip metrics
eval-exec Jan 22, 2024
dd67707
Collect execute_callback timecost for metrics
eval-exec Jan 22, 2024
8d1e48c
Unverified block in db
eval-exec Jan 17, 2024
d753cdc
UnverifiedBlockHash size to 3
eval-exec Jan 18, 2024
49853e9
Comment MemoryMap remove shrink_to_fit
eval-exec Jan 23, 2024
d20cf50
Remove UnverifiedBlockHash since consume_unverified can load parent_h…
eval-exec Jan 23, 2024
2680ca7
ConsumeOrphan only need pass LonelyBlockHashWithCallback to ConsumeUn…
eval-exec Jan 23, 2024
89f01c7
Replace the `Into` implementation LonelyBlockWithCallback with `From<…
eval-exec Jan 23, 2024
dd960bc
Fix ConsumeUnverified thread need LonelyBlockHashWithCallback in find…
eval-exec Jan 23, 2024
35a01d1
Consider the edge case of processing genesis block
contrun Jan 22, 2024
c1729f7
Copy ibd_finished field from shared to HeaderMapKernal
eval-exec Jan 24, 2024
cbee77f
HeaderMap do not shrink_to_fit in IBD mode
eval-exec Jan 24, 2024
e46325e
test inserting block with stored but unverified parent
contrun Jan 24, 2024
4979c4b
ConsumeUnverified should call get_update_for_tip_hash after begin_tra…
eval-exec Jan 25, 2024
71e3715
Cargo fmt, apply check-whitespaces
eval-exec Jan 25, 2024
c166fce
Change process duration from Gauge to Histogram, add metrics for ckb-…
eval-exec Jan 25, 2024
46dceed
Collect ckb-chain and ckb-sync timecost Histogram metrics
eval-exec Jan 25, 2024
8b81579
Add orphan blocks count metric
eval-exec Jan 25, 2024
2436cb5
Add header_map limit_memory and operation duration metric
eval-exec Jan 26, 2024
bf1bf22
Collect header_map limit_memory and operations timecost
eval-exec Jan 26, 2024
c0d1539
ConsumeOrphan should not insert a block to orphan pool if its parent …
eval-exec Jan 29, 2024
38116d2
Remove `ChainController`'s useless methods, fix method comments
eval-exec Jan 29, 2024
e94b143
Add HeaderMap memory count and cache hit/miss count metrics
eval-exec Jan 29, 2024
6560feb
Collect HeaderMap MemoryMap cache hit/miss count and total count
eval-exec Jan 29, 2024
02ff2e8
ConsumeUnverified do not realy need pass whole UnverifiedBlock to fn …
eval-exec Jan 29, 2024
54aa62c
Remove msg_bytes from LonelyBlock
eval-exec Jan 29, 2024
c133520
Remove msg_bytes from VerifyFailedBlockInfo
eval-exec Jan 29, 2024
d645bb6
ckb-sync do not need pass msg_bytes to ckb-chain
eval-exec Jan 29, 2024
67d0725
`ckb-sync`'s unit test won't need `msg_bytes` anymore
eval-exec Jan 29, 2024
72c48cf
`blocking_process_block` returns a bool, use a proper name
eval-exec Jan 29, 2024
571255e
Metrics: header_map hit/miss should contains `contains_key`
eval-exec Jan 30, 2024
1df318c
Add `struct RemoteBlock` for ckb-chain, let ckb-sync and ckb-relayer …
eval-exec Jan 31, 2024
fe1836d
Modify ckb-chain use RemoteBlock, drop LonelyBlockWithCallback
eval-exec Jan 31, 2024
c96293b
ckb-sync use accept_remote_block to process remote block
eval-exec Jan 31, 2024
c063800
Modify unit test in ckb-sync and ckb-chain to use RemoteBlock related…
eval-exec Jan 31, 2024
1b9b72b
Fix HeaderMap memory count
eval-exec Feb 1, 2024
7afa494
Fix rebase conflicts with develop: https://github.com/nervosnetwork/c…
eval-exec Feb 2, 2024
cc6fab7
Fix chain service builder for test_accept_block
eval-exec Feb 4, 2024
79b7090
add inflight count and inflight timeout count for ckb-metrics
eval-exec Feb 4, 2024
3d8a24e
Add lonely_block channel and unverified_block channel length
eval-exec Feb 4, 2024
650ea90
Add test to ensure the results of remove_blocks_by_parent are sorted
contrun Feb 5, 2024
3dea464
Add test to ensure that leader always have children
contrun Feb 5, 2024
a579e4b
Fix blocks_are_sorted checking logic error
contrun Feb 5, 2024
3e16b59
Remove tell_synchronizer_to_punish_the_bad_peer from ckb-chain
eval-exec Feb 6, 2024
9233d6a
Use verify_callbacl to handle peer punish and compact block broadcast
eval-exec Feb 6, 2024
e22d9e4
Fix sync and relayer unit test by verify_callback
eval-exec Feb 6, 2024
71ea04b
Remove VerifyFailedInfo, remove verify_failed_block channel
eval-exec Feb 6, 2024
e0d006e
Remove broadcast_compact_block channel
eval-exec Feb 6, 2024
490c64b
Add debug log for block_fetcher->get_ancestor
eval-exec Feb 6, 2024
2511ec6
chore: remove channel send error callback
quake Feb 6, 2024
7ed75fd
chore: remove UnverifiedBlock
quake Feb 6, 2024
5e0d372
Find and verify unverified blocks on ckb startup
eval-exec Feb 7, 2024
2479ff4
Fix cargo clippy warnings
eval-exec Feb 7, 2024
5123fb8
Use `Release` to `store`, `Acquire` to `read` for atomic: `is_verifyi…
eval-exec Feb 8, 2024
b9fba57
Do not accept descendants if parent is invalid
eval-exec Feb 21, 2024
cfd7aed
Update rpc docs, fix CI test
eval-exec Feb 23, 2024
ab07eae
Release ckb-async-download rc0
eval-exec Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 65 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ check: setup-ckb-test ## Runs all of the compiler's checks.
build: ## Build binary with release profile.
cargo build ${VERBOSE} --release

.PHONY: build-for-profiling-without-debug-symbols
build-for-profiling-without-debug-symbols: ## Build binary with for profiling without debug symbols.
JEMALLOC_SYS_WITH_MALLOC_CONF="prof:true" cargo build ${VERBOSE} --release --features "profiling"
.PHONY: profiling
profiling: ## Build binary with for profiling without debug symbols.
JEMALLOC_SYS_WITH_MALLOC_CONF="prof:true" cargo build ${VERBOSE} --profile prod --features "with_sentry,with_dns_seeding,profiling"

.PHONY: build-for-profiling
.PHONY: profiling-with-debug-symbols
build-for-profiling: ## Build binary with for profiling.
devtools/release/make-with-debug-symbols build-for-profiling-without-debug-symbols
devtools/release/make-with-debug-symbols profiling

.PHONY: prod
prod: ## Build binary for production release.
Expand Down
36 changes: 24 additions & 12 deletions benches/benches/benchmarks/always_success.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn bench(c: &mut Criterion) {
(0..20).for_each(|_| {
let block = gen_always_success_block(&mut blocks, &parent, shared2);
chain2
.internal_process_block(
.blocking_process_block_with_switch(
Arc::new(block.clone()),
Switch::DISABLE_ALL,
)
Expand All @@ -44,7 +44,7 @@ fn bench(c: &mut Criterion) {
|(chain, blocks)| {
blocks.into_iter().skip(1).for_each(|block| {
chain
.process_block(Arc::new(block))
.blocking_process_block(Arc::new(block))
.expect("process block OK");
});
},
Expand Down Expand Up @@ -77,14 +77,14 @@ fn bench(c: &mut Criterion) {
(0..5).for_each(|i| {
let block = gen_always_success_block(&mut blocks, &parent, shared2);
chain2
.internal_process_block(
.blocking_process_block_with_switch(
Arc::new(block.clone()),
Switch::DISABLE_ALL,
)
.expect("process block OK");
if i < 2 {
chain3
.internal_process_block(
.blocking_process_block_with_switch(
Arc::new(block.clone()),
Switch::DISABLE_ALL,
)
Expand All @@ -96,7 +96,7 @@ fn bench(c: &mut Criterion) {
(0..2).for_each(|_| {
let block = gen_always_success_block(&mut blocks, &parent, shared3);
chain3
.internal_process_block(
.blocking_process_block_with_switch(
Arc::new(block.clone()),
Switch::DISABLE_ALL,
)
Expand All @@ -110,15 +110,18 @@ fn bench(c: &mut Criterion) {
.take(5)
.for_each(|block| {
chain1
.internal_process_block(Arc::new(block), Switch::DISABLE_ALL)
.blocking_process_block_with_switch(
Arc::new(block),
Switch::DISABLE_ALL,
)
.expect("process block OK");
});
(chain1.clone(), blocks)
},
|(chain, blocks)| {
blocks.into_iter().skip(6).for_each(|block| {
chain
.process_block(Arc::new(block))
.blocking_process_block(Arc::new(block))
.expect("process block OK");
});
},
Expand Down Expand Up @@ -152,11 +155,17 @@ fn bench(c: &mut Criterion) {
let block = gen_always_success_block(&mut blocks, &parent, shared2);
let arc_block = Arc::new(block.clone());
chain2
.internal_process_block(Arc::clone(&arc_block), Switch::DISABLE_ALL)
.blocking_process_block_with_switch(
Arc::clone(&arc_block),
Switch::DISABLE_ALL,
)
.expect("process block OK");
if i < 2 {
chain3
.internal_process_block(arc_block, Switch::DISABLE_ALL)
.blocking_process_block_with_switch(
arc_block,
Switch::DISABLE_ALL,
)
.expect("process block OK");
}
parent = block;
Expand All @@ -165,7 +174,7 @@ fn bench(c: &mut Criterion) {
(0..4).for_each(|_| {
let block = gen_always_success_block(&mut blocks, &parent, shared3);
chain3
.internal_process_block(
.blocking_process_block_with_switch(
Arc::new(block.clone()),
Switch::DISABLE_ALL,
)
Expand All @@ -179,15 +188,18 @@ fn bench(c: &mut Criterion) {
.take(7)
.for_each(|block| {
chain1
.internal_process_block(Arc::new(block), Switch::DISABLE_ALL)
.blocking_process_block_with_switch(
Arc::new(block),
Switch::DISABLE_ALL,
)
.expect("process block OK");
});
(chain1.clone(), blocks)
},
|(chain, blocks)| {
blocks.into_iter().skip(8).for_each(|block| {
chain
.process_block(Arc::new(block))
.blocking_process_block(Arc::new(block))
.expect("process block OK");
});
},
Expand Down
9 changes: 5 additions & 4 deletions benches/benches/benchmarks/overall.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::benchmarks::util::{create_2out_transaction, create_secp_tx, secp_cell};
use ckb_app_config::NetworkConfig;
use ckb_app_config::{BlockAssemblerConfig, TxPoolConfig};
use ckb_chain::chain::{ChainController, ChainService};
use ckb_chain::{start_chain_services, ChainController};
use ckb_chain_spec::consensus::{ConsensusBuilder, ProposalWindow};
use ckb_dao_utils::genesis_dao_data;
use ckb_jsonrpc_types::JsonBytes;
Expand Down Expand Up @@ -132,8 +132,7 @@ pub fn setup_chain(txs_size: usize) -> (Shared, ChainController) {
let network = dummy_network(&shared);
pack.take_tx_pool_builder().start(network);

let chain_service = ChainService::new(shared.clone(), pack.take_proposal_table());
let chain_controller = chain_service.start(Some("ChainService"));
let chain_controller = start_chain_services(pack.take_chain_services_builder());

(shared, chain_controller)
}
Expand Down Expand Up @@ -217,7 +216,9 @@ fn bench(c: &mut Criterion) {
.verify(&block.header())
.expect("header verified");

chain.process_block(Arc::new(block)).expect("process_block");
chain
.blocking_process_block(Arc::new(block))
.expect("process_block");
i -= 1;
}
},
Expand Down
5 changes: 2 additions & 3 deletions benches/benches/benchmarks/resolve.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::benchmarks::util::create_2out_transaction;
use ckb_app_config::{BlockAssemblerConfig, TxPoolConfig};
use ckb_chain::chain::{ChainController, ChainService};
use ckb_chain::{start_chain_services, ChainController};
use ckb_chain_spec::{ChainSpec, IssuedCell};
use ckb_jsonrpc_types::JsonBytes;
use ckb_resource::Resource;
Expand Down Expand Up @@ -96,8 +96,7 @@ pub fn setup_chain(txs_size: usize) -> (Shared, ChainController) {
.tx_pool_config(tx_pool_config)
.build()
.unwrap();
let chain_service = ChainService::new(shared.clone(), pack.take_proposal_table());
let chain_controller = chain_service.start(Some("ChainService"));
let chain_controller = start_chain_services(pack.take_chain_services_builder());

// FIXME: global cache !!!
let _ret = setup_system_cell_cache(
Expand Down
Loading
Loading