pub struct ContentDenylist { /* private fields */ }Expand description
The union of the operator’s local denylist and the on-chain origin blacklist, as consulted by the delivery path.
Implementations§
Source§impl ContentDenylist
impl ContentDenylist
Sourcepub fn new(content: &ResolvedContent) -> Self
pub fn new(content: &ResolvedContent) -> Self
Build from resolved config, with an empty on-chain set — the watcher fills that in once its bootstrap enumeration completes (#1504).
Sourcepub fn empty() -> Self
pub fn empty() -> Self
An empty deny-set, for tests and for wiring paths with no [content]
section resolved yet.
Sourcepub fn is_origin_denied(&self, addr: &Address) -> bool
pub fn is_origin_denied(&self, addr: &Address) -> bool
Is this address denied as a channel funder, by either source?
Sourcepub fn set_local_origins(&self, content: &ResolvedContent) -> usize
pub fn set_local_origins(&self, content: &ResolvedContent) -> usize
Swap in the origin half of a freshly resolved [content] section,
returning the new entry count for the reload log line.
Touches only the local slot — the on-chain set is the watcher’s, and the hash half is the cache engine’s.
Sourcepub fn set_chain_origins(&self, origins: HashSet<Address>)
pub fn set_chain_origins(&self, origins: HashSet<Address>)
Replace the on-chain origin set wholesale — the watcher’s boot seed from the enumerated address union, and its periodic re-enumeration refresh.
The union is the origin ∪ operator deny set read from
ContentBlacklist.blacklistedAddresses, liveness-filtered by
isOriginBlacklisted || isOperatorBlacklisted (see
decdn-node::blacklist_watcher). It is rebuilt from chain each boot, so
there is no durable projection to reload.
Sourcepub fn apply_chain_origin(&self, addr: Address, blacklisted: bool) -> bool
pub fn apply_chain_origin(&self, addr: Address, blacklisted: bool) -> bool
Apply a single OriginBlacklistUpdated event.
Read-modify-write rather than an in-place mutation, because ArcSwap
has no such thing. Origin events are rare (a governance action), so the
clone is irrelevant next to keeping reads lock-free; a RwLock would
trade that for a write that is still rare. Returns whether the set
actually changed, so callers can skip logging a no-op replay — the
watcher re-scans a block range after a restart and will re-deliver
events it has already applied.
Sourcepub fn chain_origin_count(&self) -> usize
pub fn chain_origin_count(&self) -> usize
Number of on-chain blacklisted origins currently tracked. For telemetry and the admin surface.
Trait Implementations§
Source§impl Debug for ContentDenylist
impl Debug for ContentDenylist
Auto Trait Implementations§
impl !Freeze for ContentDenylist
impl RefUnwindSafe for ContentDenylist
impl Send for ContentDenylist
impl Sync for ContentDenylist
impl Unpin for ContentDenylist
impl UnsafeUnpin for ContentDenylist
impl UnwindSafe for ContentDenylist
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request