Skip to content

Commit

Permalink
framework release & clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Jan 21, 2025
1 parent 837189e commit 976096f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
10 changes: 7 additions & 3 deletions framework/cached-packages/src/libra_framework_sdk_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ pub enum EntryFunctionCall {

/// Generic authentication key rotation function that allows the user to rotate their authentication key from any scheme to any scheme.
/// To authorize the rotation, we need two signatures:
/// - the first signature `cap_rotate_key` refers to the signature by the account owner's current key on a valid `RotationProofChallenge`,demonstrating that the user intends to and has the capability to rotate the authentication key of this account;
/// - the first signature `cap_rotate_key` refers to the signature by the account owner's current key on a valid `RotationProofChallenge`,
/// demonstrating that the user intends to and has the capability to rotate the authentication key of this account;
/// - the second signature `cap_update_table` refers to the signature by the new key (that the account owner wants to rotate to) on a
/// valid `RotationProofChallenge`, demonstrating that the user owns the new private key, and has the authority to update the
/// `OriginatingAddress` map with the new address mapping `<new_address, originating_address>`.
Expand Down Expand Up @@ -1062,11 +1063,14 @@ pub fn account_revoke_signer_capability(
/// `OriginatingAddress` map with the new address mapping `<new_address, originating_address>`.
/// To verify these two signatures, we need their corresponding public key and public key scheme: we use `from_scheme` and `from_public_key_bytes`
/// to verify `cap_rotate_key`, and `to_scheme` and `to_public_key_bytes` to verify `cap_update_table`.
/// A scheme of 0 refers to an Ed25519 key and a scheme of 1 refers to Multi-Ed25519 keys. `originating address` refers to an account's original/first address.
/// A scheme of 0 refers to an Ed25519 key and a scheme of 1 refers to Multi-Ed25519 keys.
/// `originating address` refers to an account's original/first address.
///
/// Here is an example attack if we don't ask for the second signature `cap_update_table`:
/// Alice has rotated her account `addr_a` to `new_addr_a`. As a result, the following entry is created, to help Alice when recovering her wallet:
/// `OriginatingAddress[new_addr_a]` -> `addr_a`
/// Alice has had bad day: her laptop blew up and she needs to reset her account on a new one. (Fortunately, she still has her secret key `new_sk_a` associated with her new address `new_addr_a`, so she can do this.)
/// Alice has had bad day: her laptop blew up and she needs to reset her account on a new one.
/// (Fortunately, she still has her secret key `new_sk_a` associated with her new address `new_addr_a`, so she can do this.)
///
/// But Bob likes to mess with Alice.
/// Bob creates an account `addr_b` and maliciously rotates it to Alice's new address `new_addr_a`. Since we are no longer checking a PoK,
Expand Down
Binary file modified framework/releases/head.mrb
Binary file not shown.
8 changes: 1 addition & 7 deletions tools/query/src/chain_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ use libra_types::type_extensions::client_ext::entry_function_id;

/// Retrieves the current epoch from the blockchain.
pub async fn get_epoch(client: &Client) -> anyhow::Result<u64> {
let res = get_view(
client,
"0x1::epoch_helper::get_current_epoch",
None,
None,
)
.await?;
let res = get_view(client, "0x1::epoch_helper::get_current_epoch", None, None).await?;

let value: Vec<String> = serde_json::from_value(res)?;
let num = value.first().unwrap().parse::<u64>()?;
Expand Down

0 comments on commit 976096f

Please sign in to comment.