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

Keyless circuit update 202501 gov #15702

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
script {
use aptos_framework::keyless_account;
use aptos_framework::aptos_governance;
use std::option;
fun main(proposal_id: u64) {
let framework_signer = aptos_governance::resolve_multi_step_proposal(
proposal_id,
@0x1,
{{ script_hash }},
);
keyless_account::update_training_wheels_for_next_epoch(&framework_signer, option::some(x"FF"));
// Action: obtain the values below from vk file. https://github.com/aptos-labs/snarkjs-to-aptos may help.
let alpha_g1 = x"e2f26dbea299f5223b646cb1fb33eadb059d9407559d7441dfd902e3a79a4d2d";
let beta_g2 = x"abb73dc17fbc13021e2471e0c08bd67d8401f52b73d6d07483794cad4778180e0c06f33bbc4c79a9cadef253a68084d382f17788f885c9afd176f7cb2f036789";
let gamma_g2 = x"edf692d95cbdde46ddda5ef7d422436779445c5e66006a42761e1f12efde0018c212f3aeb785e49712e7a9353349aaf1255dfb31b7bf60723a480d9293938e19";
let delta_g2 = x"b106619932d0ef372c46909a2492e246d5de739aa140e27f2c71c0470662f125219049cfe15e4d140d7e4bb911284aad1cad19880efb86f2d9dd4b1bb344ef8f";
let gamma_abc_g1 = vector[
x"6123b6fea40de2a7e3595f9c35210da8a45a7e8c2f7da9eb4548e9210cfea81a",
x"32a9b8347c512483812ee922dc75952842f8f3083edb6fe8d5c3c07e1340b683",
];
let vk = keyless_account::new_groth16_verification_key(alpha_g1, beta_g2, gamma_g2, delta_g2, gamma_abc_g1);
keyless_account::set_groth16_verification_key_for_next_epoch(&framework_signer, vk);
let pk_bytes = x"1388de358cf4701696bd58ed4b96e9d670cbbb914b888be1ceda6374a3098ed4";
keyless_account::update_training_wheels_for_next_epoch(&framework_signer, option::some(pk_bytes));
aptos_governance::reconfigure(&framework_signer);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
script {
use aptos_framework::keyless_account;
use aptos_framework::aptos_governance;
use std::option;
fun main(core_resources: &signer) {
let framework_signer = aptos_governance::get_signer_testnet_only(core_resources, @0x1);

let alpha_g1 = x"e2f26dbea299f5223b646cb1fb33eadb059d9407559d7441dfd902e3a79a4d2d";
let beta_g2 = x"abb73dc17fbc13021e2471e0c08bd67d8401f52b73d6d07483794cad4778180e0c06f33bbc4c79a9cadef253a68084d382f17788f885c9afd176f7cb2f036789";
let gamma_g2 = x"edf692d95cbdde46ddda5ef7d422436779445c5e66006a42761e1f12efde0018c212f3aeb785e49712e7a9353349aaf1255dfb31b7bf60723a480d9293938e19";
let delta_g2 = x"b106619932d0ef372c46909a2492e246d5de739aa140e27f2c71c0470662f125219049cfe15e4d140d7e4bb911284aad1cad19880efb86f2d9dd4b1bb344ef8f";
let gamma_abc_g1 = vector[
x"6123b6fea40de2a7e3595f9c35210da8a45a7e8c2f7da9eb4548e9210cfea81a",
x"32a9b8347c512483812ee922dc75952842f8f3083edb6fe8d5c3c07e1340b683",
];
let vk = keyless_account::new_groth16_verification_key(alpha_g1, beta_g2, gamma_g2, delta_g2, gamma_abc_g1);
keyless_account::set_groth16_verification_key_for_next_epoch(&framework_signer, vk);
let pk_bytes = x"1388de358cf4701696bd58ed4b96e9d670cbbb914b888be1ceda6374a3098ed4";
keyless_account::update_training_wheels_for_next_epoch(&framework_signer, option::some(pk_bytes));
aptos_governance::reconfigure(&framework_signer);
}
}
17 changes: 5 additions & 12 deletions aptos-move/aptos-release-builder/data/release.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
---
remote_endpoint: https://fullnode.mainnet.aptoslabs.com
name: "TBD"
name: "keyless_circuit_update_202501"
proposals:
- name: proposal_1_upgrade_framework
- name: keyless_circuit_update_202501
metadata:
title: "Multi-step proposal to upgrade mainnet framework, version TBD"
description: "This includes changes in (TBA: URL to changes)"
title: "keyless_circuit_update_202501"
description: "keyless_circuit_update_202501"
execution_mode: MultiStep
update_sequence:
- Gas:
new: current
- Framework:
bytecode_version: 6
git_hash: ~
- FeatureFlag:
enabled:
- allow_serialized_script_args
- RawScript: data/proposals/vk_rotation_proposal_id.move

Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ module std::bn254_algebra {
assert!(eq(&one<Fq12>(), &upcast<Gt, Fq12>(&identity)), 1);
}

#[test_only]
use std::option;
#[test_only]
use aptos_std::crypto_algebra::{zero, one, from_u64, eq, deserialize, serialize, neg, add, sub, mul, div, inv, rand_insecure, sqr, order, scalar_mul, multi_scalar_mul, double, upcast, enable_cryptography_algebra_natives, pairing, multi_pairing, downcast, Element};

Expand Down Expand Up @@ -852,4 +854,10 @@ module std::bn254_algebra {
// (Tests end here.)
//

#[test(fx = @std)]
fun hihi(fx:signer) {
enable_cryptography_algebra_natives(&fx);
let r = deserialize<G1, FormatG1Compr>(&x"e2f26dbea299f5223b646cb1fb33eadb059d9407559d7441dfd902e3a79a4d2d");
assert!(option::is_some(&r), 1);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -258,5 +258,10 @@ module aptos_std::ed25519 {
assert!(signature_verify_strict_t(&sig2, &pk, copy msg2), std::error::invalid_state(2));
}

#[test]
fun hoho() {
let upk = new_unvalidated_public_key_from_bytes(x"1388de358cf4701696bd58ed4b96e9d670cbbb914b888be1ceda6374a3098ed4");
assert!(option::is_some(&public_key_validate(&upk)), 1);
}

}
Loading