| 32 | #[cfg(feature = "prom")] |
| 33 | use metrics::{counter, histogram}; |
| 34 | use summit_syncer::ingress::mailbox::Mailbox as SyncerMailbox; |
| 35 | use summit_types::{Block, BlockAuxData, Digest, EngineClient}; |
| 36 | |
| 37 | /// How long to wait before retrying check_payload when Reth returns SYNCING during certify. |
| 38 | const CERTIFY_SYNCING_RETRY: Duration = Duration::from_millis(100); |
| 39 | |
| 40 | fn proposal_timestamp_wait( |
| 41 | now_millis: u64, |
| 42 | min_child_timestamp: u64, |
| 43 | allowed_timestamp_future_ms: u64, |
| 44 | ) -> Duration { |
| 45 | // Verifiers accept timestamps up to `now + allowed_timestamp_future_ms`. |
| 46 | // If the minimum monotonic child timestamp is beyond that bound, wait just |
| 47 | // long enough for it to enter the verifier's future window. |
| 48 | let max_allowed_timestamp = now_millis.saturating_add(allowed_timestamp_future_ms); |
| 49 | Duration::from_millis(min_child_timestamp.saturating_sub(max_allowed_timestamp)) |
| 50 | } |
| 51 | |
| 52 | fn select_proposal_timestamp(now_millis: u64, min_child_timestamp: u64) -> u64 { |
| 53 | // Once `min_child_timestamp` is inside the verifier future window, choose |
| 54 | // the later of local time and `parent.timestamp + 1` to preserve monotonicity. |
| 55 | now_millis.max(min_child_timestamp) |
| 56 | } |
| 57 | |
| 58 | /// Whether the wait required to bring the monotonic child timestamp into the |
| 59 | /// verifier future window exceeds the leader window. When true the block could |
nothing calls this directly
no outgoing calls
no test coverage detected