Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtian committed Nov 7, 2024
1 parent a860847 commit 601d1aa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
8 changes: 4 additions & 4 deletions consensus/core/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ pub trait TransactionVerifier: Send + Sync + 'static {
/// Fails if any one of the transactions is invalid.
fn verify_batch(&self, batch: &[&[u8]]) -> Result<(), ValidationError>;

/// Returns indices of transactions to reject.
/// Currently only uncertified user transactions can be rejected.
/// The rest of transactions are implicitly voted to accept.
// TODO: add rejection reasons, add VoteError and wrap the return in Result<>.
/// Returns indices of transactions to reject, validator error over transactions.
/// Currently only uncertified user transactions can be rejected. The rest of transactions
/// are implicitly voted to be accepted.
/// When the result is an error, the whole block should be rejected from local DAG instead.
async fn verify_and_vote_batch(
&self,
batch: &[&[u8]],
Expand Down
9 changes: 3 additions & 6 deletions crates/sui-benchmark/src/fullnode_reconfig_observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ impl ReconfigObserver<NetworkAuthorityClient> for FullNodeReconfigObserver {
Box::new(self.clone())
}

async fn run(
&mut self,
updatable: Arc<dyn AuthorityAggregatorUpdatable<NetworkAuthorityClient>>,
) {
async fn run(&mut self, driver: Arc<dyn AuthorityAggregatorUpdatable<NetworkAuthorityClient>>) {
loop {
tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
match self
Expand All @@ -70,7 +67,7 @@ impl ReconfigObserver<NetworkAuthorityClient> for FullNodeReconfigObserver {
{
Ok(sui_system_state) => {
let epoch_id = sui_system_state.epoch;
if epoch_id > updatable.epoch() {
if epoch_id > driver.epoch() {
debug!(epoch_id, "Got SuiSystemState in newer epoch");
let new_committee = sui_system_state.get_sui_committee_for_benchmarking();
let _ = self
Expand All @@ -83,7 +80,7 @@ impl ReconfigObserver<NetworkAuthorityClient> for FullNodeReconfigObserver {
self.auth_agg_metrics.clone(),
Arc::new(HashMap::new()),
);
updatable.update_authority_aggregator(Arc::new(auth_agg));
driver.update_authority_aggregator(Arc::new(auth_agg));
} else {
trace!(
epoch_id,
Expand Down
3 changes: 3 additions & 0 deletions crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2662,6 +2662,9 @@ impl AuthorityState {
u64::try_from(ts_ms).expect("Travelling in time machine")
}

// TODO(fastpath): update this handler for Mysticeti fastpath.
// There will no longer be validator quorum signed transactions or effects.
// The proof of finality needs to come from checkpoints.
#[instrument(level = "trace", skip_all)]
pub async fn handle_transaction_info_request(
&self,
Expand Down
12 changes: 1 addition & 11 deletions crates/sui-core/src/authority_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,17 +769,7 @@ impl ValidatorService {
if !epoch_store.all_external_consensus_messages_processed(
consensus_transactions.iter().map(|tx| tx.key()),
)? {
let _metrics_guard = if consensus_transactions.iter().any(|tx| match &tx.kind {
ConsensusTransactionKind::CertifiedTransaction(tx) => {
tx.contains_shared_object()
}
ConsensusTransactionKind::UserTransaction(tx) => tx.contains_shared_object(),
_ => false,
}) {
Some(self.metrics.consensus_latency.start_timer())
} else {
None
};
let _metrics_guard = self.metrics.consensus_latency.start_timer();
self.consensus_adapter.submit_batch(
&consensus_transactions,
Some(&reconfiguration_lock),
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-core/src/consensus_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,7 +1386,7 @@ mod tests {
format!("cap({})", cap.generation)
}
ConsensusTransactionKind::CertifiedTransaction(txn) => {
format!("user({})", txn.transaction_data().gas_price())
format!("certified({})", txn.transaction_data().gas_price())
}
ConsensusTransactionKind::UserTransaction(txn) => {
format!("user({})", txn.transaction_data().gas_price())
Expand Down

0 comments on commit 601d1aa

Please sign in to comment.