Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,9 @@ where
self
}

/// Executes a request to call the system auction contract.
/// This ONLY executes the run_auction logic of the auction. If you are testing
/// specifically that function, this is sufficient. However, to match the standard
/// end of era auction behavior the comprehensive `step` function should be used instead.
pub fn run_auction(
&mut self,
era_end_timestamp_millis: u64,
Expand All @@ -974,7 +976,7 @@ where
self.exec(exec_request).expect_success().commit()
}

/// Increments engine state.
/// Increments engine state at end of era (rewards, auction, unbond, etc.).
pub fn step(&mut self, step_request: StepRequest) -> StepResult {
let step_result = self.data_access_layer.step(step_request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3784,9 +3784,7 @@ fn should_not_restake_after_full_unbond() {

let withdraws = builder.get_unbonds();
let unbond_kind = UnbondKind::DelegatedPublicKey(DELEGATOR_1.clone());
let unbond = withdraws
.get(&unbond_kind)
.expect("should have validator entry");
let unbond = withdraws.get(&unbond_kind).expect("should have entry");
let delegator_unbond_amount = unbond[0].eras().first().expect("should be era").amount();

assert_eq!(
Expand Down
27 changes: 14 additions & 13 deletions node/src/components/block_synchronizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod block_acquisition_action;
mod block_builder;
mod block_synchronizer_progress;
mod config;
mod deploy_acquisition;
mod error;
mod event;
mod execution_results_acquisition;
Expand All @@ -12,6 +11,7 @@ mod metrics;
mod need_next;
mod peer_list;
mod signature_acquisition;
mod transaction_acquisition;
mod trie_accumulator;

#[cfg(test)]
Expand Down Expand Up @@ -588,7 +588,7 @@ impl BlockSynchronizer {
node_id,
Box::new(EmptyValidationMetadata),
)
.event(move |result| Event::DeployFetched {
.event(move |result| Event::TransactionFetched {
block_hash,
result: Either::Left(result),
})
Expand All @@ -603,7 +603,7 @@ impl BlockSynchronizer {
node_id,
Box::new(EmptyValidationMetadata),
)
.event(move |result| Event::DeployFetched {
.event(move |result| Event::TransactionFetched {
block_hash,
result: Either::Right(result),
})
Expand Down Expand Up @@ -1186,8 +1186,8 @@ impl BlockSynchronizer {
};

if let Some(builder) = self.get_builder(block_hash, false) {
if let Err(error) = builder.register_deploy(txn.fetch_id(), maybe_peer) {
error!(%block_hash, %error, "BlockSynchronizer: failed to apply deploy");
if let Err(error) = builder.register_transaction(txn.fetch_id(), maybe_peer) {
error!(%block_hash, %error, "BlockSynchronizer: failed to apply transaction");
}
}
}
Expand Down Expand Up @@ -1362,7 +1362,7 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
| Event::SyncLeapFetched(_)
| Event::GlobalStateSynced { .. }
| Event::GotExecutionResultsChecksum { .. }
| Event::DeployFetched { .. }
| Event::TransactionFetched { .. }
| Event::ExecutionResultsFetched { .. }
| Event::ExecutionResultsStored(_)
| Event::AccumulatedPeers(_, _)
Expand Down Expand Up @@ -1513,7 +1513,7 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
self.need_next(effect_builder, rng)
}
// for both historical and forward sync, post-1.4 blocks track approvals hashes
// for the deploys they contain
// for the transactions they contain
Event::ApprovalsHashesFetched(result) => {
self.approvals_hashes_fetched(result);
self.need_next(effect_builder, rng)
Expand Down Expand Up @@ -1545,9 +1545,10 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
self.execution_results_stored(block_hash);
self.need_next(effect_builder, rng)
}
// for pre-1.5 blocks we use the legacy deploy fetcher, otherwise we use the deploy
// fetcher but the results of both are forwarded to this handler
Event::DeployFetched { block_hash, result } => {
// for pre-1.5 blocks we use the legacy deploy fetcher, otherwise we use the
// transaction fetcher but the results of both are forwarded to this
// handler
Event::TransactionFetched { block_hash, result } => {
match result {
Either::Left(Ok(fetched_legacy_deploy)) => {
let deploy_id = fetched_legacy_deploy.id();
Expand All @@ -1561,7 +1562,7 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
}
Either::Left(Err(error)) => {
if let Some(builder) = self.get_builder(block_hash, false) {
if builder.waiting_for_deploys() {
if builder.waiting_for_transactions() {
builder.latch_decrement();
}
}
Expand All @@ -1570,12 +1571,12 @@ impl<REv: ReactorEvent> Component<REv> for BlockSynchronizer {
}
Either::Right(Err(error)) => {
if let Some(builder) = self.get_builder(block_hash, false) {
if builder.waiting_for_deploys() {
if builder.waiting_for_transactions() {
builder.latch_decrement();
}
}

debug!(%error, "BlockSynchronizer: failed to fetch deploy");
debug!(%error, "BlockSynchronizer: failed to fetch transaction");
}
};
self.need_next(effect_builder, rng)
Expand Down
Loading
Loading