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

Don't load unverified from db #28

Open
wants to merge 358 commits into
base: exec/async
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
358 commits
Select commit Hold shift + click to select a range
6dd52cd
Fix Unit test: chain/src/tests/util.rs
eval-exec Oct 19, 2023
3130617
Fix Unit test: chain/src/tests/orphan_block_pool.rs
eval-exec Oct 19, 2023
48b5efb
Add verify_failed_block channel to SharedPackage
eval-exec Oct 25, 2023
456c9de
Construct ChainService with SharedPackage provided verify_failed_bloc…
eval-exec Oct 25, 2023
62eb27e
Remove ChainService::verify_failed_block_tx Option wrap
eval-exec Oct 25, 2023
ab5f2fe
Remove useless import orphan_block_pool in ckb-sync
eval-exec Oct 25, 2023
4f9b34f
Fix blocking process block usage in benches/benches/benchmarks/always…
eval-exec Oct 25, 2023
dbfcda3
Fix blocking process block usage in benches/benches/benchmarks/overal…
eval-exec Oct 25, 2023
16edd8d
Fix blocking process block usage in benches/benches/benchmarks/resolv…
eval-exec Oct 25, 2023
3c44004
Fix blocking process block usage in benches/benches/benchmarks/secp_2…
eval-exec Oct 25, 2023
05771f0
let ckb-import and ckb-replay construct ChainService with SharedPackage
eval-exec Oct 25, 2023
ecb30a4
Fix Unit test: ckb-light-client-protocol-server::tests/utils/chain.rs
eval-exec Oct 25, 2023
cef820a
Fix Unit test: ckb-verification::contextual/src/tests/uncle_verifier.rs
eval-exec Oct 25, 2023
10b457c
Fix Unit test: ckb-verification::contextual/src/tests/contextual_bloc…
eval-exec Oct 25, 2023
03f80e7
Fix Unit test: ckb-sync::src/tests/util.rs
eval-exec Oct 25, 2023
e0ce4ac
Fix blocking process block usage in sync/src/relayer/tests/helper.rs
eval-exec Oct 25, 2023
85f47ff
Fix Unit test of blocking process block usage in ckb-sync
eval-exec Oct 25, 2023
a2b9562
Use blocking process_block method for benches/benches/benchmarks/secp…
eval-exec Oct 25, 2023
ac8691c
Benches: Construct ChainService with SharedPackage provided verify_fa…
eval-exec Oct 25, 2023
f7ed13d
Modify BlockStatus by SyncShared.Shared
eval-exec Oct 25, 2023
68b7629
Unit Test: Use SharedPackage to construct ChainService
eval-exec Oct 25, 2023
70941ec
Unit Test: Use SharedPackage to construct ChainService in ckb-chain::…
eval-exec Oct 25, 2023
dd19b43
Unit test: Modify `ChainService` initialization to include `pack.take…
eval-exec Oct 25, 2023
1035160
Unit test: Modify the `new` function in `ChainService` to include ver…
eval-exec Oct 25, 2023
68b2bf1
Unit test: Initialization of ChainService need pack.take_verify_faile…
eval-exec Oct 25, 2023
afda5a4
Add more minor ticks to sync progress chart
eval-exec Oct 30, 2023
21b21a3
Add draft mermaid sequence diagram for develop branch
eval-exec Oct 30, 2023
6bafda7
Add draft mermaid sequence diagram for asynchronous block download
eval-exec Oct 30, 2023
ae56aed
Add unverified block info to sync_state rpc
eval-exec Oct 30, 2023
b7f01ff
Upgrade Synchronizer disconnect log level from debug to info
eval-exec Oct 30, 2023
ab37930
Add tip_hash and tip_number to sync_state rpc
eval-exec Oct 31, 2023
342e062
Set receive exit signal log from debug to info
eval-exec Oct 31, 2023
6a39c90
Let HeaderMap stats feature use info log
eval-exec Oct 31, 2023
9c88a8e
Activate HeaderMap stats profiling feature in `make profiling`
eval-exec Oct 31, 2023
b0093ac
Return removed inflight blocks count when disconnect
eval-exec Oct 31, 2023
5368e71
Remove log message time cost unit
eval-exec Nov 1, 2023
7224188
Move ChainService proposal_table to the param for start method
eval-exec Nov 4, 2023
beb9cff
Remove proposal_table's RWLock
eval-exec Nov 4, 2023
8c5414c
Add VerifiedBlockStatus::PreviouslyVerified
eval-exec Nov 13, 2023
d548bf1
Will move truncate process to consume_unverified_blocks
eval-exec Nov 13, 2023
d88630f
Extract consume_orphan_blocks from ChainService
eval-exec Nov 13, 2023
9e60241
Extract consume_unverified_blocks from ChainService
eval-exec Nov 13, 2023
0c827cc
Move out consume_unverified_blocks and consume_orphan
eval-exec Nov 13, 2023
73ec386
Move LonelyBlock related struct to module root
eval-exec Nov 13, 2023
f91475d
Fix LonelyBlockWithCallBack import path
eval-exec Nov 13, 2023
4873c5d
Add ChainServicesBuilder to SharedPackage
eval-exec Nov 13, 2023
788d0ce
Launcher start chain_service by ChainServicesBuilder
eval-exec Nov 13, 2023
8bd9b5f
Fix ckb-sync VerifyResult import path
eval-exec Nov 13, 2023
dfd0a96
Fix ckb-rpc VerifyResult import path
eval-exec Nov 13, 2023
3c76463
Fix ChainService initialize for ckb import subcommand
eval-exec Nov 13, 2023
a88265e
Fix ChainService initialize for ckb replay subcommand
eval-exec Nov 13, 2023
6d8138c
Fix ChainService initialize for ckb run subcommand
eval-exec Nov 13, 2023
64149da
Extract punish_bad_peer's params to peer_id and block_hash
eval-exec Nov 13, 2023
3418044
Fix tell_synchronizer_to_punish_the_bad_peer's params
eval-exec Nov 13, 2023
4546559
Remove search_orphan_pool's param
eval-exec Nov 13, 2023
2eb7609
Add ConsumeUnverifiedBlockProcessor as child field of ConsumeUnverifi…
eval-exec Nov 17, 2023
8670147
Make `struct ChainService` private
eval-exec Nov 19, 2023
2e6cdbc
Make `ConsumeUnverifiedBlockProcessor` public for crate
eval-exec Nov 19, 2023
6296905
Make `chain` module private, re-export `ChainController` and `ChainSe…
eval-exec Nov 19, 2023
e4ea3f5
Fix `find_fork` related unit test use `ConsumeUnverifiedBlockProcesso…
eval-exec Nov 19, 2023
8eed10d
Use `pack.take_chain_services_builder` to construct chain_controller for
eval-exec Nov 19, 2023
559f2a8
Fix `ChainController`'s import path in `ckb-sync`
eval-exec Nov 19, 2023
8d29236
Fix `ChainController`'s import path in `ckb-verification`, `ckb-sync`,
eval-exec Nov 19, 2023
1ad203e
Fix start `ckb-chain`'s services by `pack.take_chain_services_builder`
eval-exec Nov 19, 2023
b61cb1d
Unit test: process block by blocking way
eval-exec Nov 19, 2023
bbb4249
Fix `ckb-sync` unit tests: Synchronizer need verify_failed_block_rx
eval-exec Nov 19, 2023
64d7977
Rename `VerifiedBlockStatus` variants to a more meaningfull name
eval-exec Nov 20, 2023
dda7b0b
Extract `ChainServicesBuilder` start method as an independent function
eval-exec Nov 21, 2023
0854239
Move ChainServicesBuilder to ckb_shared
eval-exec Nov 21, 2023
036de55
Remove ChainServicesbuilder from ckb_chain
eval-exec Nov 21, 2023
c28b2e4
Re-export `start_chain_services` in `ckb_chain`
eval-exec Nov 21, 2023
69fdbdb
Re-sort shared_builder import statements
eval-exec Nov 22, 2023
cfddf13
Re-export ChainServicesBuilder in ckb_shared
eval-exec Nov 22, 2023
2261139
Fix ckb-launcher start chain services
eval-exec Nov 22, 2023
1e97edd
Fix subcommand::replay start chain_services
eval-exec Nov 22, 2023
744a200
Fix subcommand::import start chain services
eval-exec Nov 22, 2023
de8ed55
Update `Cargo.lock` by `make prod`
eval-exec Nov 22, 2023
30ba6fc
Fix ChainServicesBuilder import path in unit tests
eval-exec Nov 22, 2023
a89e54a
breadcast_compact_block only when FirstSeenAndVerified
eval-exec Nov 22, 2023
667b607
ChainService should execute non_contextual_verify when switch is None
eval-exec Nov 22, 2023
e30c85f
Extract `accept_descendants` from `ConsumeOrphan`
eval-exec Nov 22, 2023
c8c61bb
Add `contains_block` for OrphanBlock
eval-exec Nov 22, 2023
f0e9d7a
Only insert new block to orphan pool if its parent not partial stored
eval-exec Nov 28, 2023
ee964e3
ConsumeOrphan::accept_descendant expect block is not stored
eval-exec Nov 28, 2023
df5eefe
accept_descendant does not return None
eval-exec Nov 28, 2023
af882c3
accept_descendants need not handle the case when accept_descendant re…
eval-exec Nov 28, 2023
25a4070
Remove `VerifiedBlockStatus::PreviouslySeenButNotVerified`
eval-exec Nov 28, 2023
bee02ec
contains_block shoud not take ownership of self
eval-exec Nov 28, 2023
06bf89f
Orphan: InnerPool shoud borrow self
eval-exec Nov 28, 2023
e588589
Extract `process_descendant` from `accept_descendant`
eval-exec Nov 28, 2023
f9b4a8e
Move ForkChanges to chain/src/utils
eval-exec Nov 28, 2023
9e723b7
Fix ForkChanges related import path
eval-exec Nov 28, 2023
48b6959
Move OrphanBlocksPool to chain/src/utils
eval-exec Nov 28, 2023
e1d7c44
Fix OrphanBlockPool related import path
eval-exec Nov 28, 2023
f8a01eb
Trace last_common_ancestor timecost
eval-exec Nov 28, 2023
4218dba
Fix module orphan_block_pool usage
eval-exec Nov 28, 2023
28c2bde
Fix last common_ancestor's log message
eval-exec Nov 28, 2023
c6a504b
Rename FirstSeenButNotVerified to UncleBlockNotVerified
eval-exec Nov 29, 2023
8b602cc
Remove useless import statements, fix clippy
eval-exec Nov 29, 2023
198fc9f
Using `ckb_chain::start_chain_services` to start ckb-chain services
eval-exec Nov 29, 2023
ccdfe5d
Benches: Start chain services by start_chain_services
eval-exec Nov 29, 2023
760a1ef
Fix Unit test in `ckb-rpc`: Start chain services by start_chain_services
eval-exec Nov 29, 2023
bdd926d
Fix Unit test in `ckb-chain`: Start chain services by start_chain_ser…
eval-exec Nov 29, 2023
318cd35
Fix Unit test in `ckb-sync`: Start chain services by start_chain_serv…
eval-exec Nov 29, 2023
c345a84
Add blocking_insert_new_block for SyncState for Unit Test purpose
eval-exec Nov 29, 2023
f049660
Fix lifetime issue for Unit test in `ckb-chain`
eval-exec Nov 29, 2023
f01fb2a
Comment out sync_shared.rs related unit test
eval-exec Nov 29, 2023
e3ee1e2
Remove Synchronizer::verify_failed_blocks_rx Option wrapper
eval-exec Nov 29, 2023
0b0a79f
Fix Launcher construct Synchronizer
eval-exec Nov 29, 2023
bb34f6f
Remove Synchronizer::process_new_block to asynchronous_process_new_block
eval-exec Nov 29, 2023
5ffa28a
Add `blocking_execute` method for `BlockProcess` for the purpose of u…
eval-exec Nov 29, 2023
79a3b32
Modify Synchronizer::blocking_process_new_block return Result<bool,Er…
eval-exec Nov 29, 2023
f4c20be
Fix ckb-sync test_internal_db_error unit test
eval-exec Nov 29, 2023
fd5edbe
Fix cargo clippy warnings
eval-exec Nov 29, 2023
e32fb84
Remove orphan_block_pool from ckb-sync
eval-exec Nov 29, 2023
029fd32
Add Warning message for threads stop notify in ckb-chain
eval-exec Nov 29, 2023
24ac742
Fix ckb-chain consume_unveriifed_blocks stop handle
eval-exec Nov 29, 2023
81e541d
Pause chunk_process in consume_unverified_blocks thread
eval-exec Nov 29, 2023
1dd676c
Move truncate_block_request logic to consume_unverified_blocks
eval-exec Nov 29, 2023
c073ef2
ChainService won't need truncate_block_rx anymore
eval-exec Nov 29, 2023
c65f5af
Remove ChainService::start, since it has replaced by start_process_block
eval-exec Nov 29, 2023
581945a
Fix ChainService stop_rx related handling
eval-exec Nov 29, 2023
f528888
Fix consume_unverified truncate process
eval-exec Nov 29, 2023
438ee7a
Rename chain/src/chain.rs to chain/src/chain_service.rs
eval-exec Nov 29, 2023
076e02b
Fix cargo clippy warnings
eval-exec Nov 29, 2023
9a556f3
Modify VerifyFailedBlockInfo::message_bytes to msg_bytes
eval-exec Nov 30, 2023
1210a12
Pass and return peer_id_with_msg_bytes in process_block
eval-exec Nov 30, 2023
7dde207
Fix peer_id_and_msg_bytes for ckb-chain unit tests
eval-exec Nov 30, 2023
0f69670
Extract `ConsumeDescendantProcessor` from `ConsumeOrphan`
eval-exec Nov 30, 2023
84feab4
Attach `accept_descendant` method to `ConsumeDescendantProcessor`
eval-exec Nov 30, 2023
18348cd
Public ConsumeDescendantProcessor struct fields
eval-exec Nov 30, 2023
932e2ca
Fix ckb-chain find_fork related Unit Test
eval-exec Nov 30, 2023
bebb78a
Fix Cargo fmt
eval-exec Nov 30, 2023
1004e91
Update sync_state RPC document
eval-exec Nov 30, 2023
7e81834
Execute `make gen-rpc-doc`
eval-exec Nov 30, 2023
5e6c53d
Add docs for ckb-shared, fix clippy docs warnings
eval-exec Nov 30, 2023
e04abc7
Add docs for ckb-chain, fix clippy warnings
eval-exec Nov 30, 2023
e984a5a
Fix cargo clippy warnings for ckb-benches
eval-exec Nov 30, 2023
31e75ac
Fix cargo clippy warnings for ckb-sync
eval-exec Nov 30, 2023
ebc16fa
Broadcast compact block when VerifiedStatus is FirstSeenAndVerified o…
eval-exec Nov 30, 2023
6095e18
Add extra comma for tip_hash in rpc example, execute make gen-rpc-doc
eval-exec Nov 30, 2023
efc41b8
Add `init_for_test` logger helper, only used by unit test
eval-exec Nov 30, 2023
a9ecac2
Fix unit test for synchronizer::basic_sync
eval-exec Nov 30, 2023
480f8ee
Improve sync chart drawer more friendly
eval-exec Dec 21, 2023
ac7735f
Fix ckb workspace members crate version to 0.114.0-pre
eval-exec Dec 26, 2023
7766dd7
Fix unit test for ckb-rpc, use blocking_process_block
eval-exec Dec 26, 2023
3e6ecff
Fix BlockFetcher fetch should not use unverified_tip to change last_c…
eval-exec Jan 9, 2024
fc3c07f
Fix unit test: `test_switch_valid_fork`
eval-exec Jan 9, 2024
4c8d061
BlockFetcher should only set_last_common_header when status is BLOCK_…
eval-exec Jan 9, 2024
c3b54b3
Simplify `ConsumeDescendantProcessor` unverified_blocks_tx send code
eval-exec Jan 11, 2024
d4110d8
Fix matches result did not assert its result
eval-exec Jan 11, 2024
88d8ab5
Split get_ancestor's logic to unverified_tip and tip
eval-exec Jan 11, 2024
f7a3b19
BlockFetcher get ancestor with unverified_tip
eval-exec Jan 11, 2024
dc5be31
Clean expired orphan blocks
eval-exec Jan 11, 2024
49a6a33
Split ChainController out chain_service.rs
eval-exec Jan 11, 2024
491820e
ChainService should mark block as BLOCK_INVALID if it does not pass n…
eval-exec Jan 11, 2024
c7e7236
Change `VerifyResult` to `Result<bool, Error>`
eval-exec Jan 11, 2024
b05ce0e
ConsumeUnverified do not need VerifiedBlockStatus enum type anymore
eval-exec Jan 11, 2024
ba297e7
Do not need VerifiedBlockStatus in ckb-rpc and ckb-sync
eval-exec Jan 11, 2024
d0af19e
Fix unit test: do not need VerifiedBlockStatus
eval-exec Jan 11, 2024
eb4970f
Remove VerifiedBlockStatus enum type and related imports statements
eval-exec Jan 11, 2024
0877a41
Remove useless crate dependencies, fix warnings of check-cargotoml.sh
eval-exec Jan 11, 2024
f87f672
Fix ConsumeUnverified: should return `Ok(false)` if it's a block which
eval-exec Jan 11, 2024
000b912
Fix lint, remove whitespace
eval-exec Jan 11, 2024
e3db7dd
BlockFetcher calculate `start` and ancestor header should aware IBDState
eval-exec Jan 15, 2024
8003e58
BlockFetcher check whether to request block from a peer should aware …
eval-exec Jan 15, 2024
887779e
BlockFetcher should only return if best_known <= unverified_tip in IB…
eval-exec Jan 15, 2024
7d64e00
SyncShared::accept_block will mark the block as BLOCK_RECEIVED if its…
eval-exec Jan 15, 2024
726ef90
Fix ckb-sync test_insert_parent_unknown_block
eval-exec Jan 15, 2024
50eafa5
ConsumeOrphan should mark the block as PARTIAL_STORED before send it …
eval-exec Jan 15, 2024
e60465b
Add more log message for debug
eval-exec Jan 16, 2024
e20b659
Shared provide generic version of get_block_status for Snapshot and s…
eval-exec Jan 16, 2024
544c110
ckb-chain load get_block_status from shared.store()
eval-exec Jan 16, 2024
7b6cee3
ActiveChain get_block_status from snapshot()
eval-exec Jan 16, 2024
d26de13
Fix SyncShared's field name in BlockFetcher and HeadersProcess
eval-exec Jan 16, 2024
017db41
Remove BlockStatus::BLOCK_PARTIAL_STORED
eval-exec Jan 16, 2024
1a65578
Change BLOCK_PARTIAL_STORED to BLOCK_STORED
eval-exec Jan 16, 2024
08576ee
Improve draw chart script add more major and minor ticks on x/yaxis
eval-exec Jan 17, 2024
06704d6
Add log for `MinerRpcImpl::submit_block` new_block check
eval-exec Jan 17, 2024
aff686f
Comment out shrink_to_fit for header_map's MemoryMap
eval-exec Jan 17, 2024
b1d8262
ChainService should not punish remote peer if failed to send block to…
eval-exec Jan 17, 2024
0745326
Remove meaning less TODO note in test_internal_db_error, improve draw…
eval-exec Jan 18, 2024
1659258
test: randomly kill and restart node
contrun Jan 16, 2024
465ce70
add integration test for sync with churn nodes
contrun Jan 17, 2024
6814a49
test: make Node struct clonable
contrun Jan 17, 2024
04de10e
test: run SyncChurn mining and restart in different threads
contrun Jan 17, 2024
595c5cb
test: cargo {clippy,fmt}
contrun Jan 18, 2024
a1efaa1
test: document what SyncChurn does and its weakness
contrun Jan 18, 2024
8e855f7
test: make two mining nodes in SyncChurn
contrun Jan 18, 2024
3e253ea
test: don't mine too many blocks in SyncChurn
contrun Jan 18, 2024
39d18a1
Improve draw chart script, no vertial line label overcover
eval-exec Jan 19, 2024
44bd508
Add unverified tip related metrics to ckb_metrics
eval-exec Jan 22, 2024
cf81966
Add minstant to ckb_chain dependency
eval-exec Jan 22, 2024
f581c59
Collect ckb_chain timecost and unverified_tip metrics
eval-exec Jan 22, 2024
b8d97d6
Collect execute_callback timecost for metrics
eval-exec Jan 22, 2024
e11c451
Unverified block in db
eval-exec Jan 17, 2024
1e696c3
UnverifiedBlockHash size to 3
eval-exec Jan 18, 2024
2a85d12
Comment MemoryMap remove shrink_to_fit
eval-exec Jan 23, 2024
8d5c812
Remove UnverifiedBlockHash since consume_unverified can load parent_h…
eval-exec Jan 23, 2024
d0522be
ConsumeOrphan only need pass LonelyBlockHashWithCallback to ConsumeUn…
eval-exec Jan 23, 2024
3b138fa
Replace the `Into` implementation LonelyBlockWithCallback with `From<…
eval-exec Jan 23, 2024
c5a50ed
Fix ConsumeUnverified thread need LonelyBlockHashWithCallback in find…
eval-exec Jan 23, 2024
66fb041
Consider the edge case of processing genesis block
contrun Jan 22, 2024
7a6c9fb
Copy ibd_finished field from shared to HeaderMapKernal
eval-exec Jan 24, 2024
d01cfab
HeaderMap do not shrink_to_fit in IBD mode
eval-exec Jan 24, 2024
e8a95fd
test inserting block with stored but unverified parent
contrun Jan 24, 2024
75dcccd
ConsumeUnverified should call get_update_for_tip_hash after begin_tra…
eval-exec Jan 25, 2024
ea3455d
Cargo fmt, apply check-whitespaces
eval-exec Jan 25, 2024
b40c722
Change process duration from Gauge to Histogram, add metrics for ckb-…
eval-exec Jan 25, 2024
651f2d1
Collect ckb-chain and ckb-sync timecost Histogram metrics
eval-exec Jan 25, 2024
2626a78
Add orphan blocks count metric
eval-exec Jan 25, 2024
c5f589c
Add header_map limit_memory and operation duration metric
eval-exec Jan 26, 2024
731a9c9
Collect header_map limit_memory and operations timecost
eval-exec Jan 26, 2024
b44dcfd
ConsumeOrphan should not insert a block to orphan pool if its parent …
eval-exec Jan 29, 2024
a89c282
Remove `ChainController`'s useless methods, fix method comments
eval-exec Jan 29, 2024
497315e
Add HeaderMap memory count and cache hit/miss count metrics
eval-exec Jan 29, 2024
73e44d2
Collect HeaderMap MemoryMap cache hit/miss count and total count
eval-exec Jan 29, 2024
b4a5b73
ConsumeUnverified do not realy need pass whole UnverifiedBlock to fn …
eval-exec Jan 29, 2024
2bdaf1e
Remove msg_bytes from LonelyBlock
eval-exec Jan 29, 2024
5676184
Remove msg_bytes from VerifyFailedBlockInfo
eval-exec Jan 29, 2024
862ea79
ckb-sync do not need pass msg_bytes to ckb-chain
eval-exec Jan 29, 2024
577cfcd
`ckb-sync`'s unit test won't need `msg_bytes` anymore
eval-exec Jan 29, 2024
172326d
`blocking_process_block` returns a bool, use a proper name
eval-exec Jan 29, 2024
3eef44d
Metrics: header_map hit/miss should contains `contains_key`
eval-exec Jan 30, 2024
caa4d26
Add `struct RemoteBlock` for ckb-chain, let ckb-sync and ckb-relayer …
eval-exec Jan 31, 2024
b3706bc
Modify ckb-chain use RemoteBlock, drop LonelyBlockWithCallback
eval-exec Jan 31, 2024
b3a5d57
ckb-sync use accept_remote_block to process remote block
eval-exec Jan 31, 2024
927ac4d
Modify unit test in ckb-sync and ckb-chain to use RemoteBlock related…
eval-exec Jan 31, 2024
11abfc6
Fix HeaderMap memory count
eval-exec Feb 1, 2024
aa71451
Fix rebase conflicts with develop: https://github.com/nervosnetwork/c…
eval-exec Feb 2, 2024
bd6a573
Fix chain service builder for test_accept_block
eval-exec Feb 4, 2024
aeb3816
add inflight count and inflight timeout count for ckb-metrics
eval-exec Feb 4, 2024
4233ae5
Add lonely_block channel and unverified_block channel length
eval-exec Feb 4, 2024
6fa7f7e
Add test to ensure the results of remove_blocks_by_parent are sorted
contrun Feb 5, 2024
b653c34
Add test to ensure that leader always have children
contrun Feb 5, 2024
151d9f3
Fix blocks_are_sorted checking logic error
contrun Feb 5, 2024
deadf2b
Merge pull request #24 from contrun/orphan-pool-test
eval-exec Feb 6, 2024
4a37b2d
Remove tell_synchronizer_to_punish_the_bad_peer from ckb-chain
eval-exec Feb 6, 2024
106bab4
Use verify_callbacl to handle peer punish and compact block broadcast
eval-exec Feb 6, 2024
cc187d7
Fix sync and relayer unit test by verify_callback
eval-exec Feb 6, 2024
3dfe3bb
Remove VerifyFailedInfo, remove verify_failed_block channel
eval-exec Feb 6, 2024
a2e2645
Remove broadcast_compact_block channel
eval-exec Feb 6, 2024
e0df7e5
chore: remove channel send error callback
quake Feb 6, 2024
983b98e
chore: remove UnverifiedBlock
quake Feb 6, 2024
ad7dbe1
Add debug log for block_fetcher->get_ancestor
eval-exec Feb 6, 2024
289d03c
Merge pull request #25 from quake/quake/async-refactor
eval-exec Feb 7, 2024
570e4b3
Find and verify unverified blocks on ckb startup
eval-exec Feb 7, 2024
216793c
Fix cargo clippy warnings
eval-exec Feb 7, 2024
ebf6c3c
Use `Release` to `store`, `Acquire` to `read` for atomic: `is_verifyi…
eval-exec Feb 8, 2024
1f60e10
Do not load unverified block from db
eval-exec Feb 17, 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 @@ -126,13 +126,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