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

[DO NOT MERGE] feat(external-crates): update from the mainnet-v1.39.4 upstream version #4559

Open
wants to merge 5 commits into
base: sc-platform/issue-4534-check-and-pull-upstream-changes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 30 additions & 1 deletion Cargo.lock

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

21 changes: 13 additions & 8 deletions crates/iota-core/src/unit_tests/authority_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use std::{collections::HashSet, convert::TryInto, env, fs};
use std::{collections::HashSet, convert::TryInto, env, fs, str::FromStr};

use bcs;
use fastcrypto::traits::KeyPair;
Expand Down Expand Up @@ -47,7 +47,6 @@ use move_core_types::{
ident_str,
identifier::{IdentStr, Identifier},
language_storage::{StructTag, TypeTag},
parser::parse_type_tag,
};
use rand::{
Rng, SeedableRng,
Expand Down Expand Up @@ -3676,7 +3675,7 @@ async fn test_dynamic_field_struct_name_parsing() {
assert!(matches!(fields[0].type_, DynamicFieldType::DynamicField));
assert_eq!(json!({"name_str": "Test Name"}), fields[0].name.value);
assert_eq!(
parse_type_tag("0x0::object_basics::Name").unwrap(),
TypeTag::from_str("0x0::object_basics::Name").unwrap(),
fields[0].name.type_
)
}
Expand All @@ -3688,7 +3687,10 @@ async fn test_dynamic_field_bytearray_name_parsing() {

assert_eq!(fields.len(), 1);
assert!(matches!(fields[0].type_, DynamicFieldType::DynamicField));
assert_eq!(parse_type_tag("vector<u8>").unwrap(), fields[0].name.type_);
assert_eq!(
TypeTag::from_str("vector<u8>").unwrap(),
fields[0].name.type_
);
assert_eq!(json!("Test Name".as_bytes()), fields[0].name.value);
}

Expand All @@ -3699,7 +3701,7 @@ async fn test_dynamic_field_address_name_parsing() {

assert_eq!(fields.len(), 1);
assert!(matches!(fields[0].type_, DynamicFieldType::DynamicField));
assert_eq!(parse_type_tag("address").unwrap(), fields[0].name.type_);
assert_eq!(TypeTag::from_str("address").unwrap(), fields[0].name.type_);
assert_eq!(json!(sender), fields[0].name.value);
}

Expand All @@ -3711,7 +3713,7 @@ async fn test_dynamic_object_field_struct_name_parsing() {
assert!(matches!(fields[0].type_, DynamicFieldType::DynamicObject));
assert_eq!(json!({"name_str": "Test Name"}), fields[0].name.value);
assert_eq!(
parse_type_tag("0x0::object_basics::Name").unwrap(),
TypeTag::from_str("0x0::object_basics::Name").unwrap(),
fields[0].name.type_
)
}
Expand All @@ -3723,7 +3725,10 @@ async fn test_dynamic_object_field_bytearray_name_parsing() {

assert_eq!(fields.len(), 1);
assert!(matches!(fields[0].type_, DynamicFieldType::DynamicObject));
assert_eq!(parse_type_tag("vector<u8>").unwrap(), fields[0].name.type_);
assert_eq!(
TypeTag::from_str("vector<u8>").unwrap(),
fields[0].name.type_
);
assert_eq!(json!("Test Name".as_bytes()), fields[0].name.value);
}

Expand All @@ -3734,7 +3739,7 @@ async fn test_dynamic_object_field_address_name_parsing() {

assert_eq!(fields.len(), 1);
assert!(matches!(fields[0].type_, DynamicFieldType::DynamicObject));
assert_eq!(parse_type_tag("address").unwrap(), fields[0].name.type_);
assert_eq!(TypeTag::from_str("address").unwrap(), fields[0].name.type_);
assert_eq!(json!(sender), fields[0].name.value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ async fn test_manage_package_update() {
# @generated by Move, please check-in and do not edit manually.

[move]
version = 2
version = 3
manifest_digest = "919A5B078B47AD46674F36E1605578927D5BC4536A7646D78D1320A25DDD57CC"
deps_digest = "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855"

[move.toolchain-version]
compiler-version = "0.0.1"
edition = "2024.beta"
edition = "2024"
flavor = "iota"

[env]
Expand Down
16 changes: 8 additions & 8 deletions crates/iota-core/src/unit_tests/move_package_publish_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,32 +205,32 @@ async fn test_generate_lock_file() {
# @generated by Move, please check-in and do not edit manually.

[move]
version = 2
version = 3
manifest_digest = "78ED00C216B5A73463BD935B7AD1AB6CAF8ECA9ACD7FFCC19F3462EBD1D83EC3"
deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600"
dependencies = [
{ name = "Examples" },
{ name = "Iota" },
{ id = "Examples", name = "Examples" },
{ id = "Iota", name = "Iota" },
]

[[move.package]]
name = "Examples"
id = "Examples"
source = { local = "../object_basics" }

dependencies = [
{ name = "Iota" },
{ id = "Iota", name = "Iota" },
]

[[move.package]]
name = "Iota"
id = "Iota"
source = { local = "../../../../../iota-framework/packages/iota-framework" }

dependencies = [
{ name = "MoveStdlib" },
{ id = "MoveStdlib", name = "MoveStdlib" },
]

[[move.package]]
name = "MoveStdlib"
id = "MoveStdlib"
source = { local = "../../../../../iota-framework/packages/move-stdlib" }

[move.toolchain-version]
Expand Down
14 changes: 8 additions & 6 deletions crates/iota-core/src/unit_tests/subscription_handler_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,23 @@ impl TestEvent {
fn layout() -> MoveStructLayout {
MoveStructLayout {
type_: Self::type_(),
fields: vec![
fields: Box::new(vec![
MoveFieldLayout::new(ident_str!("creator").to_owned(), MoveTypeLayout::Address),
MoveFieldLayout::new(
ident_str!("name").to_owned(),
MoveTypeLayout::Struct(UTF8String::layout()),
MoveTypeLayout::Struct(Box::new(UTF8String::layout())),
),
MoveFieldLayout::new(
ident_str!("data").to_owned(),
MoveTypeLayout::Vector(Box::new(MoveTypeLayout::U64)),
),
MoveFieldLayout::new(
ident_str!("coins").to_owned(),
MoveTypeLayout::Vector(Box::new(MoveTypeLayout::Struct(GasCoin::layout()))),
MoveTypeLayout::Vector(Box::new(MoveTypeLayout::Struct(Box::new(
GasCoin::layout(),
)))),
),
],
]),
}
}
}
Expand Down Expand Up @@ -128,10 +130,10 @@ impl UTF8String {
fn layout() -> MoveStructLayout {
MoveStructLayout {
type_: Self::type_(),
fields: vec![MoveFieldLayout::new(
fields: Box::new(vec![MoveFieldLayout::new(
ident_str!("bytes").to_owned(),
MoveTypeLayout::Vector(Box::new(MoveTypeLayout::U8)),
)],
)]),
}
}
}
Binary file modified crates/iota-framework/packages_compiled/bridge
Binary file not shown.
Binary file modified crates/iota-framework/packages_compiled/iota-framework
Binary file not shown.
Binary file modified crates/iota-framework/packages_compiled/iota-system
Binary file not shown.
Binary file modified crates/iota-framework/packages_compiled/move-stdlib
Binary file not shown.
23 changes: 2 additions & 21 deletions crates/iota-framework/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ use iota_types::{
storage::ObjectStore,
};
use move_binary_format::{
CompiledModule,
binary_config::BinaryConfig,
compatibility::Compatibility,
file_format::{Ability, AbilitySet},
CompiledModule, binary_config::BinaryConfig, compatibility::Compatibility,
};
use move_core_types::gas_algebra::InternalGas;
use once_cell::sync::Lazy;
Expand Down Expand Up @@ -222,23 +219,7 @@ pub async fn compare_system_package<S: ObjectStore>(
return Some(cur_ref);
}

let compatibility = Compatibility {
check_datatype_and_pub_function_linking: true,
check_datatype_layout: true,
check_friend_linking: false,
// Checking `entry` linkage is required because system packages are updated in-place, and a
// transaction that was rolled back to make way for reconfiguration should still be runnable
// after a reconfiguration that upgraded the framework.
//
// A transaction that calls a system function that was previously `entry` and is now private
// will fail because its entrypoint became no longer callable. A transaction that calls a
// system function that was previously `public entry` and is now just `public` could also
// fail if one of its mutable inputs was being used in another private `entry` function.
check_private_entry_linking: true,
disallowed_new_abilities: AbilitySet::singleton(Ability::Key),
disallow_change_datatype_type_params: true,
disallow_new_variants: true,
};
let compatibility = Compatibility::framework_upgrade_check();

let new_pkg = new_object
.data
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-graphql-e2e-tests/tests/packages/modules.exp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Response: {
},
"fileFormatVersion": 6,
"bytes": "oRzrCwYAAAAIAQAGAgYKAxARBCEEBSUfB0QkCGhADKgBMAAGAQMBBQEADAEAAQIBAgAABAABAQIAAgIBAAEHBQEBAAIEAAYCAwYLAAEJAAEDAQYLAAEIAQABCQABBgsAAQkAAQgBBENvaW4ESU9UQQNiYXIEY29pbgNmb28EaW90YQFtBXZhbHVlOjkcKUU8LgevHrC+/VC5A/DMFgnfiCbhp50+Hs6rZIEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgABAAADBQsBOAALABYCAQEAAAMIBioAAAAAAAAACgA4AQYrAAAAAAAAAAsAOAEYAgA=",
"disassembly": "// Move bytecode v6\nmodule 3a391c29453c2e07af1eb0befd50b903f0cc1609df8826e1a79d3e1eceab6481.m {\nuse 0000000000000000000000000000000000000000000000000000000000000002::coin;\nuse 0000000000000000000000000000000000000000000000000000000000000002::iota;\n\n\n\n\n\n\npublic foo<Ty0: drop>(Arg0: u64, Arg1: &Coin<Ty0>): u64 {\nB0:\n\t0: MoveLoc[1](Arg1: &Coin<Ty0>)\n\t1: Call coin::value<Ty0>(&Coin<Ty0>): u64\n\t2: MoveLoc[0](Arg0: u64)\n\t3: Add\n\t4: Ret\n\n}\npublic bar(Arg0: &Coin<IOTA>): u64 {\nB0:\n\t0: LdU64(42)\n\t1: CopyLoc[0](Arg0: &Coin<IOTA>)\n\t2: Call foo<IOTA>(u64, &Coin<IOTA>): u64\n\t3: LdU64(43)\n\t4: MoveLoc[0](Arg0: &Coin<IOTA>)\n\t5: Call foo<IOTA>(u64, &Coin<IOTA>): u64\n\t6: Mul\n\t7: Ret\n\n}\n}"
"disassembly": "// Move bytecode v6\nmodule 3a391c29453c2e07af1eb0befd50b903f0cc1609df8826e1a79d3e1eceab6481.m {\nuse 0000000000000000000000000000000000000000000000000000000000000002::coin;\nuse 0000000000000000000000000000000000000000000000000000000000000002::iota;\n\npublic foo<Ty0: drop>(Arg0: u64, Arg1: &Coin<Ty0>): u64 {\nB0:\n\t0: MoveLoc[1](Arg1: &Coin<Ty0>)\n\t1: Call coin::value<Ty0>(&Coin<Ty0>): u64\n\t2: MoveLoc[0](Arg0: u64)\n\t3: Add\n\t4: Ret\n}\n\npublic bar(Arg0: &Coin<IOTA>): u64 {\nB0:\n\t0: LdU64(42)\n\t1: CopyLoc[0](Arg0: &Coin<IOTA>)\n\t2: Call foo<IOTA>(u64, &Coin<IOTA>): u64\n\t3: LdU64(43)\n\t4: MoveLoc[0](Arg0: &Coin<IOTA>)\n\t5: Call foo<IOTA>(u64, &Coin<IOTA>): u64\n\t6: Mul\n\t7: Ret\n}\n\n}\n"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-graphql-e2e-tests/tests/packages/types.exp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Response: {
"data": null,
"errors": [
{
"message": "Bad type: unexpected token Name(\"not_a_type\"), expected type tag",
"message": "Bad type: unexpected end of tokens",
"locations": [
{
"line": 3,
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-graphql-rpc/src/types/move_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ impl TryFrom<A::MoveTypeLayout> for MoveTypeLayout {
TL::Address => Self::Address,

TL::Vector(v) => Self::Vector(Box::new(Self::try_from(*v)?)),
TL::Struct(s) => Self::Struct(s.try_into()?),
TL::Enum(e) => Self::Enum(e.try_into()?),
TL::Struct(s) => Self::Struct((*s).try_into()?),
TL::Enum(e) => Self::Enum((*e).try_into()?),
})
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/iota-graphql-rpc/src/types/move_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,13 @@ mod tests {

macro_rules! struct_layout {
($type:literal { $($name:literal : $layout:expr),* $(,)?}) => {
A::MoveTypeLayout::Struct(S {
A::MoveTypeLayout::Struct(Box::new(S {
type_: StructTag::from_str($type).expect("Failed to parse struct"),
fields: vec![$(MoveFieldLayout {
fields: Box::new(vec![$(MoveFieldLayout {
name: ident_str!($name).to_owned(),
layout: $layout,
}),*]
})
}),*])
}))
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-indexer/src/handlers/checkpoint_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ async fn get_move_struct_layout_map(
move_core_types::annotated_value::MoveStructLayout,
),
IndexerError,
>((struct_tag, move_struct_layout))
>((struct_tag, *move_struct_layout))
}
})
.collect::<Vec<_>>();
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-indexer/src/models/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl StoredObject {
)),
}?;

Ok(ObjectRead::Exists(oref, object, Some(move_struct_layout)))
Ok(ObjectRead::Exists(oref, object, Some(*move_struct_layout)))
}

pub async fn try_into_expectant_dynamic_field_info(
Expand Down
Loading
Loading