Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(*): Update external rust SDK types #5195

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ indexmap = { version = "2.1.0", features = ["serde"] }
indicatif = "0.17.2"
insta = { version = "1.21.1", features = ["redactions", "yaml", "json"] }
integer-encoding = "3.0.1"
# core-types with json format for REST API
iota-sdk2 = { package = "iota-sdk-types", git = "https://github.com/iotaledger/iota-rust-sdk.git", rev = "7bd24a06d4f54e15254efb7eb03f2c8d80797cfd", features = ["hash", "serde", "schemars"] }
itertools = "0.13.0"
json_to_table = { git = "https://github.com/zhiburt/tabled/", rev = "e449317a1c02eb6b29e409ad6617e5d9eb7b3bd4" }
jsonrpsee = { version = "0.24", features = ["server", "macros", "client", "ws-client", "http-client"] }
Expand Down Expand Up @@ -304,7 +306,7 @@ rand = "0.8.5"
rayon = "1.5.3"
regex = "1.7.1"
reqwest = { version = "0.12", default-features = false, features = ["http2", "json", "rustls-tls"] }
roaring = "0.10.6"
roaring = "0.10.10"
rocksdb = { version = "0.21.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib", "multi-threaded-cf"] }
rstest = "0.16.0"
rustls = { version = "0.23.18", default-features = false, features = ["std", "tls12", "ring"] }
Expand Down Expand Up @@ -413,8 +415,6 @@ iota-rest-api = { path = "crates/iota-rest-api" }
iota-rosetta = { path = "crates/iota-rosetta" }
iota-rpc-loadgen = { path = "crates/iota-rpc-loadgen" }
iota-sdk = { path = "crates/iota-sdk" }
# core-types with json format for REST API
iota-sdk2 = { package = "iota-rust-sdk", git = "https://github.com/iotaledger/iota-rust-sdk.git", rev = "2ba6b293bdede769a1d9b4d1aecaede2ff7682dd", features = ["hash", "serde", "schemars"] }
iota-simulator = { path = "crates/iota-simulator" }
iota-snapshot = { path = "crates/iota-snapshot" }
iota-source-validation = { path = "crates/iota-source-validation" }
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ impl AuthorityState {
)
.await?;

