mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 07:58:00 +00:00
Import target block body during warp sync (#12300)
* Receive and import target block body * Request target block * minor: wording * Check for block body in the test * Import target block justifications * Fix: do not fail block validation if no justifications received * Fix: import target blocks without justifications Co-authored-by: arkpar <arkady.paronyan@gmail.com>
This commit is contained in:
@@ -1192,7 +1192,7 @@ fn warp_sync() {
|
||||
..Default::default()
|
||||
});
|
||||
let gap_end = net.peer(0).push_blocks(63, false);
|
||||
net.peer(0).push_blocks(1, false);
|
||||
let target = net.peer(0).push_blocks(1, false);
|
||||
net.peer(1).push_blocks(64, false);
|
||||
net.peer(2).push_blocks(64, false);
|
||||
// Wait for peer 1 to sync state.
|
||||
@@ -1203,7 +1203,7 @@ fn warp_sync() {
|
||||
// Wait for peer 1 download block history
|
||||
block_on(futures::future::poll_fn::<(), _>(|cx| {
|
||||
net.poll(cx);
|
||||
if net.peer(3).has_block(&gap_end) {
|
||||
if net.peer(3).has_body(&gap_end) && net.peer(3).has_body(&target) {
|
||||
Poll::Ready(())
|
||||
} else {
|
||||
Poll::Pending
|
||||
|
||||
Reference in New Issue
Block a user