pub struct AuthorityPerEpochStore { /* private fields */ }
Implementations§
source§impl AuthorityPerEpochStore
impl AuthorityPerEpochStore
pub fn new( name: AuthorityName, committee: Arc<Committee>, parent_path: &Path, db_options: Option<Options>, metrics: Arc<EpochMetrics>, epoch_start_configuration: EpochStartConfiguration, execution_cache: Arc<ExecutionCache>, cache_metrics: Arc<ResolverMetrics>, signature_verifier_metrics: Arc<SignatureVerifierMetrics>, expensive_safety_check_config: &ExpensiveSafetyCheckConfig, chain_identifier: ChainIdentifier ) -> Arc<Self>
pub fn tables(&self) -> SuiResult<Arc<AuthorityEpochTables>>
pub fn release_db_handles(&self)
pub fn authenticator_state_enabled(&self) -> bool
pub fn authenticator_state_exists(&self) -> bool
pub fn randomness_state_enabled(&self) -> bool
pub fn randomness_state_exists(&self) -> bool
pub fn randomness_reporter(&self) -> Option<RandomnessReporter>
pub fn set_randomness_manager( &self, randomness_manager: RandomnessManager ) -> SuiResult<()>
pub fn coin_deny_list_state_exists(&self) -> bool
pub fn coin_deny_list_state_enabled(&self) -> bool
pub fn get_parent_path(&self) -> PathBuf
sourcepub fn epoch_start_config(&self) -> &Arc<EpochStartConfiguration>
pub fn epoch_start_config(&self) -> &Arc<EpochStartConfiguration>
Returns &Arc<EpochStartConfiguration>
User can treat this Arc
as &EpochStartConfiguration
, or clone the Arc to pass as owned object
pub fn epoch_start_state(&self) -> &EpochStartSystemState
pub fn get_chain_identifier(&self) -> ChainIdentifier
pub fn new_at_next_epoch( &self, name: AuthorityName, new_committee: Committee, epoch_start_configuration: EpochStartConfiguration, cache: Arc<ExecutionCache>, expensive_safety_check_config: &ExpensiveSafetyCheckConfig, chain_identifier: ChainIdentifier ) -> Arc<Self>
pub fn committee(&self) -> &Arc<Committee>
pub fn protocol_config(&self) -> &ProtocolConfig
pub fn epoch(&self) -> EpochId
pub fn get_state_hash_for_checkpoint( &self, checkpoint: &CheckpointSequenceNumber ) -> SuiResult<Option<Accumulator>>
pub fn insert_state_hash_for_checkpoint( &self, checkpoint: &CheckpointSequenceNumber, accumulator: &Accumulator ) -> SuiResult
pub fn reference_gas_price(&self) -> u64
pub fn protocol_version(&self) -> ProtocolVersion
pub fn module_cache( &self ) -> &Arc<SyncModuleCache<ResolverWrapper<ExecutionCache>>>
pub fn executor(&self) -> &Arc<dyn Executor + Send + Sync>
pub async fn acquire_tx_guard( &self, cert: &VerifiedExecutableTransaction ) -> SuiResult<CertTxGuard>
sourcepub async fn acquire_tx_lock(&self, digest: &TransactionDigest) -> CertLockGuard
pub async fn acquire_tx_lock(&self, digest: &TransactionDigest) -> CertLockGuard
Acquire the lock for a tx without writing to the WAL.
pub fn store_reconfig_state(&self, new_state: &ReconfigState) -> SuiResult
pub fn insert_signed_transaction( &self, transaction: VerifiedSignedTransaction ) -> SuiResult
pub fn get_signed_transaction( &self, tx_digest: &TransactionDigest ) -> SuiResult<Option<VerifiedSignedTransaction>>
pub fn insert_tx_cert_and_effects_signature( &self, tx_key: &TransactionKey, tx_digest: &TransactionDigest, cert_sig: Option<&AuthorityStrongQuorumSignInfo>, effects_signature: Option<&AuthoritySignInfo> ) -> SuiResult
pub fn effects_signatures_exists<'a>( &self, digests: impl IntoIterator<Item = &'a TransactionDigest> ) -> SuiResult<Vec<bool>>
pub fn get_effects_signature( &self, tx_digest: &TransactionDigest ) -> SuiResult<Option<AuthoritySignInfo>>
pub fn get_transaction_cert_sig( &self, tx_digest: &TransactionDigest ) -> SuiResult<Option<AuthorityStrongQuorumSignInfo>>
pub fn get_last_consensus_index(&self) -> SuiResult<ExecutionIndicesWithHash>
pub fn get_last_consensus_stats(&self) -> SuiResult<ExecutionIndicesWithStats>
pub fn get_accumulators_in_checkpoint_range( &self, from_checkpoint: CheckpointSequenceNumber, to_checkpoint: CheckpointSequenceNumber ) -> SuiResult<Vec<(CheckpointSequenceNumber, Accumulator)>>
sourcepub async fn notify_read_checkpoint_state_digests(
&self,
checkpoints: Vec<CheckpointSequenceNumber>
) -> SuiResult<Vec<Accumulator>>
pub async fn notify_read_checkpoint_state_digests( &self, checkpoints: Vec<CheckpointSequenceNumber> ) -> SuiResult<Vec<Accumulator>>
Returns future containing the state digest for the given epoch once available
sourcepub fn all_pending_execution(
&self
) -> SuiResult<Vec<VerifiedExecutableTransaction>>
pub fn all_pending_execution( &self ) -> SuiResult<Vec<VerifiedExecutableTransaction>>
pending_certificates
table related methods. Should only be used from TransactionManager.
Gets all pending certificates. Used during recovery.
sourcepub fn multi_remove_pending_execution(
&self,
digests: &[TransactionDigest]
) -> SuiResult<()>
pub fn multi_remove_pending_execution( &self, digests: &[TransactionDigest] ) -> SuiResult<()>
Deletes many pending certificates.
pub fn get_all_pending_consensus_transactions( &self ) -> Vec<ConsensusTransaction>
pub fn insert_finalized_transactions( &self, digests: &[TransactionDigest], sequence: CheckpointSequenceNumber ) -> SuiResult
pub fn is_transaction_executed_in_checkpoint( &self, digest: &TransactionDigest ) -> SuiResult<bool>
pub fn get_transaction_checkpoint( &self, digest: &TransactionDigest ) -> SuiResult<Option<CheckpointSequenceNumber>>
pub fn multi_get_transaction_checkpoint( &self, digests: &[TransactionDigest] ) -> SuiResult<Vec<Option<CheckpointSequenceNumber>>>
pub fn per_epoch_finalized_txns_enabled(&self) -> bool
pub fn object_lock_split_tables_enabled(&self) -> bool
Given list of certificates, assign versions for all shared objects used in them. We start with the current next_shared_object_versions table for each object, and build up the versions based on the dependencies of each certificate. However, in the end we do not update the next_shared_object_versions table, which keeps this function idempotent. We should call this function when we are assigning shared object versions outside of consensus and do not want to taint the next_shared_object_versions table.
pub fn get_all_deferred_transactions_for_test( &self ) -> SuiResult<Vec<(DeferralKey, Vec<VerifiedSequencedConsensusTransaction>)>>
Lock a sequence number for the shared objects of the input transaction based on the effects of that transaction. Used by full nodes who don’t listen to consensus, and validators who catch up by state sync.
sourcepub fn insert_pending_consensus_transactions(
&self,
transaction: &ConsensusTransaction,
lock: Option<&RwLockReadGuard<'_, ReconfigState>>
) -> SuiResult
pub fn insert_pending_consensus_transactions( &self, transaction: &ConsensusTransaction, lock: Option<&RwLockReadGuard<'_, ReconfigState>> ) -> SuiResult
When submitting a certificate caller must provide a ReconfigState lock guard and verify that it allows new user certificates
pub fn remove_pending_consensus_transaction( &self, key: &ConsensusTransactionKey ) -> SuiResult
pub fn pending_consensus_certificates_count(&self) -> usize
pub fn pending_consensus_certificates_empty(&self) -> bool
pub fn pending_consensus_certificates(&self) -> HashSet<TransactionDigest>
pub fn deferred_transactions_empty(&self) -> bool
sourcepub fn insert_pending_execution(
&self,
certs: &[TrustedExecutableTransaction]
) -> SuiResult<()>
pub fn insert_pending_execution( &self, certs: &[TrustedExecutableTransaction] ) -> SuiResult<()>
Stores a list of pending certificates to be executed.
sourcepub fn is_tx_cert_consensus_message_processed(
&self,
certificate: &CertifiedTransaction
) -> SuiResult<bool>
pub fn is_tx_cert_consensus_message_processed( &self, certificate: &CertifiedTransaction ) -> SuiResult<bool>
Check whether certificate was processed by consensus. For shared lock certificates, if this function returns true means shared locks for this certificate are set
pub fn is_consensus_message_processed( &self, key: &SequencedConsensusTransactionKey ) -> SuiResult<bool>
pub async fn consensus_message_processed_notify( &self, key: SequencedConsensusTransactionKey ) -> Result<(), SuiError>
pub fn check_consensus_messages_processed<'a>( &self, keys: impl Iterator<Item = &'a SequencedConsensusTransactionKey> ) -> SuiResult<Vec<bool>>
pub async fn consensus_messages_processed_notify( &self, keys: Vec<SequencedConsensusTransactionKey> ) -> Result<(), SuiError>
pub fn has_sent_end_of_publish( &self, authority: &AuthorityName ) -> SuiResult<bool>
pub async fn notify_read_executed_digests( &self, keys: &[TransactionKey] ) -> SuiResult<Vec<TransactionDigest>>
sourcepub fn user_signatures_for_checkpoint(
&self,
transactions: &[VerifiedTransaction],
digests: &[TransactionDigest]
) -> SuiResult<Vec<Vec<GenericSignature>>>
pub fn user_signatures_for_checkpoint( &self, transactions: &[VerifiedTransaction], digests: &[TransactionDigest] ) -> SuiResult<Vec<Vec<GenericSignature>>>
Note: caller usually need to call consensus_message_processed_notify before this call
pub fn clear_override_protocol_upgrade_buffer_stake(&self) -> SuiResult
pub fn set_override_protocol_upgrade_buffer_stake( &self, new_stake_bps: u64 ) -> SuiResult
pub fn get_effective_buffer_stake_bps(&self) -> u64
sourcepub fn record_capabilities(
&self,
capabilities: &AuthorityCapabilities
) -> SuiResult
pub fn record_capabilities( &self, capabilities: &AuthorityCapabilities ) -> SuiResult
Record most recently advertised capabilities of all authorities
pub fn get_capabilities(&self) -> SuiResult<Vec<AuthorityCapabilities>>
pub fn record_jwk_vote( &self, batch: &mut DBBatch, round: u64, authority: AuthorityName, id: &JwkId, jwk: &JWK ) -> SuiResult
pub fn jwk_active_in_current_epoch(&self, jwk_id: &JwkId, jwk: &JWK) -> bool
pub fn test_insert_user_signature( &self, digest: TransactionDigest, signatures: Vec<GenericSignature> )
pub fn finish_consensus_certificate_process_with_batch( &self, batch: &mut DBBatch, certificates: &[VerifiedExecutableTransaction] ) -> SuiResult
pub fn get_reconfig_state_read_lock_guard( &self ) -> RwLockReadGuard<'_, ReconfigState>
pub fn get_reconfig_state_write_lock_guard( &self ) -> RwLockWriteGuard<'_, ReconfigState>
pub fn close_user_certs(&self, lock_guard: RwLockWriteGuard<'_, ReconfigState>)
pub async fn user_certs_closed_notify(&self)
sourcepub async fn epoch_terminated(&self)
pub async fn epoch_terminated(&self)
Notify epoch is terminated, can only be called once on epoch store
sourcepub async fn wait_epoch_terminated(&self)
pub async fn wait_epoch_terminated(&self)
Waits for the notification about epoch termination
sourcepub async fn within_alive_epoch<F: Future + Send>(
&self,
f: F
) -> Result<F::Output, ()>
pub async fn within_alive_epoch<F: Future + Send>( &self, f: F ) -> Result<F::Output, ()>
This function executes given future until epoch_terminated is called If future finishes before epoch_terminated is called, future result is returned If epoch_terminated is called before future is resolved, error is returned
In addition to the early termination guarantee, this function also prevents epoch_terminated() if future is being executed.
pub fn verify_transaction( &self, tx: Transaction ) -> SuiResult<VerifiedTransaction>
pub fn get_highest_pending_checkpoint_height(&self) -> CheckpointHeight
pub async fn process_consensus_transactions_for_tests<C: CheckpointServiceNotify>( self: &Arc<Self>, transactions: Vec<SequencedConsensusTransaction>, checkpoint_service: &Arc<C>, cache_reader: &dyn ExecutionCacheRead, authority_metrics: &Arc<AuthorityMetrics> ) -> SuiResult<Vec<VerifiedExecutableTransaction>>
pub fn get_pending_checkpoints( &self, last: Option<CheckpointHeight> ) -> SuiResult<Vec<(CheckpointHeight, PendingCheckpointV2)>>
pub fn get_pending_checkpoint( &self, index: &CheckpointHeight ) -> SuiResult<Option<PendingCheckpointV2>>
pub fn process_pending_checkpoint( &self, commit_height: CheckpointHeight, content_info: Vec<(CheckpointSummary, CheckpointContents)> ) -> SuiResult<()>
sourcepub fn put_genesis_checkpoint_in_builder(
&self,
summary: &CheckpointSummary,
contents: &CheckpointContents
) -> SuiResult<()>
pub fn put_genesis_checkpoint_in_builder( &self, summary: &CheckpointSummary, contents: &CheckpointContents ) -> SuiResult<()>
Register genesis checkpoint in builder DB
pub fn last_built_checkpoint_commit_height( &self ) -> SuiResult<Option<CheckpointHeight>>
pub fn last_built_checkpoint_summary( &self ) -> SuiResult<Option<(CheckpointSequenceNumber, CheckpointSummary)>>
pub fn get_built_checkpoint_summary( &self, sequence: CheckpointSequenceNumber ) -> SuiResult<Option<CheckpointSummary>>
pub fn builder_included_transactions_in_checkpoint<'a>( &self, digests: impl Iterator<Item = &'a TransactionDigest> ) -> SuiResult<Vec<bool>>
pub fn get_last_checkpoint_signature_index(&self) -> SuiResult<u64>
pub fn insert_checkpoint_signature( &self, checkpoint_seq: CheckpointSequenceNumber, index: u64, info: &CheckpointSignatureMessage ) -> SuiResult<()>
pub fn record_end_of_message_quorum_time_metric(&self)
pub fn record_epoch_reconfig_start_time_metric(&self)
pub fn record_is_safe_mode_metric(&self, safe_mode: bool)
pub fn record_checkpoint_builder_is_safe_mode_metric(&self, safe_mode: bool)
pub fn clear_signature_cache(&self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AuthorityPerEpochStore
impl Send for AuthorityPerEpochStore
impl Sync for AuthorityPerEpochStore
impl Unpin for AuthorityPerEpochStore
impl !UnwindSafe for AuthorityPerEpochStore
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§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
§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
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<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.