if let TransactionKind::AuthenticatorStateUpdateV1(auth_state) =
if let TransactionKind::AuthenticatorStateUpdate(auth_state) =
certificate.data().transaction_data().kind()
{
if let Some(err) = &execution_error_opt {
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-core/src/authority/authority_per_epoch_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use iota_types::{
signature::GenericSignature,
storage::{BackingPackageStore, GetSharedLocks, InputKey, ObjectStore},
transaction::{
AuthenticatorStateUpdateV1, CertifiedTransaction, InputObjectKind, SenderSignedData,
AuthenticatorStateUpdate, CertifiedTransaction, InputObjectKind, SenderSignedData,
Transaction, TransactionDataAPI, TransactionKey, TransactionKind, VerifiedCertificate,
VerifiedSignedTransaction, VerifiedTransaction,
},
Expand Down Expand Up @@ -3782,7 +3782,7 @@ impl AuthorityPerEpochStore {
.set(self.epoch_open_time.elapsed().as_millis() as i64);
}

pub(crate) fn update_authenticator_state(&self, update: &AuthenticatorStateUpdateV1) {
pub(crate) fn update_authenticator_state(&self, update: &AuthenticatorStateUpdate) {
info!("Updating authenticator state: {:?}", update);
for active_jwk in &update.new_active_jwks {
let ActiveJwk { jwk_id, jwk, .. } = active_jwk;
Expand Down
16 changes: 8 additions & 8 deletions crates/iota-core/src/checkpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ impl CheckpointBuilder {
.expect("Transaction block must exist");

Ok(match first_tx.transaction_data().kind() {
TransactionKind::ConsensusCommitPrologueV1(_) => {
TransactionKind::ConsensusCommitPrologue(_) => {
assert_eq!(first_tx.digest(), root_effects[0].transaction_digest());
Some((*first_tx.digest(), root_effects[0].clone()))
}
Expand Down Expand Up @@ -1357,10 +1357,10 @@ impl CheckpointBuilder {
let (transaction, size) = transaction_and_size
.unwrap_or_else(|| panic!("Could not find executed transaction {:?}", effects));
match transaction.inner().transaction_data().kind() {
TransactionKind::ConsensusCommitPrologueV1(_)
| TransactionKind::AuthenticatorStateUpdateV1(_) => {
TransactionKind::ConsensusCommitPrologue(_)
| TransactionKind::AuthenticatorStateUpdate(_) => {
// ConsensusCommitPrologue and
// AuthenticatorStateUpdateV1
// AuthenticatorStateUpdate
// are guaranteed to be
// processed before we reach here.
}
Expand Down Expand Up @@ -1701,7 +1701,7 @@ impl CheckpointBuilder {
tx.as_ref().filter(|tx| {
matches!(
tx.transaction_data().kind(),
TransactionKind::ConsensusCommitPrologueV1(_)
TransactionKind::ConsensusCommitPrologue(_)
)
})
})
Expand Down Expand Up @@ -1730,23 +1730,23 @@ impl CheckpointBuilder {
for tx in txs.iter().flatten() {
assert!(!matches!(
tx.transaction_data().kind(),
TransactionKind::ConsensusCommitPrologueV1(_)
TransactionKind::ConsensusCommitPrologue(_)
));
}
} else {
// If there is one consensus commit prologue, it must be the first one in the
// checkpoint.
assert!(matches!(
txs[0].as_ref().unwrap().transaction_data().kind(),
TransactionKind::ConsensusCommitPrologueV1(_)
TransactionKind::ConsensusCommitPrologue(_)
));

assert_eq!(ccps[0].digest(), txs[0].as_ref().unwrap().digest());

for tx in txs.iter().skip(1).flatten() {
assert!(!matches!(
tx.transaction_data().kind(),
TransactionKind::ConsensusCommitPrologueV1(_)
TransactionKind::ConsensusCommitPrologue(_)
));
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-core/src/consensus_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl<C: CheckpointServiceNotify + Send + Sync> ConsensusHandler<C> {
let authenticator_state_update_transaction =
self.authenticator_state_update_transaction(round, new_jwks);
debug!(
"adding AuthenticatorStateUpdateV1({:?}) tx: {:?}",
"adding AuthenticatorStateUpdate({:?}) tx: {:?}",
authenticator_state_update_transaction.digest(),
authenticator_state_update_transaction,
);
Expand Down
10 changes: 5 additions & 5 deletions crates/iota-core/src/unit_tests/authority_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4838,7 +4838,7 @@ async fn test_consensus_commit_prologue_generation() {
.data()
.transaction_data()
.kind(),
TransactionKind::ConsensusCommitPrologueV1(..)
TransactionKind::ConsensusCommitPrologue(..)
));

// Tests that the system clock object is updated by the new consensus commit
Expand Down Expand Up @@ -6146,15 +6146,15 @@ async fn test_consensus_handler_congestion_control_transaction_cancellation() {
// transaction, and it must be the first one.
assert!(matches!(
scheduled_txns[0].data().transaction_data().kind(),
TransactionKind::ConsensusCommitPrologueV1(..)
TransactionKind::ConsensusCommitPrologue(..)
));
assert!(scheduled_txns[1].data().transaction_data().gas_price() == 2000);

let scheduled_txns = send_batch_consensus_no_execution(&authority, &[], false).await;
assert_eq!(scheduled_txns.len(), 2);
assert!(matches!(
scheduled_txns[0].data().transaction_data().kind(),
TransactionKind::ConsensusCommitPrologueV1(..)
TransactionKind::ConsensusCommitPrologue(..)
));
assert!(scheduled_txns[1].data().transaction_data().gas_price() == 2000);

Expand Down Expand Up @@ -6224,7 +6224,7 @@ async fn test_consensus_handler_congestion_control_transaction_cancellation() {

// Consensus commit prologue contains cancelled txn shared object version
// assignment.
if let TransactionKind::ConsensusCommitPrologueV1(prologue_txn) =
if let TransactionKind::ConsensusCommitPrologue(prologue_txn) =
scheduled_txns[0].data().transaction_data().kind()
{
assert!(matches!(
Expand All @@ -6239,7 +6239,7 @@ async fn test_consensus_handler_congestion_control_transaction_cancellation() {
)]
));
} else {
panic!("First scheduled transaction must be a ConsensusCommitPrologueV1 transaction.");
panic!("First scheduled transaction must be a ConsensusCommitPrologue transaction.");
}
}

Expand Down
16 changes: 8 additions & 8 deletions crates/iota-core/src/unit_tests/transaction_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use iota_types::{
multisig::{MultiSig, MultiSigPublicKey},
signature::GenericSignature,
transaction::{
AuthenticatorStateUpdateV1, GenesisTransaction, TransactionDataAPI, TransactionKind,
AuthenticatorStateUpdate, GenesisTransaction, TransactionDataAPI, TransactionKind,
},
utils::{get_one_zklogin_inputs, load_test_vectors, to_sender_signed_transaction},
zk_login_authenticator::ZkLoginAuthenticator,
Expand Down Expand Up @@ -60,7 +60,7 @@ macro_rules! assert_matches {

use fastcrypto::traits::AggregateAuthenticator;
use iota_types::{
digests::ConsensusCommitDigest, messages_consensus::ConsensusCommitPrologueV1,
digests::ConsensusCommitDigest, messages_consensus::ConsensusCommitPrologue,
messages_grpc::HandleCertificateRequestV1,
programmable_transaction_builder::ProgrammableTransactionBuilder,
};
Expand Down Expand Up @@ -228,8 +228,8 @@ async fn test_user_sends_genesis_transaction() {

#[tokio::test]
async fn test_user_sends_consensus_commit_prologue_v1() {
test_user_sends_system_transaction_impl(TransactionKind::ConsensusCommitPrologueV1(
ConsensusCommitPrologueV1 {
test_user_sends_system_transaction_impl(TransactionKind::ConsensusCommitPrologue(
ConsensusCommitPrologue {
epoch: 0,
round: 0,
sub_dag_index: None,
Expand Down Expand Up @@ -1001,7 +1001,7 @@ async fn setup_zklogin_network(
let gas_object_id = gas_object_ids[0];
let jwks = parse_jwks(DEFAULT_JWK_BYTES, &OIDCProvider::Twitch)?;
let epoch_store = authority_state.epoch_store_for_testing();
epoch_store.update_authenticator_state(&AuthenticatorStateUpdateV1 {
epoch_store.update_authenticator_state(&AuthenticatorStateUpdate {
epoch: 0,
round: 0,
new_active_jwks: jwks
Expand Down Expand Up @@ -1178,7 +1178,7 @@ async fn test_zklogin_txn_fail_if_missing_jwk() {
// Initialize an authenticator state with a Google JWK.
let jwks = parse_jwks(DEFAULT_JWK_BYTES, &OIDCProvider::Google).unwrap();
let epoch_store = authority_state.epoch_store_for_testing();
epoch_store.update_authenticator_state(&AuthenticatorStateUpdateV1 {
epoch_store.update_authenticator_state(&AuthenticatorStateUpdate {
epoch: 0,
round: 0,
new_active_jwks: jwks
Expand Down Expand Up @@ -1210,7 +1210,7 @@ async fn test_zklogin_txn_fail_if_missing_jwk() {
// Initialize an authenticator state with Twitch's kid as "nosuckkey".
pub const BAD_JWK_BYTES: &[u8] = r#"{"keys":[{"alg":"RS256","e":"AQAB","kid":"nosuchkey","kty":"RSA","n":"6lq9MQ-q6hcxr7kOUp-tHlHtdcDsVLwVIw13iXUCvuDOeCi0VSuxCCUY6UmMjy53dX00ih2E4Y4UvlrmmurK0eG26b-HMNNAvCGsVXHU3RcRhVoHDaOwHwU72j7bpHn9XbP3Q3jebX6KIfNbei2MiR0Wyb8RZHE-aZhRYO8_-k9G2GycTpvc-2GBsP8VHLUKKfAs2B6sW3q3ymU6M0L-cFXkZ9fHkn9ejs-sqZPhMJxtBPBxoUIUQFTgv4VXTSv914f_YkNw-EjuwbgwXMvpyr06EyfImxHoxsZkFYB-qBYHtaMxTnFsZBr6fn8Ha2JqT1hoP7Z5r5wxDu3GQhKkHw","use":"sig"}]}"#.as_bytes();
let jwks = parse_jwks(BAD_JWK_BYTES, &OIDCProvider::Twitch).unwrap();
epoch_store.update_authenticator_state(&AuthenticatorStateUpdateV1 {
epoch_store.update_authenticator_state(&AuthenticatorStateUpdate {
epoch: 0,
round: 0,
new_active_jwks: jwks
Expand Down Expand Up @@ -1255,7 +1255,7 @@ async fn test_zklogin_multisig() {

let jwks = parse_jwks(DEFAULT_JWK_BYTES, &OIDCProvider::Twitch).unwrap();
let epoch_store = authority_state.epoch_store_for_testing();
epoch_store.update_authenticator_state(&AuthenticatorStateUpdateV1 {
epoch_store.update_authenticator_state(&AuthenticatorStateUpdate {
epoch: 0,
round: 0,
new_active_jwks: jwks
Expand Down
14 changes: 7 additions & 7 deletions crates/iota-core/tests/staged/iota.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ Argument:
AuthenticatorStateExpire:
STRUCT:
- min_epoch: U64
- authenticator_obj_initial_shared_version:
- authenticator_object_initial_shared_version:
TYPENAME: SequenceNumber
AuthenticatorStateUpdateV1:
AuthenticatorStateUpdate:
STRUCT:
- epoch: U64
- round: U64
Expand Down Expand Up @@ -232,7 +232,7 @@ CongestedObjects:
ConsensusCommitDigest:
NEWTYPESTRUCT:
TYPENAME: Digest
ConsensusCommitPrologueV1:
ConsensusCommitPrologue:
STRUCT:
- epoch: U64
- round: U64
Expand Down Expand Up @@ -924,13 +924,13 @@ TransactionKind:
NEWTYPE:
TYPENAME: GenesisTransaction
2:
ConsensusCommitPrologueV1:
ConsensusCommitPrologue:
NEWTYPE:
TYPENAME: ConsensusCommitPrologueV1
TYPENAME: ConsensusCommitPrologue
3:
AuthenticatorStateUpdateV1:
AuthenticatorStateUpdate:
NEWTYPE:
TYPENAME: AuthenticatorStateUpdateV1
TYPENAME: AuthenticatorStateUpdate
4:
EndOfEpochTransaction:
NEWTYPE:
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-e2e-tests/tests/zklogin_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async fn test_zklogin_auth_state_creation() {
// object is not created yet.
test_cluster.wait_for_protocol_version(24.into()).await;
// Now wait until the auth state object is created, ie.
// AuthenticatorStateUpdateV1 transaction happened.
// AuthenticatorStateUpdate transaction happened.
test_cluster.wait_for_authenticator_state_update().await;
}

Expand Down Expand Up @@ -292,7 +292,7 @@ async fn test_zklogin_conflicting_jwks() {
.unwrap();
match &tx.data().intent_message().value.kind() {
TransactionKind::EndOfEpochTransaction(_) => (),
TransactionKind::AuthenticatorStateUpdateV1(update) => {
TransactionKind::AuthenticatorStateUpdate(update) => {
let jwks = &mut *jwks_clone.lock().unwrap();
for jwk in &update.new_active_jwks {
jwks.push(jwk.clone());
Expand Down
Loading
Loading