Skip to content

Commit

Permalink
[move] Update commit hash (cherry-pick aptos-labs#5074) (aptos-labs#…
Browse files Browse the repository at this point in the history
…5076)

* [move] Update commit hash (cherry-pick aptos-labs#5074)

This updates the commit hash from the  `aptos` branch in the Move repo, taking the following PRs:

- aptos-labs#586 which fixes a bug in the reference_safety anaylsis (main objective)
- aptos-labs#571, a trivial PR which removes an unnecessary debug assert (side effect but save)
- aptos-labs#573, a trivial PR which fixes a bug in the instantiation loop checker (side effect but save)

 Please enter the commit message for your changes. Lines starting

* [fixup] Out-of-date sdk builder stuff
  • Loading branch information
wrwg authored Oct 16, 2022
1 parent 30767eb commit 163b335
Show file tree
Hide file tree
Showing 23 changed files with 214 additions and 134 deletions.
78 changes: 39 additions & 39 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ aptos-vm = { path = "../aptos-move/aptos-vm" }

storage-interface = { path = "../storage/storage-interface" }

move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["address32"] }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["address32"] }

[dev-dependencies]
aptos-api-test-context = { path = "./test-context", package = "aptos-api-test-context" }
Expand All @@ -57,7 +57,7 @@ regex = "1.5.5"
reqwest = { version = "0.11.10", features = ["blocking", "json"], default_features = false }
warp = { version = "0.3.2", features = ["default"] }

move-package = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-package = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

[features]
failpoints = ["fail/failpoints"]
6 changes: 3 additions & 3 deletions api/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ aptos-vm = { path = "../../aptos-move/aptos-vm" }

storage-interface = { path = "../../storage/storage-interface" }

move-binary-format = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["address32"] }
move-resource-viewer = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-binary-format = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["address32"] }
move-resource-viewer = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
6 changes: 3 additions & 3 deletions aptos-move/aptos-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ smallvec = "1.8.0"
aptos-crypto = { path = "../../crates/aptos-crypto" }
aptos-state-view = { path = "../../storage/state-view" }
aptos-types = { path = "../../types" }
move-binary-format = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-binary-format = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["address32"] }
move-table-extension = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["address32"] }
move-table-extension = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

[dev-dependencies]
claims = "0.7"
Expand Down
12 changes: 6 additions & 6 deletions aptos-move/aptos-gas/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ anyhow = "1.0.57"
bcs = { git = "https://github.com/aptos-labs/bcs", rev = "2cde3e8446c460cb17b0c1d6bac7e27e964ac169" }
clap = { version = "3.1.17", features = ["derive"] }

move-binary-format = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-model = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-stdlib = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-table-extension = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-vm-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-binary-format = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-model = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-stdlib = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-table-extension = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-vm-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

aptos-global-constants = { path = "../../config/global-constants" }
aptos-types = { path = "../../types" }
Expand Down
4 changes: 2 additions & 2 deletions aptos-move/aptos-module-verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ publish = false
edition = "2021"

[dependencies]
move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["address32"] }
move-binary-format = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["address32"] }
move-binary-format = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
2 changes: 1 addition & 1 deletion aptos-move/aptos-sdk-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ textwrap = "0.15.0"

aptos-types = { path = "../../types" }

move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["address32"] }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["address32"] }

[dev-dependencies]
cached-packages = { path = "../../aptos-move/framework/cached-packages" }
Expand Down
22 changes: 11 additions & 11 deletions aptos-move/aptos-vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ aptos-state-view = { path = "../../storage/state-view" }
aptos-types = { path = "../../types" }

framework = { path = "../framework" }
move-binary-format = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-bytecode-utils = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-bytecode-verifier = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["address32"] }
move-stdlib = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-binary-format = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-bytecode-utils = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-bytecode-verifier = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["address32"] }
move-stdlib = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
mvhashmap = { path = "../mvhashmap" }

move-table-extension = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-vm-runtime = { git = "https://github.com/move-language/move", features = ["lazy_natives"], rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-vm-test-utils = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["table-extension"] }
move-vm-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
read-write-set-dynamic = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-table-extension = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-vm-runtime = { git = "https://github.com/move-language/move", features = ["lazy_natives"], rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-vm-test-utils = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["table-extension"] }
move-vm-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
read-write-set-dynamic = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

