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

Prestore block to db before insert to orphan block pool, reduce channel length #30

Draft
wants to merge 360 commits into
base: ckb-async-download
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
360 commits
Select commit Hold shift + click to select a range
dea6d87
Construct ChainService with SharedPackage provided verify_failed_bloc…
eval-exec Oct 25, 2023
8d4024c
Remove ChainService::verify_failed_block_tx Option wrap
eval-exec Oct 25, 2023
95e6d54
Remove useless import orphan_block_pool in ckb-sync
eval-exec Oct 25, 2023
127230d
Fix blocking process block usage in benches/benches/benchmarks/always…
eval-exec Oct 25, 2023
5e829b4
Fix blocking process block usage in benches/benches/benchmarks/overal…
eval-exec Oct 25, 2023
6245354
Fix blocking process block usage in benches/benches/benchmarks/resolv…
eval-exec Oct 25, 2023
516e4f9
Fix blocking process block usage in benches/benches/benchmarks/secp_2…
eval-exec Oct 25, 2023
03da081
let ckb-import and ckb-replay construct ChainService with SharedPackage
eval-exec Oct 25, 2023
774c323
Fix Unit test: ckb-light-client-protocol-server::tests/utils/chain.rs
eval-exec Oct 25, 2023
da6ade9
Fix Unit test: ckb-verification::contextual/src/tests/uncle_verifier.rs
eval-exec Oct 25, 2023
20f92cd
Fix Unit test: ckb-verification::contextual/src/tests/contextual_bloc…
eval-exec Oct 25, 2023
3ab4651
Fix Unit test: ckb-sync::src/tests/util.rs
eval-exec Oct 25, 2023
ebc5128
Fix blocking process block usage in sync/src/relayer/tests/helper.rs
eval-exec Oct 25, 2023
c67bd1f
Fix Unit test of blocking process block usage in ckb-sync
eval-exec Oct 25, 2023
faf09b5
Use blocking process_block method for benches/benches/benchmarks/secp…
eval-exec Oct 25, 2023
8d62706
Benches: Construct ChainService with SharedPackage provided verify_fa…
eval-exec Oct 25, 2023
8aefd3f
Modify BlockStatus by SyncShared.Shared
eval-exec Oct 25, 2023
481d3a1
Unit Test: Use SharedPackage to construct ChainService
eval-exec Oct 25, 2023
01f1854
Unit Test: Use SharedPackage to construct ChainService in ckb-chain::…
eval-exec Oct 25, 2023
ee05887
Unit test: Modify `ChainService` initialization to include `pack.take…
eval-exec Oct 25, 2023
3f7dd02
Unit test: Modify the `new` function in `ChainService` to include ver…
eval-exec Oct 25, 2023
8c0a671
Unit test: Initialization of ChainService need pack.take_verify_faile…
eval-exec Oct 25, 2023
975c9be
Add more minor ticks to sync progress chart
eval-exec Oct 30, 2023
7479dcb
Add draft mermaid sequence diagram for develop branch
eval-exec Oct 30, 2023
89e0a66
Add draft mermaid sequence diagram for asynchronous block download
eval-exec Oct 30, 2023
8b04fad
Add unverified block info to sync_state rpc
eval-exec Oct 30, 2023
09b81b7
Upgrade Synchronizer disconnect log level from debug to info
eval-exec Oct 30, 2023
368b7ba
Add tip_hash and tip_number to sync_state rpc
eval-exec Oct 31, 2023
70fbaee
Set receive exit signal log from debug to info
eval-exec Oct 31, 2023
404a51e
Let HeaderMap stats feature use info log
eval-exec Oct 31, 2023
43ec3b8
Activate HeaderMap stats profiling feature in `make profiling`
eval-exec Oct 31, 2023
d8cf23f
Return removed inflight blocks count when disconnect
eval-exec Oct 31, 2023
1a3db1a
Remove log message time cost unit
eval-exec Nov 1, 2023
03639b3
Move ChainService proposal_table to the param for start method
eval-exec Nov 4, 2023
402550c
Remove proposal_table's RWLock
eval-exec Nov 4, 2023
3f3e9ce
Add VerifiedBlockStatus::PreviouslyVerified
eval-exec Nov 13, 2023
af61674
Will move truncate process to consume_unverified_blocks
eval-exec Nov 13, 2023
99f9587
Extract consume_orphan_blocks from ChainService
eval-exec Nov 13, 2023
5b8d82d
Extract consume_unverified_blocks from ChainService
eval-exec Nov 13, 2023
c3c182a
Move out consume_unverified_blocks and consume_orphan
eval-exec Nov 13, 2023
aac56b7
Move LonelyBlock related struct to module root
eval-exec Nov 13, 2023
524b790
Fix LonelyBlockWithCallBack import path
eval-exec Nov 13, 2023
209dc32
Add ChainServicesBuilder to SharedPackage
eval-exec Nov 13, 2023
b8c5dcd
Launcher start chain_service by ChainServicesBuilder
eval-exec Nov 13, 2023
583206d
Fix ckb-sync VerifyResult import path
eval-exec Nov 13, 2023
0364d16
Fix ckb-rpc VerifyResult import path
eval-exec Nov 13, 2023
0bced38
Fix ChainService initialize for ckb import subcommand
eval-exec Nov 13, 2023
4cd2858
Fix ChainService initialize for ckb replay subcommand
eval-exec Nov 13, 2023
d3e392e
Fix ChainService initialize for ckb run subcommand
eval-exec Nov 13, 2023
dc7ef39
Extract punish_bad_peer's params to peer_id and block_hash
eval-exec Nov 13, 2023
e93a94a
Fix tell_synchronizer_to_punish_the_bad_peer's params
eval-exec Nov 13, 2023
09c2b83
Remove search_orphan_pool's param
eval-exec Nov 13, 2023
c4cb862
Add ConsumeUnverifiedBlockProcessor as child field of ConsumeUnverifi…
eval-exec Nov 17, 2023
3e22786
Make `struct ChainService` private
eval-exec Nov 19, 2023
5ee1738
Make `ConsumeUnverifiedBlockProcessor` public for crate
eval-exec Nov 19, 2023
c8a0702
Make `chain` module private, re-export `ChainController` and `ChainSe…
eval-exec Nov 19, 2023
ac1f5b4
Fix `find_fork` related unit test use `ConsumeUnverifiedBlockProcesso…
eval-exec Nov 19, 2023
2c282a7
Use `pack.take_chain_services_builder` to construct chain_controller for
eval-exec Nov 19, 2023
5875c7e
Fix `ChainController`'s import path in `ckb-sync`
eval-exec Nov 19, 2023
a020202
Fix `ChainController`'s import path in `ckb-verification`, `ckb-sync`,
eval-exec Nov 19, 2023
5766268
Fix start `ckb-chain`'s services by `pack.take_chain_services_builder`
eval-exec Nov 19, 2023
d051341
Unit test: process block by blocking way
eval-exec Nov 19, 2023
4c7afb8
Fix `ckb-sync` unit tests: Synchronizer need verify_failed_block_rx
eval-exec Nov 19, 2023
37de944
Rename `VerifiedBlockStatus` variants to a more meaningfull name
eval-exec Nov 20, 2023
44c3059
Extract `ChainServicesBuilder` start method as an independent function
eval-exec Nov 21, 2023
5d99bcc
Move ChainServicesBuilder to ckb_shared
eval-exec Nov 21, 2023
9f50138
Remove ChainServicesbuilder from ckb_chain
eval-exec Nov 21, 2023
9a4c121
Re-export `start_chain_services` in `ckb_chain`
eval-exec Nov 21, 2023
3a0ec3e
Re-sort shared_builder import statements
eval-exec Nov 22, 2023
5102e00
Re-export ChainServicesBuilder in ckb_shared
eval-exec Nov 22, 2023
8f1f0ce
Fix ckb-launcher start chain services
eval-exec Nov 22, 2023
3402c25
Fix subcommand::replay start chain_services
eval-exec Nov 22, 2023
2074572
Fix subcommand::import start chain services
eval-exec Nov 22, 2023
52d264b
Update `Cargo.lock` by `make prod`
eval-exec Nov 22, 2023
6fc9c2a
Fix ChainServicesBuilder import path in unit tests
eval-exec Nov 22, 2023
5288cb5
breadcast_compact_block only when FirstSeenAndVerified
eval-exec Nov 22, 2023
6bcb72a
ChainService should execute non_contextual_verify when switch is None
eval-exec Nov 22, 2023
b05b54a
Extract `accept_descendants` from `ConsumeOrphan`
eval-exec Nov 22, 2023
3e04822
Add `contains_block` for OrphanBlock
eval-exec Nov 22, 2023
49d76ed
Only insert new block to orphan pool if its parent not partial stored
eval-exec Nov 28, 2023
e6adcf7
ConsumeOrphan::accept_descendant expect block is not stored
eval-exec Nov 28, 2023
9dd2d45
accept_descendant does not return None
eval-exec Nov 28, 2023
b7ebb48
accept_descendants need not handle the case when accept_descendant re…
eval-exec Nov 28, 2023
468efb0
Remove `VerifiedBlockStatus::PreviouslySeenButNotVerified`
eval-exec Nov 28, 2023
aeeeb28
contains_block shoud not take ownership of self
eval-exec Nov 28, 2023
560188a
Orphan: InnerPool shoud borrow self
eval-exec Nov 28, 2023
49def2e
Extract `process_descendant` from `accept_descendant`
eval-exec Nov 28, 2023
b3da1ab
Move ForkChanges to chain/src/utils
eval-exec Nov 28, 2023
0b17fee
Fix ForkChanges related import path
eval-exec Nov 28, 2023
afafc83
Move OrphanBlocksPool to chain/src/utils
eval-exec Nov 28, 2023
798012a
Fix OrphanBlockPool related import path
eval-exec Nov 28, 2023
63fce0b
Trace last_common_ancestor timecost
eval-exec Nov 28, 2023
a651f47
Fix module orphan_block_pool usage
eval-exec Nov 28, 2023
aa302d9
Fix last common_ancestor's log message
eval-exec Nov 28, 2023
1b4fb8b
Rename FirstSeenButNotVerified to UncleBlockNotVerified
eval-exec Nov 29, 2023
92c5db9
Remove useless import statements, fix clippy
eval-exec Nov 29, 2023
548b19d
Using `ckb_chain::start_chain_services` to start ckb-chain services
eval-exec Nov 29, 2023
f9bdfcf
Benches: Start chain services by start_chain_services
eval-exec Nov 29, 2023
c6e3a52
Fix Unit test in `ckb-rpc`: Start chain services by start_chain_services
eval-exec Nov 29, 2023
034732b
Fix Unit test in `ckb-chain`: Start chain services by start_chain_ser…
eval-exec Nov 29, 2023
2829b12
Fix Unit test in `ckb-sync`: Start chain services by start_chain_serv…
eval-exec Nov 29, 2023
42c2bfd
Add blocking_insert_new_block for SyncState for Unit Test purpose
eval-exec Nov 29, 2023
9e11c56
Fix lifetime issue for Unit test in `ckb-chain`
eval-exec Nov 29, 2023
bd89cf9
Comment out sync_shared.rs related unit test
eval-exec Nov 29, 2023
b4adbe2
Remove Synchronizer::verify_failed_blocks_rx Option wrapper
eval-exec Nov 29, 2023
72370db
Fix Launcher construct Synchronizer
eval-exec Nov 29, 2023
7e06719
Remove Synchronizer::process_new_block to asynchronous_process_new_block
eval-exec Nov 29, 2023
a8b5730
Add `blocking_execute` method for `BlockProcess` for the purpose of u…
eval-exec Nov 29, 2023
4ab4061
Modify Synchronizer::blocking_process_new_block return Result<bool,Er…
eval-exec Nov 29, 2023
bf9f64c
Fix ckb-sync test_internal_db_error unit test
eval-exec Nov 29, 2023
ac3393e
Fix cargo clippy warnings
eval-exec Nov 29, 2023
d53923f
Remove orphan_block_pool from ckb-sync
eval-exec Nov 29, 2023
2ce4aec
Add Warning message for threads stop notify in ckb-chain
eval-exec Nov 29, 2023
c04d850
Fix ckb-chain consume_unveriifed_blocks stop handle
eval-exec Nov 29, 2023
f82db66
Pause chunk_process in consume_unverified_blocks thread
eval-exec Nov 29, 2023
35f2b85
Move truncate_block_request logic to consume_unverified_blocks
eval-exec Nov 29, 2023
28588a4
ChainService won't need truncate_block_rx anymore
eval-exec Nov 29, 2023
ff79c8b
Remove ChainService::start, since it has replaced by start_process_block
eval-exec Nov 29, 2023
fe07934
Fix ChainService stop_rx related handling
eval-exec Nov 29, 2023
f053edb
Fix consume_unverified truncate process
eval-exec Nov 29, 2023
35fa01d
Rename chain/src/chain.rs to chain/src/chain_service.rs
eval-exec Nov 29, 2023
ac740e2
Fix cargo clippy warnings
eval-exec Nov 29, 2023
84c5ab1
Modify VerifyFailedBlockInfo::message_bytes to msg_bytes
eval-exec Nov 30, 2023
7070cd1
Pass and return peer_id_with_msg_bytes in process_block
eval-exec Nov 30, 2023
d8164cd
Fix peer_id_and_msg_bytes for ckb-chain unit tests
eval-exec Nov 30, 2023
58e3ee0
Extract `ConsumeDescendantProcessor` from `ConsumeOrphan`
eval-exec Nov 30, 2023
43b3d8f
Attach `accept_descendant` method to `ConsumeDescendantProcessor`
eval-exec Nov 30, 2023
1237748
Public ConsumeDescendantProcessor struct fields
eval-exec Nov 30, 2023
1d23ce1
Fix ckb-chain find_fork related Unit Test
eval-exec Nov 30, 2023
912cc53
Fix Cargo fmt
eval-exec Nov 30, 2023
ee28a41
Update sync_state RPC document
eval-exec Nov 30, 2023
0cf9f03
Add docs for ckb-shared, fix clippy docs warnings
eval-exec Nov 30, 2023
27247d3
Add docs for ckb-chain, fix clippy warnings
eval-exec Nov 30, 2023
a114f7b
Fix cargo clippy warnings for ckb-benches
eval-exec Nov 30, 2023
7e38dc6
Fix cargo clippy warnings for ckb-sync
eval-exec Nov 30, 2023
76d520c
Broadcast compact block when VerifiedStatus is FirstSeenAndVerified o…
eval-exec Nov 30, 2023
6ba4081
Add extra comma for tip_hash in rpc example, execute make gen-rpc-doc
eval-exec Nov 30, 2023
7354d3f
Add `init_for_test` logger helper, only used by unit test
eval-exec Nov 30, 2023
119c67c
Fix unit test for synchronizer::basic_sync
eval-exec Nov 30, 2023
60c0db7
Improve sync chart drawer more friendly
eval-exec Dec 21, 2023
1a47c9e
Fix ckb workspace members crate version to 0.114.0-pre
eval-exec Dec 26, 2023
c8c21b3
Fix unit test for ckb-rpc, use blocking_process_block
eval-exec Dec 26, 2023
634fea2
Fix BlockFetcher fetch should not use unverified_tip to change last_c…
eval-exec Jan 9, 2024
3162410
Fix unit test: `test_switch_valid_fork`
eval-exec Jan 9, 2024
265c372
BlockFetcher should only set_last_common_header when status is BLOCK_…
eval-exec Jan 9, 2024
abb800f
Simplify `ConsumeDescendantProcessor` unverified_blocks_tx send code
eval-exec Jan 11, 2024
65e1ccb
Fix matches result did not assert its result
eval-exec Jan 11, 2024
bd8e0f0
Split get_ancestor's logic to unverified_tip and tip
eval-exec Jan 11, 2024
f62ae4f
BlockFetcher get ancestor with unverified_tip
eval-exec Jan 11, 2024
54eb49d
Clean expired orphan blocks
eval-exec Jan 11, 2024
8c10a5d
Split ChainController out chain_service.rs
eval-exec Jan 11, 2024
76f592a
ChainService should mark block as BLOCK_INVALID if it does not pass n…
eval-exec Jan 11, 2024
b50b8ca
Change `VerifyResult` to `Result<bool, Error>`
eval-exec Jan 11, 2024
4a60d27
ConsumeUnverified do not need VerifiedBlockStatus enum type anymore
eval-exec Jan 11, 2024
047b4df
Do not need VerifiedBlockStatus in ckb-rpc and ckb-sync
eval-exec Jan 11, 2024
8d6e649
Fix unit test: do not need VerifiedBlockStatus
eval-exec Jan 11, 2024
e7394f9
Remove VerifiedBlockStatus enum type and related imports statements
eval-exec Jan 11, 2024
3a05207
Remove useless crate dependencies, fix warnings of check-cargotoml.sh
eval-exec Jan 11, 2024
70abff5
Fix ConsumeUnverified: should return `Ok(false)` if it's a block which
eval-exec Jan 11, 2024
1768313
Fix lint, remove whitespace
eval-exec Jan 11, 2024
5cd6a15
BlockFetcher calculate `start` and ancestor header should aware IBDState
eval-exec Jan 15, 2024
584cfdf
BlockFetcher check whether to request block from a peer should aware …
eval-exec Jan 15, 2024
e52ffc8
BlockFetcher should only return if best_known <= unverified_tip in IB…
eval-exec Jan 15, 2024
77fad92
SyncShared::accept_block will mark the block as BLOCK_RECEIVED if its…
eval-exec Jan 15, 2024
9b57fc7
Fix ckb-sync test_insert_parent_unknown_block
eval-exec Jan 15, 2024
15b6aea
ConsumeOrphan should mark the block as PARTIAL_STORED before send it …
eval-exec Jan 15, 2024
fea433d
Add more log message for debug
eval-exec Jan 16, 2024
5b66fdd
Shared provide generic version of get_block_status for Snapshot and s…
eval-exec Jan 16, 2024
c45bcbe
ckb-chain load get_block_status from shared.store()
eval-exec Jan 16, 2024
4ebf5d6
ActiveChain get_block_status from snapshot()
eval-exec Jan 16, 2024
02077d8
Fix SyncShared's field name in BlockFetcher and HeadersProcess
eval-exec Jan 16, 2024
1af17f2
Remove BlockStatus::BLOCK_PARTIAL_STORED
eval-exec Jan 16, 2024
132b592
Change BLOCK_PARTIAL_STORED to BLOCK_STORED
eval-exec Jan 16, 2024
40274f3
Improve draw chart script add more major and minor ticks on x/yaxis
eval-exec Jan 17, 2024
755f1f4
Add log for `MinerRpcImpl::submit_block` new_block check
eval-exec Jan 17, 2024
c60ad95
Comment out shrink_to_fit for header_map's MemoryMap
eval-exec Jan 17, 2024
1f105f2
ChainService should not punish remote peer if failed to send block to…
eval-exec Jan 17, 2024
aa9e021
Remove meaning less TODO note in test_internal_db_error, improve draw…
eval-exec Jan 18, 2024
0bee89e
test: randomly kill and restart node
contrun Jan 16, 2024
db24fab
add integration test for sync with churn nodes
contrun Jan 17, 2024
51fdab2
test: make Node struct clonable
contrun Jan 17, 2024
ec6f0f2
test: run SyncChurn mining and restart in different threads
contrun Jan 17, 2024
6c9e4de
test: cargo {clippy,fmt}
contrun Jan 18, 2024
b14297d
test: document what SyncChurn does and its weakness
contrun Jan 18, 2024
2accb72
test: make two mining nodes in SyncChurn
contrun Jan 18, 2024
6aa9605
test: don't mine too many blocks in SyncChurn
contrun Jan 18, 2024
a45c1ee
Improve draw chart script, no vertial line label overcover
eval-exec Jan 19, 2024
b780434
Add unverified tip related metrics to ckb_metrics
eval-exec Jan 22, 2024
bbf2640
Add minstant to ckb_chain dependency
eval-exec Jan 22, 2024
1d40cf4
Collect ckb_chain timecost and unverified_tip metrics
eval-exec Jan 22, 2024
d34493d
Collect execute_callback timecost for metrics
eval-exec Jan 22, 2024
888e421
Unverified block in db
eval-exec Jan 17, 2024
10f2d62
UnverifiedBlockHash size to 3
eval-exec Jan 18, 2024
446c9e2
Comment MemoryMap remove shrink_to_fit
eval-exec Jan 23, 2024
fb33871
Remove UnverifiedBlockHash since consume_unverified can load parent_h…
eval-exec Jan 23, 2024
e72e523
ConsumeOrphan only need pass LonelyBlockHashWithCallback to ConsumeUn…
eval-exec Jan 23, 2024
b0dff41
Replace the `Into` implementation LonelyBlockWithCallback with `From<…
eval-exec Jan 23, 2024
8ac2d51
Fix ConsumeUnverified thread need LonelyBlockHashWithCallback in find…
eval-exec Jan 23, 2024
243762b
Consider the edge case of processing genesis block
contrun Jan 22, 2024
5a65518
Copy ibd_finished field from shared to HeaderMapKernal
eval-exec Jan 24, 2024
60f287d
HeaderMap do not shrink_to_fit in IBD mode
eval-exec Jan 24, 2024
7a29279
test inserting block with stored but unverified parent
contrun Jan 24, 2024
8f05dfb
ConsumeUnverified should call get_update_for_tip_hash after begin_tra…
eval-exec Jan 25, 2024
f66dcf4
Cargo fmt, apply check-whitespaces
eval-exec Jan 25, 2024
18ec800
Change process duration from Gauge to Histogram, add metrics for ckb-…
eval-exec Jan 25, 2024
f64762f
Collect ckb-chain and ckb-sync timecost Histogram metrics
eval-exec Jan 25, 2024
953d298
Add orphan blocks count metric
eval-exec Jan 25, 2024
f35f304
Add header_map limit_memory and operation duration metric
eval-exec Jan 26, 2024
9b2f1fc
Collect header_map limit_memory and operations timecost
eval-exec Jan 26, 2024
bd8dcf8
ConsumeOrphan should not insert a block to orphan pool if its parent …
eval-exec Jan 29, 2024
965f27a
Remove `ChainController`'s useless methods, fix method comments
eval-exec Jan 29, 2024
e529964
Add HeaderMap memory count and cache hit/miss count metrics
eval-exec Jan 29, 2024
0c5c110
Collect HeaderMap MemoryMap cache hit/miss count and total count
eval-exec Jan 29, 2024
5a1be0a
ConsumeUnverified do not realy need pass whole UnverifiedBlock to fn …
eval-exec Jan 29, 2024
9acafc0
Remove msg_bytes from LonelyBlock
eval-exec Jan 29, 2024
3efab78
Remove msg_bytes from VerifyFailedBlockInfo
eval-exec Jan 29, 2024
377cfa3
ckb-sync do not need pass msg_bytes to ckb-chain
eval-exec Jan 29, 2024
75ed98b
`ckb-sync`'s unit test won't need `msg_bytes` anymore
eval-exec Jan 29, 2024
cd5b739
`blocking_process_block` returns a bool, use a proper name
eval-exec Jan 29, 2024
67d8397
Metrics: header_map hit/miss should contains `contains_key`
eval-exec Jan 30, 2024
1cee0df
Add `struct RemoteBlock` for ckb-chain, let ckb-sync and ckb-relayer …
eval-exec Jan 31, 2024
9ae284d
Modify ckb-chain use RemoteBlock, drop LonelyBlockWithCallback
eval-exec Jan 31, 2024
f59dfd9
ckb-sync use accept_remote_block to process remote block
eval-exec Jan 31, 2024
70cc857
Modify unit test in ckb-sync and ckb-chain to use RemoteBlock related…
eval-exec Jan 31, 2024
7927933
Fix HeaderMap memory count
eval-exec Feb 1, 2024
7897021
Fix rebase conflicts with develop: https://github.com/nervosnetwork/c…
eval-exec Feb 2, 2024
413d7de
Fix chain service builder for test_accept_block
eval-exec Feb 4, 2024
a4c4427
add inflight count and inflight timeout count for ckb-metrics
eval-exec Feb 4, 2024
d6da23d
Add lonely_block channel and unverified_block channel length
eval-exec Feb 4, 2024
c3f8c44
Add test to ensure the results of remove_blocks_by_parent are sorted
contrun Feb 5, 2024
d475fc7
Add test to ensure that leader always have children
contrun Feb 5, 2024
c0d4732
Fix blocks_are_sorted checking logic error
contrun Feb 5, 2024
e329d90
Remove tell_synchronizer_to_punish_the_bad_peer from ckb-chain
eval-exec Feb 6, 2024
651c738
Use verify_callbacl to handle peer punish and compact block broadcast
eval-exec Feb 6, 2024
d5cbbd4
Fix sync and relayer unit test by verify_callback
eval-exec Feb 6, 2024
d24ae7c
Remove VerifyFailedInfo, remove verify_failed_block channel
eval-exec Feb 6, 2024
0461c78
Remove broadcast_compact_block channel
eval-exec Feb 6, 2024
87baae3
Add debug log for block_fetcher->get_ancestor
eval-exec Feb 6, 2024
af6fd9c
chore: remove channel send error callback
quake Feb 6, 2024
0306870
chore: remove UnverifiedBlock
quake Feb 6, 2024
2db56e1
Find and verify unverified blocks on ckb startup
eval-exec Feb 7, 2024
017a5ce
Fix cargo clippy warnings
eval-exec Feb 7, 2024
efea310
Use `Release` to `store`, `Acquire` to `read` for atomic: `is_verifyi…
eval-exec Feb 8, 2024
e099d80
Do not accept descendants if parent is invalid
eval-exec Feb 21, 2024
fdfc701
Update rpc docs, fix CI test
eval-exec Feb 23, 2024
ae70537
Release ckb-async-download rc0
eval-exec Feb 26, 2024
c203588
Do not re-store_unverified_block if it is still verifying by ConsumeU…
eval-exec Mar 5, 2024
9af7fab
Apply cargo clippy suggestions
eval-exec Mar 18, 2024
6b2d4a0
Prestore block to db before insert to orphan block pool
eval-exec Mar 19, 2024
3fa5e0a
reduce channel length
eval-exec Mar 21, 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
70 changes: 66 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 @@ -125,13 +125,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