MCPcopy Create free account
hub / github.com/SeismicSystems/summit / Actor

Class Actor

application/src/actor.rs:34–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#[cfg(feature = "prom")]
33use metrics::{counter, histogram};
34use summit_syncer::ingress::mailbox::Mailbox as SyncerMailbox;
35use summit_types::{Block, BlockAuxData, Digest, EngineClient};
36
37/// How long to wait before retrying check_payload when Reth returns SYNCING during certify.
38const CERTIFY_SYNCING_RETRY: Duration = Duration::from_millis(100);
39
40fn 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
52fn 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected