pub struct AuthorityAggregator<A: Clone> {
pub committee: Arc<Committee>,
pub validator_display_names: Arc<HashMap<AuthorityName, String>>,
pub authority_clients: Arc<BTreeMap<AuthorityName, Arc<SafeClient<A>>>>,
pub metrics: Arc<AuthAggMetrics>,
pub safe_client_metrics_base: SafeClientMetricsBase,
pub timeouts: TimeoutConfig,
pub committee_store: Arc<CommitteeStore>,
}
Fields§
§committee: Arc<Committee>
Our Sui committee.
validator_display_names: Arc<HashMap<AuthorityName, String>>
For more human readable metrics reporting. It’s OK for this map to be empty or missing validators, it then defaults to use concise validator public keys.
How to talk to this committee.
metrics: Arc<AuthAggMetrics>
Metrics
safe_client_metrics_base: SafeClientMetricsBase
Metric base for the purpose of creating new safe clients during reconfiguration.
timeouts: TimeoutConfig
§committee_store: Arc<CommitteeStore>
Store here for clone during re-config.
Implementations§
Source§impl<A: Clone> AuthorityAggregator<A>
impl<A: Clone> AuthorityAggregator<A>
pub fn new( committee: Committee, committee_store: Arc<CommitteeStore>, authority_clients: BTreeMap<AuthorityName, A>, safe_client_metrics_base: SafeClientMetricsBase, auth_agg_metrics: Arc<AuthAggMetrics>, validator_display_names: Arc<HashMap<AuthorityName, String>>, timeouts: TimeoutConfig, ) -> Self
Sourcepub fn recreate_with_net_addresses(
&self,
committee: CommitteeWithNetworkMetadata,
network_config: &Config,
disallow_missing_intermediate_committees: bool,
) -> SuiResult<AuthorityAggregator<NetworkAuthorityClient>>
pub fn recreate_with_net_addresses( &self, committee: CommitteeWithNetworkMetadata, network_config: &Config, disallow_missing_intermediate_committees: bool, ) -> SuiResult<AuthorityAggregator<NetworkAuthorityClient>>
This function recreates AuthorityAggregator with the given committee.
It also updates committee store which impacts other of its references.
When disallow_missing_intermediate_committees is true, it requires the
new committee needs to be current epoch + 1.
The function could be used along with reconfig_from_genesis
to fill in
all previous epoch’s committee info.
pub fn get_client(&self, name: &AuthorityName) -> Option<&Arc<SafeClient<A>>>
pub fn clone_client_test_only(&self, name: &AuthorityName) -> Arc<SafeClient<A>>where
A: Clone,
pub fn clone_committee_store(&self) -> Arc<CommitteeStore>
pub fn clone_inner_committee_test_only(&self) -> Committee
pub fn clone_inner_clients_test_only( &self, ) -> BTreeMap<AuthorityName, SafeClient<A>>
Source§impl AuthorityAggregator<NetworkAuthorityClient>
impl AuthorityAggregator<NetworkAuthorityClient>
Sourcepub fn new_from_epoch_start_state(
epoch_start_state: &EpochStartSystemState,
committee_store: &Arc<CommitteeStore>,
safe_client_metrics_base: SafeClientMetricsBase,
auth_agg_metrics: Arc<AuthAggMetrics>,
) -> Self
pub fn new_from_epoch_start_state( epoch_start_state: &EpochStartSystemState, committee_store: &Arc<CommitteeStore>, safe_client_metrics_base: SafeClientMetricsBase, auth_agg_metrics: Arc<AuthAggMetrics>, ) -> Self
Create a new network authority aggregator by reading the committee and network addresses information from the given epoch start system state.
Sourcepub fn recreate_with_new_epoch_start_state(
&self,
epoch_start_state: &EpochStartSystemState,
) -> Self
pub fn recreate_with_new_epoch_start_state( &self, epoch_start_state: &EpochStartSystemState, ) -> Self
Create a new AuthorityAggregator using information from the given epoch start system state. This is typically used during reconfiguration to create a new AuthorityAggregator with the new committee and network addresses.
pub fn new_from_committee( committee: CommitteeWithNetworkMetadata, committee_store: &Arc<CommitteeStore>, safe_client_metrics_base: SafeClientMetricsBase, auth_agg_metrics: Arc<AuthAggMetrics>, validator_display_names: Arc<HashMap<AuthorityName, String>>, ) -> Self
Source§impl<A> AuthorityAggregator<A>
impl<A> AuthorityAggregator<A>
Sourcepub async fn get_latest_object_version_for_testing(
&self,
object_id: ObjectID,
) -> SuiResult<Object>
pub async fn get_latest_object_version_for_testing( &self, object_id: ObjectID, ) -> SuiResult<Object>
Query the object with highest version number from the authorities. We stop after receiving responses from 2f+1 validators. This function is untrusted because we simply assume each response is valid and there are no byzantine validators. Because of this, this function should only be used for testing or benchmarking.
Sourcepub async fn get_latest_system_state_object_for_testing(
&self,
) -> Result<SuiSystemState>
pub async fn get_latest_system_state_object_for_testing( &self, ) -> Result<SuiSystemState>
Get the latest system state object from the authorities. This function assumes all validators are honest. It should only be used for testing or benchmarking.
Sourcepub async fn process_transaction(
&self,
transaction: Transaction,
client_addr: Option<SocketAddr>,
) -> Result<ProcessTransactionResult, AggregatorProcessTransactionError>
pub async fn process_transaction( &self, transaction: Transaction, client_addr: Option<SocketAddr>, ) -> Result<ProcessTransactionResult, AggregatorProcessTransactionError>
Submits the transaction to a quorum of validators to make a certificate.
pub async fn process_certificate( &self, request: HandleCertificateRequestV3, client_addr: Option<SocketAddr>, ) -> Result<QuorumDriverResponse, AggregatorProcessCertificateError>
pub async fn execute_transaction_block( &self, transaction: &Transaction, client_addr: Option<SocketAddr>, ) -> Result<VerifiedCertifiedTransactionEffects, Error>
Sourcepub async fn handle_transaction_info_request_from_some_validators(
&self,
tx_digest: &TransactionDigest,
validators: &BTreeSet<AuthorityName>,
timeout_total: Option<Duration>,
) -> SuiResult<PlainTransactionInfoResponse>
pub async fn handle_transaction_info_request_from_some_validators( &self, tx_digest: &TransactionDigest, validators: &BTreeSet<AuthorityName>, timeout_total: Option<Duration>, ) -> SuiResult<PlainTransactionInfoResponse>
This function tries to get SignedTransaction OR CertifiedTransaction from an given list of validators who are supposed to know about it.
Trait Implementations§
Source§impl<A: Clone + Clone> Clone for AuthorityAggregator<A>
impl<A: Clone + Clone> Clone for AuthorityAggregator<A>
Source§fn clone(&self) -> AuthorityAggregator<A>
fn clone(&self) -> AuthorityAggregator<A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<A> Freeze for AuthorityAggregator<A>
impl<A> !RefUnwindSafe for AuthorityAggregator<A>
impl<A> Send for AuthorityAggregator<A>
impl<A> Sync for AuthorityAggregator<A>
impl<A> Unpin for AuthorityAggregator<A>
impl<A> !UnwindSafe for AuthorityAggregator<A>
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a Request
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§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
Source§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
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered
].§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.