trait SequencerRateLimitManager extends AutoCloseable
Holds the traffic control state and control rate limiting logic of members of a sequencer
- Alphabetic
- By Inheritance
- SequencerRateLimitManager
- AutoCloseable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def balanceKnownUntil: Option[CantonTimestamp]
Timestamp of the latest known state of traffic purchased entries.
- abstract def balanceUpdateSubscriber: SequencerTrafficControlSubscriber
Optional subscriber to the traffic control processor, only used for the new top up implementation
- abstract def close(): Unit
- Definition Classes
- AutoCloseable
- Annotations
- @throws(classOf[java.lang.Exception])
- abstract def getStates(requestedMembers: Set[Member], minTimestamp: Option[CantonTimestamp], lastSequencerEventTimestamp: Option[CantonTimestamp], warnIfApproximate: Boolean = true)(implicit executionContext: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[Map[Member, Either[String, TrafficState]]]
Return the latest known traffic states for the requested members, or all currently cached members if requestedMembers is empty.
Return the latest known traffic states for the requested members, or all currently cached members if requestedMembers is empty.
- minTimestamp
The minimum timestamp at which to get the traffic states. If the current known state is more recent than minTimestamp, it will be returned. If minTimestamp is more recent than the current known state, an APPROXIMATION of the state at minTimestamp will be used. Specifically, the base traffic remainder will be extrapolated to minTimestamp. There is no guarantee that the state returned will be the same as the correct one, when the synchronizer time actually reaches minTimestamp.
- lastSequencerEventTimestamp
timestamp of the last event addressed to the sequencer.
- returns
A Map of member and their traffic state.
- abstract def getTrafficStateForMemberAt(member: Member, timestamp: CantonTimestamp, lastSequencerEventTimestamp: Option[CantonTimestamp])(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, TrafficNotFound, Option[TrafficState]]
- abstract def lastKnownBalanceFor(member: Member)(implicit traceContext: TraceContext): FutureUnlessShutdown[Option[TrafficPurchased]]
Returns the latest known balance for the given member.
- abstract def prune(upToExclusive: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[String]
Prunes traffic control data such as it can still be queried up to 'upToExclusive'.
- abstract def registerNewMemberAt(member: Member, timestamp: CantonTimestamp, trafficControlConfig: TrafficControlParameters)(implicit tc: TraceContext): FutureUnlessShutdown[Unit]
Create a traffic state for a new member at the given timestamp.
Create a traffic state for a new member at the given timestamp. Its base traffic remainder will be equal to the max burst window configured at that point in time.
- abstract def resetStateTo(timestampExclusive: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[Unit]
This method must be called during the crash recovery and must reset the state of rate limit manager to the state at the given timestamp (stores + internal state if there is i.e.
This method must be called during the crash recovery and must reset the state of rate limit manager to the state at the given timestamp (stores + internal state if there is i.e. a cache).
- abstract def trafficConsumedStore: TrafficConsumedStore
- abstract def validateRequestAndConsumeTraffic(request: SubmissionRequest, sequencingTime: CantonTimestamp, submissionTimestamp: Option[CantonTimestamp], latestSequencerEventTimestamp: Option[CantonTimestamp], warnIfApproximate: Boolean, sequencerSignature: Signature)(implicit tc: TraceContext, closeContext: CloseContext): EitherT[FutureUnlessShutdown, SequencerRateLimitError, Option[TrafficReceipt]]
Validate submission requests after they've been sequenced.
Validate submission requests after they've been sequenced. The same validation as performed at submission is run again, to ensure that the submitting sequencer was not malicious. If the request is valid, the cost is consumed. This method MUST be called sequentially for a given sender, meaning concurrent updates are not supported. This method MUST be called in order of sequencing times, meaning 2 events sequenced at T1 and T2 such that T2 > T1 must be processed by this method in the order T1 -> T2. However, if T1 and T2 have been processed in the correct order, it is then ok to call the method with T1 again, which will result in the same output as when it was first called.
- abstract def validateRequestAtSubmissionTime(request: SubmissionRequest, submissionTimestamp: Option[CantonTimestamp], lastSequencedTimestamp: CantonTimestamp, lastSequencerEventTimestamp: Option[CantonTimestamp])(implicit tc: TraceContext, closeContext: CloseContext): EitherT[FutureUnlessShutdown, SequencerRateLimitError, Unit]
Validate signed submission requests received by the sequencer.
Validate signed submission requests received by the sequencer. Requests with a an invalid cost or a cost that exceeds the traffic credit will be rejected.
- submissionTimestamp
The timestamp the sender of the submission request claims to have used to compute the submission cost.
- lastSequencerEventTimestamp
timestamp of the last event addressed to the sequencer.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])