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

Put parent_header to PreloadUnverified, and keep small block in memory #4461

Closed
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
f12644f
Remove useless import orphan_block_pool in ckb-sync
eval-exec Oct 25, 2023
1f83b3e
Fix blocking process block usage in benches/benches/benchmarks/always…
eval-exec Oct 25, 2023
6123d60
Fix blocking process block usage in benches/benches/benchmarks/overal…
eval-exec Oct 25, 2023
9d4ae55
Fix blocking process block usage in benches/benches/benchmarks/resolv…
eval-exec Oct 25, 2023
17a571e
Fix blocking process block usage in benches/benches/benchmarks/secp_2…
eval-exec Oct 25, 2023
d3420e3
let ckb-import and ckb-replay construct ChainService with SharedPackage
eval-exec Oct 25, 2023
3896d3b
Fix Unit test: ckb-light-client-protocol-server::tests/utils/chain.rs
eval-exec Oct 25, 2023
0e4e859
Fix Unit test: ckb-verification::contextual/src/tests/uncle_verifier.rs
eval-exec Oct 25, 2023
684654c
Fix Unit test: ckb-verification::contextual/src/tests/contextual_bloc…
eval-exec Oct 25, 2023
50eae6e
Fix Unit test: ckb-sync::src/tests/util.rs
eval-exec Oct 25, 2023
89da541
Fix blocking process block usage in sync/src/relayer/tests/helper.rs
eval-exec Oct 25, 2023
6b9cb22
Fix Unit test of blocking process block usage in ckb-sync
eval-exec Oct 25, 2023
e6d45af
Use blocking process_block method for benches/benches/benchmarks/secp…
eval-exec Oct 25, 2023
bae4525
Benches: Construct ChainService with SharedPackage provided verify_fa…
eval-exec Oct 25, 2023
7b2297b
Modify BlockStatus by SyncShared.Shared
eval-exec Oct 25, 2023
e32648a
Unit Test: Use SharedPackage to construct ChainService
eval-exec Oct 25, 2023
8019a93
Unit Test: Use SharedPackage to construct ChainService in ckb-chain::…
eval-exec Oct 25, 2023
c5fa529
Unit test: Modify `ChainService` initialization to include `pack.take…
eval-exec Oct 25, 2023
4fb9013
Unit test: Modify the `new` function in `ChainService` to include ver…
eval-exec Oct 25, 2023
10eba3a
Unit test: Initialization of ChainService need pack.take_verify_faile…
eval-exec Oct 25, 2023
b2d51c5
Add more minor ticks to sync progress chart
eval-exec Oct 30, 2023
bd7bad0
Add draft mermaid sequence diagram for develop branch
eval-exec Oct 30, 2023
1b4256d
Add draft mermaid sequence diagram for asynchronous block download
eval-exec Oct 30, 2023
0c05d58
Add unverified block info to sync_state rpc
eval-exec Oct 30, 2023
cd6d91f
Upgrade Synchronizer disconnect log level from debug to info
eval-exec Oct 30, 2023
d1d5fec
Add tip_hash and tip_number to sync_state rpc
eval-exec Oct 31, 2023
2008b2d
Set receive exit signal log from debug to info
eval-exec Oct 31, 2023
5d425a2
Let HeaderMap stats feature use info log
eval-exec Oct 31, 2023
cac179c
Activate HeaderMap stats profiling feature in `make profiling`
eval-exec Oct 31, 2023
6a8bb07
Return removed inflight blocks count when disconnect
eval-exec Oct 31, 2023
a156035
Remove log message time cost unit
eval-exec Nov 1, 2023
67cf9f7
Move ChainService proposal_table to the param for start method
eval-exec Nov 4, 2023
0311dc1
Remove proposal_table's RWLock
eval-exec Nov 4, 2023
d448c9d
Add VerifiedBlockStatus::PreviouslyVerified
eval-exec Nov 13, 2023
e52b701
Will move truncate process to consume_unverified_blocks
eval-exec Nov 13, 2023
d74ea38
Extract consume_orphan_blocks from ChainService
eval-exec Nov 13, 2023
fadf40a
Extract consume_unverified_blocks from ChainService
eval-exec Nov 13, 2023
9eb0862
Move out consume_unverified_blocks and consume_orphan
eval-exec Nov 13, 2023
c26d093
Move LonelyBlock related struct to module root
eval-exec Nov 13, 2023
5cca41e
Fix LonelyBlockWithCallBack import path
eval-exec Nov 13, 2023
efbe594
Add ChainServicesBuilder to SharedPackage
eval-exec Nov 13, 2023
eb702e5
Launcher start chain_service by ChainServicesBuilder
eval-exec Nov 13, 2023
6ac088e
Fix ckb-sync VerifyResult import path
eval-exec Nov 13, 2023
66ac36c
Fix ckb-rpc VerifyResult import path
eval-exec Nov 13, 2023
03e0548
Fix ChainService initialize for ckb import subcommand
eval-exec Nov 13, 2023
942707b
Fix ChainService initialize for ckb replay subcommand
eval-exec Nov 13, 2023
dfef050
Fix ChainService initialize for ckb run subcommand
eval-exec Nov 13, 2023
9b4d84b
Extract punish_bad_peer's params to peer_id and block_hash
eval-exec Nov 13, 2023
d1d88ef
Fix tell_synchronizer_to_punish_the_bad_peer's params
eval-exec Nov 13, 2023
d7e41a9
Remove search_orphan_pool's param
eval-exec Nov 13, 2023
c98aef9
Add ConsumeUnverifiedBlockProcessor as child field of ConsumeUnverifi…
eval-exec Nov 17, 2023
9245988
Make `struct ChainService` private
eval-exec Nov 19, 2023
6c9332e
Make `ConsumeUnverifiedBlockProcessor` public for crate
eval-exec Nov 19, 2023
879e811
Make `chain` module private, re-export `ChainController` and `ChainSe…
eval-exec Nov 19, 2023
ea5b345
Fix `find_fork` related unit test use `ConsumeUnverifiedBlockProcesso…
eval-exec Nov 19, 2023
2772233
Use `pack.take_chain_services_builder` to construct chain_controller for
eval-exec Nov 19, 2023
899f63f
Fix `ChainController`'s import path in `ckb-sync`
eval-exec Nov 19, 2023
eb28cd0
Fix `ChainController`'s import path in `ckb-verification`, `ckb-sync`,
eval-exec Nov 19, 2023
0c62b41
Fix start `ckb-chain`'s services by `pack.take_chain_services_builder`
eval-exec Nov 19, 2023
668ac7e
Unit test: process block by blocking way
eval-exec Nov 19, 2023
5660241
Fix `ckb-sync` unit tests: Synchronizer need verify_failed_block_rx
eval-exec Nov 19, 2023
96b5f7f
Rename `VerifiedBlockStatus` variants to a more meaningfull name
eval-exec Nov 20, 2023
261a3b7
Extract `ChainServicesBuilder` start method as an independent function
eval-exec Nov 21, 2023
c11ecfc
Move ChainServicesBuilder to ckb_shared
eval-exec Nov 21, 2023
f839a46
Remove ChainServicesbuilder from ckb_chain
eval-exec Nov 21, 2023
9445f93
Re-export `start_chain_services` in `ckb_chain`
eval-exec Nov 21, 2023
a82711f
Re-sort shared_builder import statements
eval-exec Nov 22, 2023
6cbfc73
Re-export ChainServicesBuilder in ckb_shared
eval-exec Nov 22, 2023
9cd1f41
Fix ckb-launcher start chain services
eval-exec Nov 22, 2023
f4044a8
Fix subcommand::replay start chain_services
eval-exec Nov 22, 2023
34a78ec
Fix subcommand::import start chain services
eval-exec Nov 22, 2023
0bb964c
Fix ChainServicesBuilder import path in unit tests
eval-exec Nov 22, 2023
080edfd
breadcast_compact_block only when FirstSeenAndVerified
eval-exec Nov 22, 2023
3064997
ChainService should execute non_contextual_verify when switch is None
eval-exec Nov 22, 2023
295843e
Extract `accept_descendants` from `ConsumeOrphan`
eval-exec Nov 22, 2023
8aacf44
Add `contains_block` for OrphanBlock
eval-exec Nov 22, 2023
2d86f50
Only insert new block to orphan pool if its parent not partial stored
eval-exec Nov 28, 2023
6d6bf22
ConsumeOrphan::accept_descendant expect block is not stored
eval-exec Nov 28, 2023
0128342
accept_descendant does not return None
eval-exec Nov 28, 2023
40dc9fb
accept_descendants need not handle the case when accept_descendant re…
eval-exec Nov 28, 2023
7c8726d
Remove `VerifiedBlockStatus::PreviouslySeenButNotVerified`
eval-exec Nov 28, 2023
800b952
contains_block shoud not take ownership of self
eval-exec Nov 28, 2023
c570523
Orphan: InnerPool shoud borrow self
eval-exec Nov 28, 2023
104f4bf
Extract `process_descendant` from `accept_descendant`
eval-exec Nov 28, 2023
a4c0045
Move ForkChanges to chain/src/utils
eval-exec Nov 28, 2023
75eae39
Fix ForkChanges related import path
eval-exec Nov 28, 2023
1b87a17
Move OrphanBlocksPool to chain/src/utils
eval-exec Nov 28, 2023
67edc03
Fix OrphanBlockPool related import path
eval-exec Nov 28, 2023
379f4d4
Trace last_common_ancestor timecost
eval-exec Nov 28, 2023
61c5039
Fix module orphan_block_pool usage
eval-exec Nov 28, 2023
fc00999
Fix last common_ancestor's log message
eval-exec Nov 28, 2023
9a98474
Rename FirstSeenButNotVerified to UncleBlockNotVerified
eval-exec Nov 29, 2023
76357d8
Remove useless import statements, fix clippy
eval-exec Nov 29, 2023
a524a46
Using `ckb_chain::start_chain_services` to start ckb-chain services
eval-exec Nov 29, 2023
0e1a66c
Benches: Start chain services by start_chain_services
eval-exec Nov 29, 2023
2b1c59b
Fix Unit test in `ckb-rpc`: Start chain services by start_chain_services
eval-exec Nov 29, 2023
ee2e138
Fix Unit test in `ckb-chain`: Start chain services by start_chain_ser…
eval-exec Nov 29, 2023
aa7e684
Fix Unit test in `ckb-sync`: Start chain services by start_chain_serv…
eval-exec Nov 29, 2023
94f7f1c
Add blocking_insert_new_block for SyncState for Unit Test purpose
eval-exec Nov 29, 2023
0d14ab8
Fix lifetime issue for Unit test in `ckb-chain`
eval-exec Nov 29, 2023
97d835c
Comment out sync_shared.rs related unit test
eval-exec Nov 29, 2023
a13ab75
Remove Synchronizer::verify_failed_blocks_rx Option wrapper
eval-exec Nov 29, 2023
faca7ab
Fix Launcher construct Synchronizer
eval-exec Nov 29, 2023
4840709
Remove Synchronizer::process_new_block to asynchronous_process_new_block
eval-exec Nov 29, 2023
49b4c43
Add `blocking_execute` method for `BlockProcess` for the purpose of u…
eval-exec Nov 29, 2023
1632e6f
Modify Synchronizer::blocking_process_new_block return Result<bool,Er…
eval-exec Nov 29, 2023
ca0d308
Fix ckb-sync test_internal_db_error unit test
eval-exec Nov 29, 2023
0f2b927
Fix cargo clippy warnings
eval-exec Nov 29, 2023
dfabd53
Remove orphan_block_pool from ckb-sync
eval-exec Nov 29, 2023
d8f2a5e
Add Warning message for threads stop notify in ckb-chain
eval-exec Nov 29, 2023
c1cc118
Fix ckb-chain consume_unveriifed_blocks stop handle
eval-exec Nov 29, 2023
1015452
Pause chunk_process in consume_unverified_blocks thread
eval-exec Nov 29, 2023
05b1d17
Move truncate_block_request logic to consume_unverified_blocks
eval-exec Nov 29, 2023
f28a19f
ChainService won't need truncate_block_rx anymore
eval-exec Nov 29, 2023
15c24db
Remove ChainService::start, since it has replaced by start_process_block
eval-exec Nov 29, 2023
40e3418
Fix ChainService stop_rx related handling
eval-exec Nov 29, 2023
63aa808
Fix consume_unverified truncate process
eval-exec Nov 29, 2023
cfed1d9
Rename chain/src/chain.rs to chain/src/chain_service.rs
eval-exec Nov 29, 2023
f5d6773
Fix cargo clippy warnings
eval-exec Nov 29, 2023
ae2bd26
Modify VerifyFailedBlockInfo::message_bytes to msg_bytes
eval-exec Nov 30, 2023
2d31569
Pass and return peer_id_with_msg_bytes in process_block
eval-exec Nov 30, 2023
673fab4
Fix peer_id_and_msg_bytes for ckb-chain unit tests
eval-exec Nov 30, 2023
6ff15b2
Extract `ConsumeDescendantProcessor` from `ConsumeOrphan`
eval-exec Nov 30, 2023
ea42030
Attach `accept_descendant` method to `ConsumeDescendantProcessor`
eval-exec Nov 30, 2023
44cbeb1
Public ConsumeDescendantProcessor struct fields
eval-exec Nov 30, 2023
52fd1ec
Fix ckb-chain find_fork related Unit Test
eval-exec Nov 30, 2023
0755a94
Update sync_state RPC document
eval-exec Nov 30, 2023
23adbbb
Add docs for ckb-shared, fix clippy docs warnings
eval-exec Nov 30, 2023
cfa65f4
Add docs for ckb-chain, fix clippy warnings
eval-exec Nov 30, 2023
050f023
Fix cargo clippy warnings for ckb-benches
eval-exec Nov 30, 2023
b556f19
Fix cargo clippy warnings for ckb-sync
eval-exec Nov 30, 2023
2a9fbe3
Broadcast compact block when VerifiedStatus is FirstSeenAndVerified o…
eval-exec Nov 30, 2023
9e0b3e5
Add `init_for_test` logger helper, only used by unit test
eval-exec Nov 30, 2023
8924ad6
Fix unit test for synchronizer::basic_sync
eval-exec Nov 30, 2023
19e9e3b
Improve sync chart drawer more friendly
eval-exec Dec 21, 2023
c202ae0
Fix ckb workspace members crate version to 0.114.0-pre
eval-exec Dec 26, 2023
7d7be2e
Fix unit test for ckb-rpc, use blocking_process_block
eval-exec Dec 26, 2023
b45fb26
Fix BlockFetcher fetch should not use unverified_tip to change last_c…
eval-exec Jan 9, 2024
ff64236
Fix unit test: `test_switch_valid_fork`
eval-exec Jan 9, 2024
653ffbb
Simplify `ConsumeDescendantProcessor` unverified_blocks_tx send code
eval-exec Jan 11, 2024
c38f369
Fix matches result did not assert its result
eval-exec Jan 11, 2024
50b0604
Split get_ancestor's logic to unverified_tip and tip
eval-exec Jan 11, 2024
a73fa8a
BlockFetcher get ancestor with unverified_tip
eval-exec Jan 11, 2024
6d1b775
Clean expired orphan blocks
eval-exec Jan 11, 2024
29a3fd2
Split ChainController out chain_service.rs
eval-exec Jan 11, 2024
f0c157a
ChainService should mark block as BLOCK_INVALID if it does not pass n…
eval-exec Jan 11, 2024
4dfa358
Change `VerifyResult` to `Result<bool, Error>`
eval-exec Jan 11, 2024
34bff41
ConsumeUnverified do not need VerifiedBlockStatus enum type anymore
eval-exec Jan 11, 2024
65cee41
Do not need VerifiedBlockStatus in ckb-rpc and ckb-sync
eval-exec Jan 11, 2024
93bc41b
Fix unit test: do not need VerifiedBlockStatus
eval-exec Jan 11, 2024
06587f1
Remove VerifiedBlockStatus enum type and related imports statements
eval-exec Jan 11, 2024
a59091d
Remove useless crate dependencies, fix warnings of check-cargotoml.sh
eval-exec Jan 11, 2024
ca12513
Fix ConsumeUnverified: should return `Ok(false)` if it's a block which
eval-exec Jan 11, 2024
47d4e7e
Fix lint, remove whitespace
eval-exec Jan 11, 2024
9e6b3f1
BlockFetcher calculate `start` and ancestor header should aware IBDState
eval-exec Jan 15, 2024
8341736
BlockFetcher should only return if best_known <= unverified_tip in IB…
eval-exec Jan 15, 2024
ba33561
SyncShared::accept_block will mark the block as BLOCK_RECEIVED if its…
eval-exec Jan 15, 2024
cab3f3b
Fix ckb-sync test_insert_parent_unknown_block
eval-exec Jan 15, 2024
faed8d4
ConsumeOrphan should mark the block as PARTIAL_STORED before send it …
eval-exec Jan 15, 2024
30f007a
Add more log message for debug
eval-exec Jan 16, 2024
f3d7fcc
Shared provide generic version of get_block_status for Snapshot and s…
eval-exec Jan 16, 2024
c560e11
ckb-chain load get_block_status from shared.store()
eval-exec Jan 16, 2024
a1625bd
ActiveChain get_block_status from snapshot()
eval-exec Jan 16, 2024
e93c092
Fix SyncShared's field name in BlockFetcher and HeadersProcess
eval-exec Jan 16, 2024
007211b
Remove BlockStatus::BLOCK_PARTIAL_STORED
eval-exec Jan 16, 2024
489c332
Change BLOCK_PARTIAL_STORED to BLOCK_STORED
eval-exec Jan 16, 2024
e438bab
Improve draw chart script add more major and minor ticks on x/yaxis
eval-exec Jan 17, 2024
723f991
Add log for `MinerRpcImpl::submit_block` new_block check
eval-exec Jan 17, 2024
8557c47
Comment out shrink_to_fit for header_map's MemoryMap
eval-exec Jan 17, 2024
e1a42f0
ChainService should not punish remote peer if failed to send block to…
eval-exec Jan 17, 2024
03dfcdd
Remove meaning less TODO note in test_internal_db_error, improve draw…
eval-exec Jan 18, 2024
6a33a29
test: randomly kill and restart node
contrun Jan 16, 2024
959f9a5
add integration test for sync with churn nodes
contrun Jan 17, 2024
a850217
test: make Node struct clonable
contrun Jan 17, 2024
6280084
test: run SyncChurn mining and restart in different threads
contrun Jan 17, 2024
79637b2
test: cargo {clippy,fmt}
contrun Jan 18, 2024
40c9145
test: document what SyncChurn does and its weakness
contrun Jan 18, 2024
ff3f0b5
test: make two mining nodes in SyncChurn
contrun Jan 18, 2024
1fe65fe
test: don't mine too many blocks in SyncChurn
contrun Jan 18, 2024
1815508
Improve draw chart script, no vertial line label overcover
eval-exec Jan 19, 2024
5f9502a
Add unverified tip related metrics to ckb_metrics
eval-exec Jan 22, 2024
ffc80ef
Add minstant to ckb_chain dependency
eval-exec Jan 22, 2024
53ff5c6
Collect ckb_chain timecost and unverified_tip metrics
eval-exec Jan 22, 2024
ddb0fe2
Collect execute_callback timecost for metrics
eval-exec Jan 22, 2024
283d6a5
Unverified block in db
eval-exec Jan 17, 2024
24521d7
UnverifiedBlockHash size to 3
eval-exec Jan 18, 2024
e8ae850
Comment MemoryMap remove shrink_to_fit
eval-exec Jan 23, 2024
ecc9524
Remove UnverifiedBlockHash since consume_unverified can load parent_h…
eval-exec Jan 23, 2024
eb042df
ConsumeOrphan only need pass LonelyBlockHashWithCallback to ConsumeUn…
eval-exec Jan 23, 2024
a500f58
Replace the `Into` implementation LonelyBlockWithCallback with `From<…
eval-exec Jan 23, 2024
0726e87
Fix ConsumeUnverified thread need LonelyBlockHashWithCallback in find…
eval-exec Jan 23, 2024
d4fc884
Consider the edge case of processing genesis block
contrun Jan 22, 2024
7a8e5e5
Copy ibd_finished field from shared to HeaderMapKernal
eval-exec Jan 24, 2024
753e630
HeaderMap do not shrink_to_fit in IBD mode
eval-exec Jan 24, 2024
b80ae70
test inserting block with stored but unverified parent
contrun Jan 24, 2024
4a2fb75
ConsumeUnverified should call get_update_for_tip_hash after begin_tra…
eval-exec Jan 25, 2024
6c35037
Cargo fmt, apply check-whitespaces
eval-exec Jan 25, 2024
43021a4
Change process duration from Gauge to Histogram, add metrics for ckb-…
eval-exec Jan 25, 2024
c22237b
Collect ckb-chain and ckb-sync timecost Histogram metrics
eval-exec Jan 25, 2024
ca45c48
Add orphan blocks count metric
eval-exec Jan 25, 2024
f0e5b8b
Add header_map limit_memory and operation duration metric
eval-exec Jan 26, 2024
81ceb35
Collect header_map limit_memory and operations timecost
eval-exec Jan 26, 2024
21a66a6
ConsumeOrphan should not insert a block to orphan pool if its parent …
eval-exec Jan 29, 2024
13cc8b9
Remove `ChainController`'s useless methods, fix method comments
eval-exec Jan 29, 2024
eb8631f
Add HeaderMap memory count and cache hit/miss count metrics
eval-exec Jan 29, 2024
357e7fc
Collect HeaderMap MemoryMap cache hit/miss count and total count
eval-exec Jan 29, 2024
0686101
ConsumeUnverified do not realy need pass whole UnverifiedBlock to fn …
eval-exec Jan 29, 2024
4c439a2
Remove msg_bytes from LonelyBlock
eval-exec Jan 29, 2024
61dc6cb
Remove msg_bytes from VerifyFailedBlockInfo
eval-exec Jan 29, 2024
51207a1
ckb-sync do not need pass msg_bytes to ckb-chain
eval-exec Jan 29, 2024
9056aa2
`ckb-sync`'s unit test won't need `msg_bytes` anymore
eval-exec Jan 29, 2024
0fb95a8
`blocking_process_block` returns a bool, use a proper name
eval-exec Jan 29, 2024
726b4f1
Metrics: header_map hit/miss should contains `contains_key`
eval-exec Jan 30, 2024
f3582d4
Add `struct RemoteBlock` for ckb-chain, let ckb-sync and ckb-relayer …
eval-exec Jan 31, 2024
17fba8c
Modify ckb-chain use RemoteBlock, drop LonelyBlockWithCallback
eval-exec Jan 31, 2024
fb79079
ckb-sync use accept_remote_block to process remote block
eval-exec Jan 31, 2024
e0fd530
Modify unit test in ckb-sync and ckb-chain to use RemoteBlock related…
eval-exec Jan 31, 2024
41bd9c9
Fix HeaderMap memory count
eval-exec Feb 1, 2024
f905ff8
Fix rebase conflicts with develop: https://github.com/nervosnetwork/c…
eval-exec Feb 2, 2024
d5f23fc
Fix chain service builder for test_accept_block
eval-exec Feb 4, 2024
af8fe0d
add inflight count and inflight timeout count for ckb-metrics
eval-exec Feb 4, 2024
0028fb1
Add lonely_block channel and unverified_block channel length
eval-exec Feb 4, 2024
b5a9b48
Add test to ensure the results of remove_blocks_by_parent are sorted
contrun Feb 5, 2024
cc795c2
Fix blocks_are_sorted checking logic error
contrun Feb 5, 2024
ba5bca7
Remove tell_synchronizer_to_punish_the_bad_peer from ckb-chain
eval-exec Feb 6, 2024
fc7ca90
Use verify_callbacl to handle peer punish and compact block broadcast
eval-exec Feb 6, 2024
a0c6ff8
Fix sync and relayer unit test by verify_callback
eval-exec Feb 6, 2024
86deeb3
Remove VerifyFailedInfo, remove verify_failed_block channel
eval-exec Feb 6, 2024
565800b
Remove broadcast_compact_block channel
eval-exec Feb 6, 2024
156b86e
Add debug log for block_fetcher->get_ancestor
eval-exec Feb 6, 2024
00fae3d
chore: remove channel send error callback
quake Feb 6, 2024
e066c68
chore: remove UnverifiedBlock
quake Feb 6, 2024
75a8007
Find and verify unverified blocks on ckb startup
eval-exec Feb 7, 2024
e33733f
Fix cargo clippy warnings
eval-exec Feb 7, 2024
63f767a
Use `Release` to `store`, `Acquire` to `read` for atomic: `is_verifyi…
eval-exec Feb 8, 2024
b098b1f
Do not accept descendants if parent is invalid
eval-exec Feb 21, 2024
f1ad952
Update rpc docs, fix CI test
eval-exec Feb 23, 2024
8f18471
Release ckb-async-download rc0
eval-exec Feb 26, 2024
fab3055
Do not re-store_unverified_block if it is still verifying by ConsumeU…
eval-exec Mar 5, 2024
6e7bbcf
Apply cargo clippy suggestions
eval-exec Mar 18, 2024
e86b6c9
Rebased develop, regenerate rpc docs, remove orphan pool total_size l…
eval-exec Mar 21, 2024
c9617c4
Prestore block to db before orphan pool, use fill unverified thread t…
eval-exec Mar 20, 2024
23386c1
`Shared::get_block_status` always read `BlockExt` from snapshot
eval-exec Mar 27, 2024
47e2ff3
Release ckb-async-download rc1
eval-exec Mar 28, 2024
0f8c8c8
Apply code review suggestions
eval-exec Apr 5, 2024
e6ca07b
Remove block_status_map if block is is_internal_db_error
eval-exec Apr 10, 2024
f7d6b00
Delete unverified block if verify failed
eval-exec Apr 10, 2024
a0532cb
Add SyncInvalid integration test
eval-exec Apr 11, 2024
95c26d9
Fix cargo clippy for integration test
eval-exec May 6, 2024
ff3cab9
Temporary put parent header to PreloadUnverified, put small BlockView to
eval-exec May 15, 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
66 changes: 60 additions & 6 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
42 changes: 30 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,10 @@ fn bench(c: &mut Criterion) {
|(chain, blocks)| {
blocks.into_iter().skip(1).for_each(|block| {
chain
.internal_process_block(Arc::new(block), Switch::DISABLE_EXTENSION)
.blocking_process_block_with_switch(
Arc::new(block),
Switch::DISABLE_EXTENSION,
)
.expect("process block OK");
});
},
Expand Down Expand Up @@ -77,14 +80,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 +99,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 +113,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 +158,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 +177,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 +191,21 @@ 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
.internal_process_block(Arc::new(block), Switch::DISABLE_EXTENSION)
.blocking_process_block_with_switch(
Arc::new(block),
Switch::DISABLE_EXTENSION,
)
.expect("process block OK");
});
},
Expand Down
10 changes: 6 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 @@ -133,8 +133,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 @@ -219,7 +218,10 @@ fn bench(c: &mut Criterion) {
.expect("header verified");

chain
.internal_process_block(Arc::new(block), Switch::DISABLE_EXTENSION)
.blocking_process_block_with_switch(
Arc::new(block),
Switch::DISABLE_EXTENSION,
)
.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