move-unit-test = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["table-extension"], optional = true }
move-unit-test = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["table-extension"], optional = true }

[dev-dependencies]
proptest = "1.0.0"
Expand Down
24 changes: 12 additions & 12 deletions aptos-move/framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,26 @@ aptos-sdk-builder = { path = "../aptos-sdk-builder" }
aptos-state-view = { path = "../../storage/state-view" }
aptos-types = { path = "../../types" }
gas-algebra-ext = { path = "../gas-algebra-ext" }
move-binary-format = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-binary-format = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

move-command-line-common = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-compiler ={ git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-core-types ={ git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["address32"] }
move-model ={ git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-package ={ git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-table-extension ={ git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-vm-runtime ={ git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-vm-types ={ git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-command-line-common = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-compiler ={ git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-core-types ={ git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["address32"] }
move-model ={ git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-package ={ git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-table-extension ={ git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-vm-runtime ={ git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-vm-types ={ git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

[dev-dependencies]
claims = "0.7"

aptos-gas = { path = "../../aptos-move/aptos-gas" }
aptos-vm = { path = "../../aptos-move/aptos-vm", features = ["testing"] }
move-cli = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-prover = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-cli = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
move-prover = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

move-unit-test = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-unit-test = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion aptos-move/framework/cached-packages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ proptest = { version = "1.0.0", optional = true }
proptest-derive = { version = "0.3.0", optional = true }
tempfile = "3.3.0"

move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc", features = ["address32"] }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e", features = ["address32"] }

[build-dependencies]
framework = { path = ".." }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@ pub enum EntryFunctionCall {
/// Offers signer capability on behalf of `account` to the account at address `recipient_address`.
/// An account can delegate its signer capability to only one other address at one time.
/// `signer_capability_key_bytes` is the `SignerCapabilityOfferProofChallengeV2` signed by the account owner's key
/// `account_scheme` is the scheme of the account (ed25519 or multi_ed25519)
/// `account_public_key_bytes` is the public key of the account owner
/// `account_scheme` is the scheme of the account (ed25519 or multi_ed25519).
/// `account_public_key_bytes` is the public key of the account owner.
/// `recipient_address` is the address of the recipient of the signer capability - note that if there's an existing
/// `recipient_address` in the account owner's `SignerCapabilityOffer`, this will replace the
/// previous `recipient_address` upon successful verification (the previous recipient will no longer have access
/// to the account owner's signer capability)
/// to the account owner's signer capability).
AccountOfferSignerCapability {
signer_capability_sig_bytes: Vec<u8>,
account_scheme: u8,
account_public_key_bytes: Vec<u8>,
recipient_address: AccountAddress,
},

/// Revoke the account owner's signer capability offer for `to_be_revoked_address` (i.e., the address that
/// has a signer capability offer from `account` but will be revoked in this function).
AccountRevokeSignerCapability {
to_be_revoked_address: AccountAddress,
},
Expand Down Expand Up @@ -742,12 +744,12 @@ impl EntryFunctionCall {
/// Offers signer capability on behalf of `account` to the account at address `recipient_address`.
/// An account can delegate its signer capability to only one other address at one time.
/// `signer_capability_key_bytes` is the `SignerCapabilityOfferProofChallengeV2` signed by the account owner's key
/// `account_scheme` is the scheme of the account (ed25519 or multi_ed25519)
/// `account_public_key_bytes` is the public key of the account owner
/// `account_scheme` is the scheme of the account (ed25519 or multi_ed25519).
/// `account_public_key_bytes` is the public key of the account owner.
/// `recipient_address` is the address of the recipient of the signer capability - note that if there's an existing
/// `recipient_address` in the account owner's `SignerCapabilityOffer`, this will replace the
/// previous `recipient_address` upon successful verification (the previous recipient will no longer have access
/// to the account owner's signer capability)
/// to the account owner's signer capability).
pub fn account_offer_signer_capability(
signer_capability_sig_bytes: Vec<u8>,
account_scheme: u8,
Expand All @@ -773,6 +775,8 @@ pub fn account_offer_signer_capability(
))
}

/// Revoke the account owner's signer capability offer for `to_be_revoked_address` (i.e., the address that
/// has a signer capability offer from `account` but will be revoked in this function).
pub fn account_revoke_signer_capability(
to_be_revoked_address: AccountAddress,
) -> TransactionPayload {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ pub enum EntryFunctionCall {
opt_in: bool,
},

/// Transfers `amount` of tokens from `from` to `to`.
/// The receiver `to` has to opt-in direct transfer first
TokenTransferWithOptIn {
creator: AccountAddress,
collection_name: Vec<u8>,
token_name: Vec<u8>,
token_property_version: u64,
to: AccountAddress,
amount: u64,
},

/// Token owner lists their token for swapping
TokenCoinSwapListTokenForSwap {
coin_type: TypeTag,
Expand Down Expand Up @@ -251,6 +262,21 @@ impl EntryFunctionCall {
types,
),
TokenOptInDirectTransfer { opt_in } => token_opt_in_direct_transfer(opt_in),
TokenTransferWithOptIn {
creator,
collection_name,
token_name,
token_property_version,
to,
amount,
} => token_transfer_with_opt_in(
creator,
collection_name,
token_name,
token_property_version,
to,
amount,
),
TokenCoinSwapListTokenForSwap {
coin_type,
_creators_address,
Expand Down Expand Up @@ -575,6 +601,37 @@ pub fn token_opt_in_direct_transfer(opt_in: bool) -> TransactionPayload {
))
}

/// Transfers `amount` of tokens from `from` to `to`.
/// The receiver `to` has to opt-in direct transfer first
pub fn token_transfer_with_opt_in(
creator: AccountAddress,
collection_name: Vec<u8>,
token_name: Vec<u8>,
token_property_version: u64,
to: AccountAddress,
amount: u64,
) -> TransactionPayload {
TransactionPayload::EntryFunction(EntryFunction::new(
ModuleId::new(
AccountAddress::new([
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 3,
]),
ident_str!("token").to_owned(),
),
ident_str!("transfer_with_opt_in").to_owned(),
vec![],
vec![
bcs::to_bytes(&creator).unwrap(),
bcs::to_bytes(&collection_name).unwrap(),
bcs::to_bytes(&token_name).unwrap(),
bcs::to_bytes(&token_property_version).unwrap(),
bcs::to_bytes(&to).unwrap(),
bcs::to_bytes(&amount).unwrap(),
],
))
}

/// Token owner lists their token for swapping
pub fn token_coin_swap_list_token_for_swap(
coin_type: TypeTag,
Expand Down Expand Up @@ -825,6 +882,21 @@ mod decoder {
}
}

pub fn token_transfer_with_opt_in(payload: &TransactionPayload) -> Option<EntryFunctionCall> {
if let TransactionPayload::EntryFunction(script) = payload {
Some(EntryFunctionCall::TokenTransferWithOptIn {
creator: bcs::from_bytes(script.args().get(0)?).ok()?,
collection_name: bcs::from_bytes(script.args().get(1)?).ok()?,
token_name: bcs::from_bytes(script.args().get(2)?).ok()?,
token_property_version: bcs::from_bytes(script.args().get(3)?).ok()?,
to: bcs::from_bytes(script.args().get(4)?).ok()?,
amount: bcs::from_bytes(script.args().get(5)?).ok()?,
})
} else {
None
}
}

pub fn token_coin_swap_list_token_for_swap(
payload: &TransactionPayload,
) -> Option<EntryFunctionCall> {
Expand Down Expand Up @@ -935,6 +1007,10 @@ static SCRIPT_FUNCTION_DECODER_MAP: once_cell::sync::Lazy<EntryFunctionDecoderMa
"token_opt_in_direct_transfer".to_string(),
Box::new(decoder::token_opt_in_direct_transfer),
);
map.insert(
"token_transfer_with_opt_in".to_string(),
Box::new(decoder::token_transfer_with_opt_in),
);
map.insert(
"token_coin_swap_list_token_for_swap".to_string(),
Box::new(decoder::token_coin_swap_list_token_for_swap),
Expand Down
2 changes: 1 addition & 1 deletion aptos-move/gas-algebra-ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
move-core-types = { git = "https://github.com/move-language/move", rev = "b71fba7ba74656334db952bcb4031e787d3928bc" }
move-core-types = { git = "https://github.com/move-language/move", rev = "6a32284d6e04ea5bfa5919df9aac2ccb3ffa010e" }
Loading

0 comments on commit 163b335

Please sign in to comment.