Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqvq committed Jun 21, 2024
1 parent 3b0a5ca commit 9b4a626
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 22 deletions.
147 changes: 144 additions & 3 deletions Cargo.lock

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

8 changes: 0 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -564,21 +564,13 @@ move-abstract-interpreter = { path = "external-crates/move/crates/move-abstract-
move-abstract-stack = { path = "external-crates/move/crates/move-abstract-stack" }
move-analyzer = { path = "external-crates/move/crates/move-analyzer" }

<<<<<<< HEAD
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "55e7e568842939e01c8545a71d72e2402ad74538" }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "55e7e568842939e01c8545a71d72e2402ad74538" }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "55e7e568842939e01c8545a71d72e2402ad74538", package = "fastcrypto-zkp" }
fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "55e7e568842939e01c8545a71d72e2402ad74538", features = ["experimental"] }
=======
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "8435ec2f308cb6c345e2737ae929d170589d9508" }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "8435ec2f308cb6c345e2737ae929d170589d9508" }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "8435ec2f308cb6c345e2737ae929d170589d9508", package = "fastcrypto-zkp" }
fastcrypto-vdf = { git = "https://github.com/MystenLabs/fastcrypto", rev = "8435ec2f308cb6c345e2737ae929d170589d9508", features = ["experimental"] }

passkey = "0.2.0"
coset = "0.3"
p256 = { version = "0.13.2", features = ["ecdsa"] }
>>>>>>> bf057e4e41 (serde checks, added tests)

# anemo dependencies
anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "26d415eb9aa6a2417be3c03c57d6e93c30bd1ad7" }
Expand Down
11 changes: 3 additions & 8 deletions crates/sui-protocol-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,8 @@ const MAX_PROTOCOL_VERSION: u64 = 51;
// Enable checkpoint batching in testnet.
// Prepose consensus commit prologue in checkpoints.
// Set number of leaders per round for Mysticeti commits.
<<<<<<< HEAD
// Version 51: Switch to DKG V1.
=======
// Add support for passkey in devnet.
>>>>>>> 6cf3d4ca72 (add protocol config, simtest)

#[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub struct ProtocolVersion(u64);

Expand Down Expand Up @@ -2427,13 +2423,12 @@ impl ProtocolConfig {

// Set max transaction deferral to 10 consensus rounds.
cfg.max_deferral_rounds_for_congestion_control = Some(10);

if chain != Chain::Testnet && chain != Chain::Mainnet {
cfg.feature_flags.passkey_auth = true;
}
}
51 => {
cfg.random_beacon_dkg_version = Some(1);
if chain != Chain::Testnet && chain != Chain::Mainnet {
cfg.feature_flags.passkey_auth = true;
}
}
// Use this template when making changes:
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ feature_flags:
fresh_vm_on_framework_upgrade: true
prepend_prologue_tx_in_consensus_commit_in_checkpoints: true
mysticeti_num_leaders_per_round: 1
passkey_auth: true
max_tx_size_bytes: 131072
max_input_objects: 2048
max_size_written_objects: 5000000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ feature_flags:
fresh_vm_on_framework_upgrade: true
prepend_prologue_tx_in_consensus_commit_in_checkpoints: true
mysticeti_num_leaders_per_round: 1
passkey_auth: true
max_tx_size_bytes: 131072
max_input_objects: 2048
max_size_written_objects: 5000000
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-types/src/passkey_authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl Serialize for PasskeyAuthenticator {
let mut bytes = Vec::with_capacity(Secp256r1SuiSignature::LENGTH);
bytes.push(SignatureScheme::Secp256r1.flag());
bytes.extend_from_slice(self.signature.as_ref());
bytes.extend_from_slice(&self.pk.as_ref());
bytes.extend_from_slice(self.pk.as_ref());

let raw = RawPasskeyAuthenticator {
authenticator_data: self.authenticator_data.clone(),
Expand Down Expand Up @@ -296,7 +296,7 @@ pub fn to_signing_digest<T: Serialize>(
) -> [u8; INTENT_PREFIX_LENGTH + DefaultHash::OUTPUT_SIZE] {
let mut extended = [0; INTENT_PREFIX_LENGTH + DefaultHash::OUTPUT_SIZE];
extended[..INTENT_PREFIX_LENGTH].copy_from_slice(&intent_msg.intent.to_bytes());
extended[INTENT_PREFIX_LENGTH..].copy_from_slice(&to_tx_digest(&intent_msg));
extended[INTENT_PREFIX_LENGTH..].copy_from_slice(&to_tx_digest(intent_msg));
extended
}

Expand Down

0 comments on commit 9b4a626

Please sign in to comment.