Skip to content

Commit

Permalink
Fix zklogin tests (MystenLabs#16825)
Browse files Browse the repository at this point in the history
  • Loading branch information
mystenmark authored Mar 25, 2024
1 parent 42ef811 commit ebe6702
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/sui-core/src/authority/authority_per_epoch_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@ impl AuthorityPerEpochStore {
let insert_result = jwk_aggregator.insert(authority, key.clone());

if !previously_active && insert_result.is_quorum_reached() {
info!("jwk {:?} became active at round {:?}", key, round);
info!(epoch = ?self.epoch(), ?round, jwk = ?key, "jwk became active");
batch.insert_batch(
&self.tables()?.active_jwks,
std::iter::once(((round, key), ())),
Expand Down
6 changes: 5 additions & 1 deletion crates/sui-core/src/consensus_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,13 @@ impl<C: CheckpointServiceNotify + Send + Sync> ConsensusHandler<C> {
.expect("Unrecoverable error in consensus handler");

if !new_jwks.is_empty() {
debug!("adding AuthenticatorStateUpdate tx: {:?}", new_jwks);
let authenticator_state_update_transaction =
self.authenticator_state_update_transaction(round, new_jwks);
debug!(
"adding AuthenticatorStateUpdate({:?}) tx: {:?}",
authenticator_state_update_transaction.digest(),
authenticator_state_update_transaction,
);

transactions.push((
empty_bytes.as_slice(),
Expand Down
8 changes: 4 additions & 4 deletions crates/sui-e2e-tests/tests/zklogin_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ async fn test_legacy_zklogin_address_accept() {
#[sim_test]
async fn zklogin_end_to_end_test() {
let test_cluster = TestClusterBuilder::new()
.with_epoch_duration_ms(10000)
.with_epoch_duration_ms(15000)
.with_default_jwks()
.build()
.await;

// trigger reconfiguration that advanced epoch to 1.
test_cluster.trigger_reconfiguration().await;
test_cluster.wait_for_epoch_all_nodes(1).await;

// load test vectors
let (kp, pk_zklogin, inputs) =
Expand Down Expand Up @@ -188,7 +188,7 @@ async fn test_auth_state_creation() {
// Create test cluster without auth state object in genesis
let test_cluster = TestClusterBuilder::new()
.with_protocol_version(23.into())
.with_epoch_duration_ms(10000)
.with_epoch_duration_ms(15000)
.with_default_jwks()
.build()
.await;
Expand Down Expand Up @@ -253,7 +253,7 @@ async fn test_conflicting_jwks() {
use tokio::time::Duration;

let test_cluster = TestClusterBuilder::new()
.with_epoch_duration_ms(45000)
.with_epoch_duration_ms(30000)
.with_jwk_fetch_interval(Duration::from_secs(5))
.build()
.await;
Expand Down

0 comments on commit ebe6702

Please sign in to comment.