Skip to content

Commit df6c63d

Browse files
authored
Merge pull request #5340 from zajko/utilization_tracking_fixes
[BugFix] Block Utilization Sync
2 parents c2fed32 + c7c3b4e commit df6c63d

File tree

31 files changed

+788
-298
lines changed

31 files changed

+788
-298
lines changed

node/src/components/block_synchronizer.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ mod block_acquisition_action;
33
mod block_builder;
44
mod block_synchronizer_progress;
55
mod config;
6-
mod deploy_acquisition;
76
mod error;
87
mod event;
98
mod execution_results_acquisition;
@@ -12,6 +11,7 @@ mod metrics;
1211
mod need_next;
1312
mod peer_list;
1413
mod signature_acquisition;
14+
mod transaction_acquisition;
1515
mod trie_accumulator;
1616

1717
#[cfg(test)]
@@ -589,7 +589,7 @@ impl BlockSynchronizer {
589589
node_id,
590590
Box::new(EmptyValidationMetadata),
591591
)
592-
.event(move |result| Event::DeployFetched {
592+
.event(move |result| Event::TransactionFetched {
593593
block_hash,
594594
result: Either::Left(result),
595595
})
@@ -604,7 +604,7 @@ impl BlockSynchronizer {
604604
node_id,
605605
Box::new(EmptyValidationMetadata),
606606
)
607-
.event(move |result| Event::DeployFetched {
607+
.event(move |result| Event::TransactionFetched {
608608
block_hash,
609609
result: Either::Right(result),
610610
})
@@ -1201,8 +1201,8 @@ impl BlockSynchronizer {
12011201
};
12021202

12031203
if let Some(builder) = self.get_builder(block_hash, false) {
1204-
if let Err(error) = builder.register_deploy(txn.fetch_id(), maybe_peer) {
1205-
error!(%block_hash, %error, "BlockSynchronizer: failed to apply deploy");
1204+
if let Err(error) = builder.register_transaction(txn.fetch_id(), maybe_peer) {
1205+
error!(%block_hash, %error, "BlockSynchronizer: failed to apply transaction");
12061206
}
12071207
}
12081208
}
@@ -1377,7 +1377,7 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
13771377
| Event::SyncLeapFetched(_)
13781378
| Event::GlobalStateSynced { .. }
13791379
| Event::GotExecutionResultsChecksum { .. }
1380-
| Event::DeployFetched { .. }
1380+
| Event::TransactionFetched { .. }
13811381
| Event::ExecutionResultsFetched { .. }
13821382
| Event::ExecutionResultsStored(_)
13831383
| Event::AccumulatedPeers(_, _)
@@ -1522,13 +1522,12 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
15221522
self.block_fetched(result);
15231523
self.need_next(effect_builder, rng)
15241524
}
1525-
// for both historical and forward sync, a finality signature has been fetched
15261525
Event::FinalitySignatureFetched(result) => {
15271526
self.finality_signature_fetched(result);
15281527
self.need_next(effect_builder, rng)
15291528
}
15301529
// for both historical and forward sync, post-1.4 blocks track approvals hashes
1531-
// for the deploys they contain
1530+
// for the transactions they contain
15321531
Event::ApprovalsHashesFetched(result) => {
15331532
self.approvals_hashes_fetched(result);
15341533
self.need_next(effect_builder, rng)
@@ -1560,9 +1559,10 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
15601559
self.execution_results_stored(block_hash);
15611560
self.need_next(effect_builder, rng)
15621561
}
1563-
// for pre-1.5 blocks we use the legacy deploy fetcher, otherwise we use the deploy
1564-
// fetcher but the results of both are forwarded to this handler
1565-
Event::DeployFetched { block_hash, result } => {
1562+
// for pre-1.5 blocks we use the legacy deploy fetcher, otherwise we use the
1563+
// transaction fetcher but the results of both are forwarded to this
1564+
// handler
1565+
Event::TransactionFetched { block_hash, result } => {
15661566
match result {
15671567
Either::Left(Ok(fetched_legacy_deploy)) => {
15681568
let deploy_id = fetched_legacy_deploy.id();
@@ -1576,7 +1576,7 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
15761576
}
15771577
Either::Left(Err(error)) => {
15781578
if let Some(builder) = self.get_builder(block_hash, false) {
1579-
if builder.waiting_for_deploys() {
1579+
if builder.waiting_for_transactions() {
15801580
builder.latch_decrement();
15811581
}
15821582
}
@@ -1585,12 +1585,12 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
15851585
}
15861586
Either::Right(Err(error)) => {
15871587
if let Some(builder) = self.get_builder(block_hash, false) {
1588-
if builder.waiting_for_deploys() {
1588+
if builder.waiting_for_transactions() {
15891589
builder.latch_decrement();
15901590
}
15911591
}
15921592

1593-
debug!(%error, "BlockSynchronizer: failed to fetch deploy");
1593+
debug!(%error, "BlockSynchronizer: failed to fetch transaction");
15941594
}
15951595
};
15961596
self.need_next(effect_builder, rng)

0 commit comments

Comments
 (0)