Skip to content

Commit

Permalink
Hack it more
Browse files Browse the repository at this point in the history
  • Loading branch information
s0me0ne-unkn0wn committed Dec 7, 2023
1 parent c1d92d0 commit b65ff54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 8 additions & 1 deletion polkadot/node/core/chain-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ async fn run<Client, Context>(
where
Client: HeaderBackend<Block> + AuxStore,
{
let mut fake_finalized = None;

loop {
match ctx.recv().await? {
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(()),
Expand Down Expand Up @@ -119,7 +121,12 @@ where
},
ChainApiMessage::FinalizedBlockNumber(response_channel) => {
let _timer = subsystem.metrics.time_finalized_block_number();
let result = subsystem.client.info().finalized_number;
let result = if let Some(fake) = fake_finalized {
fake
} else {
fake_finalized = Some(subsystem.client.info().finalized_number);
fake_finalized.unwrap()
};
// always succeeds
subsystem.metrics.on_request(true);
let _ = response_channel.send(Ok(result));
Expand Down
3 changes: 0 additions & 3 deletions polkadot/node/overseer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,6 @@ where
self.on_head_deactivated(deactivated)
}

self.broadcast_signal(OverseerSignal::BlockFinalized(block.hash, block.number))
.await?;

// If there are no leaves being deactivated, we don't need to send an update.
//
// Our peers will be informed about our finalized block the next time we
Expand Down

0 comments on commit b65ff54

Please sign in to comment.