From b91a5bb310339f0ea093852fa6f3c836d90f87fd Mon Sep 17 00:00:00 2001 From: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:27:48 +0100 Subject: [PATCH 1/8] feat(iota): extend test_move_new (#3725) * feat(iota): extend test_move_new * add more file checks --- crates/iota/tests/cli_tests.rs | 50 +++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/crates/iota/tests/cli_tests.rs b/crates/iota/tests/cli_tests.rs index 542054df012..cc2ce6ec14f 100644 --- a/crates/iota/tests/cli_tests.rs +++ b/crates/iota/tests/cli_tests.rs @@ -4170,8 +4170,9 @@ async fn test_faucet() -> Result<(), anyhow::Error> { Ok(()) } -#[sim_test] +#[tokio::test] async fn test_move_new() -> Result<(), anyhow::Error> { + let current_dir = std::env::current_dir()?; let package_name = "test_move_new"; IotaCommand::Move { package_path: None, @@ -4195,7 +4196,54 @@ async fn test_move_new() -> Result<(), anyhow::Error> { for name in ["sources", "tests", "Move.toml"] { assert!(files.contains(&name.to_string())); } + assert!(std::path::Path::new(&format!("{package_name}/sources/{package_name}.move")).exists()); + assert!( + std::path::Path::new(&format!("{package_name}/tests/{package_name}_tests.move")).exists() + ); + + // Test if the generated files are valid to build a package + IotaCommand::Move { + package_path: Some(package_name.parse()?), + config: None, + build_config: move_package::BuildConfig::default(), + cmd: iota_move::Command::Build(iota_move::build::Build { + chain_id: None, + dump_bytecode_as_base64: false, + generate_struct_layouts: false, + with_unpublished_dependencies: false, + }), + } + .execute() + .await?; + + // iota_move::Command::Build changes the current dir, so we have to switch back + // here + std::env::set_current_dir(¤t_dir)?; + + IotaCommand::Move { + package_path: Some(package_name.parse()?), + config: None, + build_config: move_package::BuildConfig::default(), + cmd: iota_move::Command::Test(iota_move::unit_test::Test { + test: move_cli::base::test::Test { + compute_coverage: false, + filter: None, + gas_limit: None, + list: false, + num_threads: 1, + report_statistics: None, + verbose_mode: false, + seed: None, + rand_num_iters: None, + }, + }), + } + .execute() + .await?; + // iota_move::Command::Test changes the current dir, so we have to switch back + // here + std::env::set_current_dir(current_dir)?; std::fs::remove_dir_all(package_name)?; Ok(()) } From c4a7debaf0a7755ee4fe2e5f8113529869978d21 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Tue, 29 Oct 2024 09:45:25 +0100 Subject: [PATCH 2/8] chore(ci): reenable `check-unused-deps` (#3706) --- .github/workflows/_rust_tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/_rust_tests.yml b/.github/workflows/_rust_tests.yml index ce9f40d94c0..6abe2108be8 100644 --- a/.github/workflows/_rust_tests.yml +++ b/.github/workflows/_rust_tests.yml @@ -72,8 +72,7 @@ jobs: check-unused-deps: name: Check Unused Dependencies (${{ matrix.flags }}) - # Temporarily disabled until the nightly build bug is resolved - if: (!cancelled() && false) + if: (!cancelled()) strategy: matrix: flags: ["--all-features", "--no-default-features"] From a7391ce693d0423c3150615e76b0ea2875ef5f68 Mon Sep 17 00:00:00 2001 From: "Ching-Hua (Vivian) Lin" Date: Tue, 29 Oct 2024 17:07:54 +0800 Subject: [PATCH 3/8] fix(iota-e2e-tests): Skip apy test (#3731) --- crates/iota-e2e-tests/tests/apy_test.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/iota-e2e-tests/tests/apy_test.rs b/crates/iota-e2e-tests/tests/apy_test.rs index 1d5607226fd..63660264dfb 100644 --- a/crates/iota-e2e-tests/tests/apy_test.rs +++ b/crates/iota-e2e-tests/tests/apy_test.rs @@ -41,6 +41,7 @@ use test_cluster::TestClusterBuilder; /// calculate APY from epoch 1 and 2. Since we need epoch 0 to start staking /// anyway, and only have the stake of the pool at the expected number (a /// quarter of 3.5B IOTAs) starting from epoch 1, this is totally fine. +#[ignore = "https://github.com/iotaledger/iota/issues/3552"] #[sim_test] async fn test_apy() { // We need a large stake for low enough APY values such that they are not From 946bbad5460b363d54ef415aad22a295d14bf1ff Mon Sep 17 00:00:00 2001 From: evavirseda Date: Tue, 29 Oct 2024 10:09:52 +0100 Subject: [PATCH 4/8] feat: add autoconnect feature --- apps/wallet-dashboard/app/layout.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/wallet-dashboard/app/layout.tsx b/apps/wallet-dashboard/app/layout.tsx index dadbd552dbf..1f53a45043f 100644 --- a/apps/wallet-dashboard/app/layout.tsx +++ b/apps/wallet-dashboard/app/layout.tsx @@ -33,6 +33,7 @@ export default function RootLayout({ Date: Tue, 29 Oct 2024 11:03:02 +0100 Subject: [PATCH 5/8] chore(ts-sdk): update SDK with latest schemas (#3729) --- sdk/graphql-transport/src/generated/queries.ts | 4 ++-- sdk/graphql-transport/src/methods.ts | 1 + sdk/typescript/src/client/types/generated.ts | 9 +++++++-- .../src/graphql/generated/2024.10/schema.graphql | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sdk/graphql-transport/src/generated/queries.ts b/sdk/graphql-transport/src/generated/queries.ts index ac36d66bdf4..af75693d249 100644 --- a/sdk/graphql-transport/src/generated/queries.ts +++ b/sdk/graphql-transport/src/generated/queries.ts @@ -342,7 +342,7 @@ export type AuthenticatorStateCreateTransaction = { export type AuthenticatorStateExpireTransaction = { __typename?: 'AuthenticatorStateExpireTransaction'; - /** The initial version that the AuthenticatorStateUpdate was shared at. */ + /** The initial version that the AuthenticatorStateUpdateV1 was shared at. */ authenticatorObjInitialSharedVersion: Scalars['UInt53']['output']; /** Expire JWKs that have a lower epoch than this. */ minEpoch?: Maybe; @@ -5018,7 +5018,7 @@ export type Validator = { stakingPool?: Maybe; /** The epoch at which this pool became active. */ stakingPoolActivationEpoch?: Maybe; - /** The ID of this validator's `0x3::staking_pool::StakingPool`. */ + /** The ID of this validator's `0x3::staking_pool::StakingPoolV1`. */ stakingPoolId: Scalars['IotaAddress']['output']; /** The total number of IOTA tokens in this pool. */ stakingPoolIotaBalance?: Maybe; diff --git a/sdk/graphql-transport/src/methods.ts b/sdk/graphql-transport/src/methods.ts index 67d420b43ce..46c91c9656c 100644 --- a/sdk/graphql-transport/src/methods.ts +++ b/sdk/graphql-transport/src/methods.ts @@ -799,6 +799,7 @@ export const RPC_METHODS: { iotaTotalSupply: String(systemState.iotaTotalSupply), iotaTreasuryCapId: String(systemState.iotaTreasuryCapId), maxValidatorCount: String(systemState.systemParameters?.maxValidatorCount), + minValidatorCount: String(systemState.systemParameters?.minValidatorCount), minValidatorJoiningStake: String( systemState.systemParameters?.minValidatorJoiningStake, ), diff --git a/sdk/typescript/src/client/types/generated.ts b/sdk/typescript/src/client/types/generated.ts index a8a48b0e2a6..30bcba8d817 100644 --- a/sdk/typescript/src/client/types/generated.ts +++ b/sdk/typescript/src/client/types/generated.ts @@ -228,7 +228,7 @@ export interface EndOfEpochInfo { epochEndTimestamp: string; lastCheckpointId: string; mintedTokensAmount: string; - /** existing fields from `SystemEpochInfoEvent` (without epoch) */ + /** existing fields from `SystemEpochInfoEventV1` (without epoch) */ protocolVersion: string; referenceGasPrice: string; storageCharge: string; @@ -690,6 +690,11 @@ export interface IotaSystemStateSummary { * epoch to go above this. */ maxValidatorCount: string; + /** + * Minimum number of active validators at any moment. We do not allow the number of validators in any + * epoch to go under this. + */ + minValidatorCount: string; /** Lower-bound on the amount of stake required to become a validator. */ minValidatorJoiningStake: string; /** ID of the object that contains the list of new validators that will join at the end of the epoch. */ @@ -1479,7 +1484,7 @@ export type IotaTransactionBlockKind = } /** A transaction which updates global authenticator state */ | { epoch: string; - kind: 'AuthenticatorStateUpdate'; + kind: 'AuthenticatorStateUpdateV1'; new_active_jwks: IotaActiveJwk[]; round: string; } /** A transaction which updates global randomness state */ diff --git a/sdk/typescript/src/graphql/generated/2024.10/schema.graphql b/sdk/typescript/src/graphql/generated/2024.10/schema.graphql index fba63a69734..be787e02e22 100644 --- a/sdk/typescript/src/graphql/generated/2024.10/schema.graphql +++ b/sdk/typescript/src/graphql/generated/2024.10/schema.graphql @@ -191,7 +191,7 @@ type AuthenticatorStateExpireTransaction { """ minEpoch: Epoch """ - The initial version that the AuthenticatorStateUpdate was shared at. + The initial version that the AuthenticatorStateUpdateV1 was shared at. """ authenticatorObjInitialSharedVersion: UInt53! } @@ -4400,7 +4400,7 @@ type Validator { """ stakingPool: MoveObject @deprecated(reason: "The staking pool is a wrapped object. Access its fields directly on the `Validator` type.") """ - The ID of this validator's `0x3::staking_pool::StakingPool`. + The ID of this validator's `0x3::staking_pool::StakingPoolV1`. """ stakingPoolId: IotaAddress! """ From 5201253ac52d1e03ef65d125ab9a7e6578fb0431 Mon Sep 17 00:00:00 2001 From: evavirseda Date: Tue, 29 Oct 2024 11:07:41 +0100 Subject: [PATCH 6/8] feat: rename folder --- .../{AccountBalance => account-balance}/AccountBalance.tsx | 0 apps/wallet-dashboard/components/index.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename apps/wallet-dashboard/components/{AccountBalance => account-balance}/AccountBalance.tsx (100%) diff --git a/apps/wallet-dashboard/components/AccountBalance/AccountBalance.tsx b/apps/wallet-dashboard/components/account-balance/AccountBalance.tsx similarity index 100% rename from apps/wallet-dashboard/components/AccountBalance/AccountBalance.tsx rename to apps/wallet-dashboard/components/account-balance/AccountBalance.tsx diff --git a/apps/wallet-dashboard/components/index.ts b/apps/wallet-dashboard/components/index.ts index 92c10096966..e7f010c273f 100644 --- a/apps/wallet-dashboard/components/index.ts +++ b/apps/wallet-dashboard/components/index.ts @@ -12,7 +12,7 @@ export { default as ExternalImage } from './ExternalImage'; export { default as TransactionIcon } from './TransactionIcon'; export { default as Dropdown } from './Dropdown'; -export * from './AccountBalance/AccountBalance'; +export * from './account-balance/AccountBalance'; export * from './Coins'; export * from './Popup'; export * from './AppList'; From f5b64c5bf62690262f3976b73dc8529a638848ec Mon Sep 17 00:00:00 2001 From: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:32:20 +0100 Subject: [PATCH 7/8] feat!(iota): remove KeyToolCommand::{LoadKeypair, Unpack} (#3223) * feat!(iota): remove KeyToolCommand::LoadKeypair * Remove unused struct KeypairData * feat!(iota): remove KeyToolCommand::Unpack --------- Co-authored-by: Thibault Martinez --- crates/iota/src/keytool.rs | 73 +------------------------ docs/content/references/cli/keytool.mdx | 5 -- 2 files changed, 2 insertions(+), 76 deletions(-) diff --git a/crates/iota/src/keytool.rs b/crates/iota/src/keytool.rs index 059eccb635d..2c9eaf01877 100644 --- a/crates/iota/src/keytool.rs +++ b/crates/iota/src/keytool.rs @@ -4,8 +4,7 @@ use std::{ fmt::{Debug, Display, Formatter}, - fs, - path::{Path, PathBuf}, + path::PathBuf, sync::Arc, }; @@ -150,12 +149,6 @@ pub enum KeyToolCommand { #[clap(long, short = 's')] sort_by_alias: bool, }, - /// This reads the content at the provided file path. The accepted format - /// is a Bech32 encoded [enum IotaKeyPair] or `type AuthorityKeyPair` - /// (Base64 encoded `privkey`). This prints out the account keypair as - /// Base64 encoded `flag || privkey`, the network keypair, protocol - /// keypair, authority keypair as Base64 encoded `privkey`. - LoadKeypair { file: PathBuf }, /// To MultiSig Iota Address. Pass in a list of all public keys `flag || pk` /// in Base64. See `keytool list` for example public keys. MultiSigAddress { @@ -220,11 +213,6 @@ pub enum KeyToolCommand { #[clap(long)] base64pk: String, }, - /// This takes a bech32 encoded [enum IotaKeyPair]. It outputs the keypair - /// into a file at the current directory where the address is the - /// filename, and prints out its Iota address, Base64 encoded public - /// key, the key scheme, and the key scheme flag. - Unpack { keypair: String }, // Commented for now: https://github.com/iotaledger/iota/issues/1777 // /// Given the max_epoch, generate an OAuth url, ask user to paste the // /// redirect with id_token, call salt server, then call the prover server, @@ -356,15 +344,6 @@ pub struct ExportedKey { key: Key, } -#[derive(Serialize)] -#[serde(rename_all = "camelCase")] -pub struct KeypairData { - account_keypair: String, - network_keypair: Option, - protocol_keypair: Option, - key_scheme: String, -} - #[derive(Serialize)] #[serde(rename_all = "camelCase")] pub struct MultiSigAddress { @@ -456,7 +435,6 @@ pub enum CommandOutput { Import(Key), Export(ExportedKey), List(Vec), - LoadKeypair(KeypairData), MultiSigAddress(MultiSigAddress), MultiSigCombinePartialSig(MultiSigCombinePartialSig), Show(Key), @@ -665,44 +643,6 @@ impl KeyToolCommand { } CommandOutput::List(keys) } - KeyToolCommand::LoadKeypair { file } => { - let output = match read_keypair_from_file(&file) { - Ok(keypair) => { - // Account keypair is encoded with the key scheme flag {}, - // and network and protocol keypair are not. - let network_protocol_keypair = match &keypair { - IotaKeyPair::Ed25519(kp) => kp.encode_base64(), - IotaKeyPair::Secp256k1(kp) => kp.encode_base64(), - IotaKeyPair::Secp256r1(kp) => kp.encode_base64(), - }; - KeypairData { - account_keypair: keypair.encode_base64(), - network_keypair: Some(network_protocol_keypair.clone()), - protocol_keypair: Some(network_protocol_keypair), - key_scheme: keypair.public().scheme().to_string(), - } - } - Err(_) => { - // Authority keypair file is not stored with the flag, it will try read as - // BLS keypair.. - match read_authority_keypair_from_file(&file) { - Ok(keypair) => KeypairData { - account_keypair: keypair.encode_base64(), - network_keypair: None, - protocol_keypair: None, - key_scheme: SignatureScheme::BLS12381.to_string(), - }, - Err(e) => { - return Err(anyhow!(format!( - "Failed to read keypair at path {:?} err: {:?}", - file, e - ))); - } - } - } - }; - CommandOutput::LoadKeypair(output) - } KeyToolCommand::MultiSigAddress { threshold, pks, @@ -854,16 +794,7 @@ impl KeyToolCommand { serialized_sig_base64: serialized_sig, }) } - KeyToolCommand::Unpack { keypair } => { - let key = Key::from( - &IotaKeyPair::decode(&keypair) - .map_err(|_| anyhow!("Invalid Bech32 encoded keypair"))?, - ); - let path_str = format!("{}.key", key.iota_address).to_lowercase(); - let path = Path::new(&path_str); - fs::write(path, keypair)?; - CommandOutput::Show(key) - } /* Commented for now: https://github.com/iotaledger/iota/issues/1777 + /* Commented for now: https://github.com/iotaledger/iota/issues/1777 * KeyToolCommand::ZkLoginInsecureSignPersonalMessage { data, max_epoch } => { * let msg = PersonalMessage { * message: data.as_bytes().to_vec(), diff --git a/docs/content/references/cli/keytool.mdx b/docs/content/references/cli/keytool.mdx index f9ab9bcddc2..77a4581fe3b 100644 --- a/docs/content/references/cli/keytool.mdx +++ b/docs/content/references/cli/keytool.mdx @@ -29,9 +29,6 @@ Commands: provided, the tool will automatically generate one export Output the private key of the given key identity in Iota CLI Keystore as Bech32 encoded string starting with `iotaprivkey` list List all keys by its Iota address, Base64 encoded public key, key scheme name in iota.keystore - load-keypair This reads the content at the provided file path. The accepted format can be [enum IotaKeyPair] (Base64 encoded of 33-byte `flag || privkey`) or `type - AuthorityKeyPair` (Base64 encoded `privkey`). This prints out the account keypair as Base64 encoded `flag || privkey`, the network keypair, protocol keypair, - authority keypair as Base64 encoded `privkey` multi-sig-address To MultiSig Iota Address. Pass in a list of all public keys `flag || pk` in Base64. See `keytool list` for example public keys multi-sig-combine-partial-sig Provides a list of participating signatures (`flag || sig || pk` encoded in Base64), threshold, a list of all public keys and a list of their weights that define the MultiSig address. Returns a valid MultiSig signature and its sender address. The result can be used as signature field for `iota client @@ -43,8 +40,6 @@ Commands: sign-kms Creates a signature by leveraging AWS KMS. Pass in a key-id to leverage Amazon KMS to sign a message and the base64 pubkey. Generate PubKey from pem using iotaledger/base64pemkey Any signature commits to a [struct IntentMessage] consisting of the Base64 encoded of the BCS serialized transaction bytes itself and its intent. If intent is absent, default will be used - unpack This takes [enum IotaKeyPair] of Base64 encoded of 33-byte `flag || privkey`). It outputs the keypair into a file at the current directory where the address is - the filename, and prints out its Iota address, Base64 encoded public key, the key scheme, and the key scheme flag help Print this message or the help of the given subcommand(s) Options: From e9e11d54c49a6a826479e394f51e0dc36f9d01f1 Mon Sep 17 00:00:00 2001 From: evavirseda Date: Tue, 29 Oct 2024 11:50:06 +0100 Subject: [PATCH 8/8] feat: add missing styles --- apps/wallet-dashboard/app/globals.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/wallet-dashboard/app/globals.css b/apps/wallet-dashboard/app/globals.css index bdce5ab50b6..a5cf2ad80f6 100644 --- a/apps/wallet-dashboard/app/globals.css +++ b/apps/wallet-dashboard/app/globals.css @@ -1,3 +1,5 @@ +@import '@iota/apps-ui-kit/styles'; + @tailwind base; @tailwind components; @tailwind utilities;