feat: ExExEvent::FinishedHeight takes BlockNumHash instead (#11278)

Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
This commit is contained in:
joshieDo
2024-09-27 15:22:46 +02:00
committed by GitHub
parent 098018db49
commit ea060fe9a0
7 changed files with 35 additions and 28 deletions

View File

@ -125,7 +125,7 @@ async fn my_exex<Node: FullNodeComponents>(mut ctx: ExExContext<Node>) -> eyre::
if let Some(committed_chain) = notification.committed_chain() {
ctx.events
.send(ExExEvent::FinishedHeight(committed_chain.tip().number))?;
.send(ExExEvent::FinishedHeight(committed_chain.tip().num_hash()))?;
}
}

View File

@ -23,4 +23,4 @@ event to signify what blocks have been processed. This event is used by Reth to
An ExEx will only receive notifications for block numbers greater than the block in the most recently emitted `FinishedHeight` event.
To clarify: if an ExEx emits `ExExEvent::FinishedHeight(0)` it will receive notifications for any `block_number > 0`.
To clarify: if an ExEx emits `ExExEvent::FinishedHeight` for `block #0` it will receive notifications for any `block_number > 0`.

View File

@ -279,7 +279,7 @@ async fn remote_exex<Node: FullNodeComponents>(
while let Some(notification) = ctx.notifications.next().await {
if let Some(committed_chain) = notification.committed_chain() {
ctx.events
.send(ExExEvent::FinishedHeight(committed_chain.tip().number))?;
.send(ExExEvent::FinishedHeight(committed_chain.tip().num_hash()))?;
}
info!("Notification sent to the gRPC server");
@ -388,7 +388,7 @@ async fn remote_exex<Node: FullNodeComponents>(
while let Some(notification) = ctx.notifications.next().await {
if let Some(committed_chain) = notification.committed_chain() {
ctx.events
.send(ExExEvent::FinishedHeight(committed_chain.tip().number))?;
.send(ExExEvent::FinishedHeight(committed_chain.tip().num_hash()))?;
}
info!(?notification, "Notification sent to the gRPC server");

View File

@ -57,7 +57,7 @@ impl<Node: FullNodeComponents> Future for MyExEx<Node> {
if let Some(committed_chain) = notification.committed_chain() {
this.ctx
.events
.send(ExExEvent::FinishedHeight(committed_chain.tip().number))?;
.send(ExExEvent::FinishedHeight(committed_chain.tip().num_hash()))?;
}
}
@ -152,7 +152,7 @@ impl<Node: FullNodeComponents> Future for MyExEx<Node> {
this.ctx
.events
.send(ExExEvent::FinishedHeight(committed_chain.tip().number))?;
.send(ExExEvent::FinishedHeight(committed_chain.tip().num_hash()))?;
}
if let Some(first_block) = this.first_block {