Skip to content

Commit

Permalink
jwk #1: validator txn for publishing updates (#11853)
Browse files Browse the repository at this point in the history
* jwk types update

* update

* update

* jwk txn and execution

* update

* fix dummy

* update

* update

* update

* update

* update

* update

* remove dummy txns

* check voting power than verify signature

* fix warnings

* update

* update QuorumCertifiedUpdate struct

GitOrigin-RevId: 793563fc9a022994fbc1d1c073e7090fc8091fe1
  • Loading branch information
zjma authored and aptos-bot committed Oct 23, 2024
1 parent 7936dc8 commit 125b89b
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 0 deletions.
45 changes: 45 additions & 0 deletions aptos-framework/doc/jwks.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,51 @@ This is what applications should consume.



<a id="0x1_jwks_ENATIVE_INCORRECT_VERSION"></a>



<pre><code><b>const</b> <a href="jwks.md#0x1_jwks_ENATIVE_INCORRECT_VERSION">ENATIVE_INCORRECT_VERSION</a>: u64 = 259;
</code></pre>



<a id="0x1_jwks_ENATIVE_MISSING_RESOURCE_OBSERVED_JWKS"></a>



<pre><code><b>const</b> <a href="jwks.md#0x1_jwks_ENATIVE_MISSING_RESOURCE_OBSERVED_JWKS">ENATIVE_MISSING_RESOURCE_OBSERVED_JWKS</a>: u64 = 258;
</code></pre>



<a id="0x1_jwks_ENATIVE_MISSING_RESOURCE_VALIDATOR_SET"></a>



<pre><code><b>const</b> <a href="jwks.md#0x1_jwks_ENATIVE_MISSING_RESOURCE_VALIDATOR_SET">ENATIVE_MISSING_RESOURCE_VALIDATOR_SET</a>: u64 = 257;
</code></pre>



<a id="0x1_jwks_ENATIVE_MULTISIG_VERIFICATION_FAILED"></a>



<pre><code><b>const</b> <a href="jwks.md#0x1_jwks_ENATIVE_MULTISIG_VERIFICATION_FAILED">ENATIVE_MULTISIG_VERIFICATION_FAILED</a>: u64 = 260;
</code></pre>



<a id="0x1_jwks_ENATIVE_NOT_ENOUGH_VOTING_POWER"></a>



<pre><code><b>const</b> <a href="jwks.md#0x1_jwks_ENATIVE_NOT_ENOUGH_VOTING_POWER">ENATIVE_NOT_ENOUGH_VOTING_POWER</a>: u64 = 261;
</code></pre>



<a id="0x1_jwks_EUNEXPECTED_EPOCH"></a>


Expand Down
6 changes: 6 additions & 0 deletions aptos-framework/sources/jwks.move
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ module aptos_framework::jwks {
const EISSUER_NOT_FOUND: u64 = 5;
const EJWK_ID_NOT_FOUND: u64 = 6;

const ENATIVE_MISSING_RESOURCE_VALIDATOR_SET: u64 = 0x0101;
const ENATIVE_MISSING_RESOURCE_OBSERVED_JWKS: u64 = 0x0102;
const ENATIVE_INCORRECT_VERSION: u64 = 0x0103;
const ENATIVE_MULTISIG_VERIFICATION_FAILED: u64 = 0x0104;
const ENATIVE_NOT_ENOUGH_VOTING_POWER: u64 = 0x0105;

/// An OIDC provider.
struct OIDCProvider has drop, store {
/// The utf-8 encoded issuer string. E.g., b"https://www.facebook.com".
Expand Down
60 changes: 60 additions & 0 deletions move-stdlib/doc/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ return true.
- [Function `zkid_feature_enabled`](#0x1_features_zkid_feature_enabled)
- [Function `get_zkid_zkless_feature`](#0x1_features_get_zkid_zkless_feature)
- [Function `zkid_zkless_feature_enabled`](#0x1_features_zkid_zkless_feature_enabled)
- [Function `get_jwk_consensus_feature`](#0x1_features_get_jwk_consensus_feature)
- [Function `jwk_consensus_enabled`](#0x1_features_jwk_consensus_enabled)
- [Function `change_feature_flags`](#0x1_features_change_feature_flags)
- [Function `is_enabled`](#0x1_features_is_enabled)
- [Function `set`](#0x1_features_set)
Expand Down Expand Up @@ -369,6 +371,18 @@ Lifetime: transient



<a id="0x1_features_JWK_CONSENSUS"></a>

The JWK consensus feature.

Lifetime: permanent


<pre><code><b>const</b> <a href="features.md#0x1_features_JWK_CONSENSUS">JWK_CONSENSUS</a>: u64 = 49;
</code></pre>



<a id="0x1_features_LIMIT_MAX_IDENTIFIER_LENGTH"></a>


Expand Down Expand Up @@ -1918,6 +1932,52 @@ Lifetime: transient



</details>

<a id="0x1_features_get_jwk_consensus_feature"></a>

## Function `get_jwk_consensus_feature`



<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_get_jwk_consensus_feature">get_jwk_consensus_feature</a>(): u64
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_get_jwk_consensus_feature">get_jwk_consensus_feature</a>(): u64 { <a href="features.md#0x1_features_JWK_CONSENSUS">JWK_CONSENSUS</a> }
</code></pre>



</details>

<a id="0x1_features_jwk_consensus_enabled"></a>

## Function `jwk_consensus_enabled`



<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_jwk_consensus_enabled">jwk_consensus_enabled</a>(): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="features.md#0x1_features_jwk_consensus_enabled">jwk_consensus_enabled</a>(): bool <b>acquires</b> <a href="features.md#0x1_features_Features">Features</a> {
<a href="features.md#0x1_features_is_enabled">is_enabled</a>(<a href="features.md#0x1_features_JWK_CONSENSUS">JWK_CONSENSUS</a>)
}
</code></pre>



</details>

<a id="0x1_features_change_feature_flags"></a>
Expand Down
10 changes: 10 additions & 0 deletions move-stdlib/sources/configs/features.move
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ module std::features {
is_enabled(ZK_ID_ZKLESS_SIGNATURE)
}

/// The JWK consensus feature.
///
/// Lifetime: permanent
const JWK_CONSENSUS: u64 = 49;

public fun get_jwk_consensus_feature(): u64 { JWK_CONSENSUS }

public fun jwk_consensus_enabled(): bool acquires Features {
is_enabled(JWK_CONSENSUS)
}

// ============================================================================================
// Feature Flag Implementation
Expand Down

0 comments on commit 125b89b

Please sign in to comment.