mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Constants
This commit is contained in:
@@ -49,14 +49,13 @@ impl<T: BeaconChainTypes> GossipVerifiedInclusionList<T> {
|
||||
.now()
|
||||
.ok_or(BeaconChainError::UnableToReadSlot)?;
|
||||
|
||||
// TODO(focil) move 8192 to config
|
||||
if signed_il
|
||||
.message
|
||||
.transactions
|
||||
.iter()
|
||||
.map(|v| v.len())
|
||||
.sum::<usize>()
|
||||
> 8192
|
||||
> chain.spec.max_bytes_per_inclusion_list as usize
|
||||
{
|
||||
return Err(GossipInclusionListError::TooManyTransactions);
|
||||
}
|
||||
@@ -124,10 +123,9 @@ impl<T: BeaconChainTypes> GossipVerifiedInclusionList<T> {
|
||||
return Err(GossipInclusionListError::PriorInclusionListKnown);
|
||||
}
|
||||
|
||||
// Compute timeliness: timely if received before INCLUSION_LIST_DUE_BPS into the slot
|
||||
// INCLUSION_LIST_DUE_BPS = 6667 basis points = 66.67% of slot duration
|
||||
let slot_duration_ms = chain.spec.get_slot_duration().as_millis() as u64;
|
||||
let inclusion_list_due_ms = slot_duration_ms * 6667 / 10000;
|
||||
let inclusion_list_due_ms =
|
||||
slot_duration_ms * chain.spec.inclusion_list_due_bps / 10000;
|
||||
let il_delay_ms =
|
||||
get_slot_delay_ms(timestamp_now(), message_slot, &chain.slot_clock).as_millis() as u64;
|
||||
let is_timely = il_delay_ms <= inclusion_list_due_ms;
|
||||
|
||||
Reference in New Issue
Block a user