pub struct UnprocessedPacketBatches {
pub packet_priority_queue: MinMaxHeap<Rc<ImmutableDeserializedPacket>>,
pub message_hash_to_transaction: HashMap<Hash, DeserializedPacket>,
/* private fields */
}
Expand description
Currently each banking_stage thread has a UnprocessedPacketBatches
buffer to store
PacketBatch’s received from sigverify. Banking thread continuously scans the buffer
to pick proper packets to add to the block.
Fields
packet_priority_queue: MinMaxHeap<Rc<ImmutableDeserializedPacket>>
message_hash_to_transaction: HashMap<Hash, DeserializedPacket>
Implementations
sourceimpl UnprocessedPacketBatches
impl UnprocessedPacketBatches
pub fn from_iter<I: IntoIterator<Item = DeserializedPacket>>(
iter: I,
capacity: usize
) -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn clear(&mut self)
sourcepub fn insert_batch(
&mut self,
deserialized_packets: impl Iterator<Item = DeserializedPacket>
) -> usize
pub fn insert_batch(
&mut self,
deserialized_packets: impl Iterator<Item = DeserializedPacket>
) -> usize
Insert new deserialized_packet_batch
into inner MinMaxHeap<DeserializedPacket>
,
weighted first by the tx priority, then the stake of the sender.
If buffer is at the max limit, the lowest weighted packet is dropped
Returns tuple of number of packets dropped
pub fn push(
&mut self,
deserialized_packet: DeserializedPacket
) -> Option<DeserializedPacket>
pub fn iter(&mut self) -> impl Iterator<Item = &DeserializedPacket>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut DeserializedPacket>
pub fn retain<F>(&mut self, f: F) where
F: FnMut(&mut DeserializedPacket) -> bool,
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn pop_max(&mut self) -> Option<DeserializedPacket>
sourcepub fn pop_max_n(&mut self, n: usize) -> Option<Vec<DeserializedPacket>>
pub fn pop_max_n(&mut self, n: usize) -> Option<Vec<DeserializedPacket>>
Pop up to the next n
highest priority transactions from the queue.
Returns None
if the queue is empty
pub fn capacity(&self) -> usize
Trait Implementations
sourceimpl Default for UnprocessedPacketBatches
impl Default for UnprocessedPacketBatches
sourcefn default() -> UnprocessedPacketBatches
fn default() -> UnprocessedPacketBatches
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for UnprocessedPacketBatches
impl !Send for UnprocessedPacketBatches
impl !Sync for UnprocessedPacketBatches
impl Unpin for UnprocessedPacketBatches
impl UnwindSafe for UnprocessedPacketBatches
Blanket Implementations
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> TupleTree<T, ()> for T
impl<T> TupleTree<T, ()> for T
const SIZE: Size = Size{degree: 0, descendants: 0,}
fn descendants(_indirect_level: usize) -> usize
fn height() -> usize
fn preorder(self, f: &mut impl FnMut(Visit<T>))
fn preorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
fn postorder(self, f: &mut impl FnMut(Visit<T>))
fn postorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more