-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[feature] Add permissioned signer functionality #14521
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
name = "test" | ||
version = "0.0.0" | ||
|
||
[dependencies] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
script { | ||
fun main(s1: &signer, u: u64, s2: &signer) {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,11 +58,13 @@ spec aptos_framework::transaction_context { | |
} | ||
spec generate_unique_address(): address { | ||
pragma opaque; | ||
aborts_if [abstract] false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? |
||
ensures [abstract] result == spec_generate_unique_address(); | ||
} | ||
spec fun spec_generate_unique_address(): address; | ||
spec generate_auid_address(): address { | ||
pragma opaque; | ||
aborts_if [abstract] false; | ||
// property 3: Generating the unique address should return a vector with 32 bytes, if the auid feature flag is enabled. | ||
/// [high-level-req-3] | ||
ensures [abstract] result == spec_generate_unique_address(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,12 @@ spec aptos_std::smart_table { | |
|
||
spec destroy<K: drop, V: drop>(self: SmartTable<K, V>) { | ||
pragma verify = false; | ||
pragma opaque; | ||
} | ||
|
||
spec clear<K: drop, V: drop>(self: &mut SmartTable<K, V>) { | ||
pragma verify = false; | ||
pragma opaque; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? Bad rebase? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for fixing prover related test cases as we try to implement some minimal spec for the permissioned signer. |
||
} | ||
|
||
spec split_one_bucket<K, V>(self: &mut SmartTable<K, V>) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
module std::signer { | ||
/// Borrows the address of the signer | ||
/// Conceptually, you can think of the `signer` as being a struct wrapper around an | ||
/// address | ||
/// signer is a builtin move type that represents an address that has been verfied by the VM. | ||
/// | ||
/// VM Runtime representation is equivalent to following: | ||
/// ``` | ||
/// struct signer has drop { addr: address } | ||
/// enum signer has drop { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: you probably should use "```" so this renders as a code snippet in docs? |
||
/// Master { account: address }, | ||
/// Permissioned { account: address, permissions_address: address }, | ||
/// } | ||
/// ``` | ||
/// | ||
/// for bcs serialization: | ||
/// | ||
/// ``` | ||
/// struct signer has drop { | ||
/// account: address, | ||
/// } | ||
/// ``` | ||
/// ^ The discrepency is needed to maintain backwards compatibility of signer serialization | ||
/// semantics. | ||
/// | ||
/// `borrow_address` borrows this inner field | ||
native public fun borrow_address(s: &signer): &address; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we adding this test? Has this not been tested before?
Separately: would passing int, signer, signer here be allowed (re-ordered from function signature)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was just to make sure the signer gets rejected if it occurs in the middle of arguments, thus it's safe for us to change the serialization format.