-
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
base: 08-29-create_permissioned_signer_example
Are you sure you want to change the base?
[feature] Add permissioned signer functionality #14521
Conversation
⏱️ 3h 32m total CI duration on this PR
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 08-29-create_permissioned_signer_example #14521 +/- ##
==========================================================================
Coverage 60.1% 60.1%
==========================================================================
Files 856 857 +1
Lines 211026 210762 -264
==========================================================================
- Hits 126865 126723 -142
+ Misses 84161 84039 -122 ☔ View full report in Codecov by Sentry. |
456f5f4
to
55771fc
Compare
31c9b2c
to
6d309ff
Compare
55771fc
to
070a951
Compare
6d309ff
to
703921b
Compare
070a951
to
b832d3d
Compare
703921b
to
48991ff
Compare
b832d3d
to
6ddb481
Compare
48991ff
to
906c7c7
Compare
6ddb481
to
8b92b98
Compare
906c7c7
to
350db4c
Compare
8b92b98
to
fa646c8
Compare
350db4c
to
dad258f
Compare
fa646c8
to
c3aba3a
Compare
dad258f
to
6b4da66
Compare
c3aba3a
to
50b556b
Compare
6b4da66
to
b1fd015
Compare
50b556b
to
8cd68d5
Compare
b1fd015
to
6592c01
Compare
1835d3d
to
42decc7
Compare
bcf98d8
to
93706d9
Compare
1302971
to
4505dc2
Compare
93706d9
to
cad586d
Compare
4505dc2
to
2dfa163
Compare
cad586d
to
59309c6
Compare
2dfa163
to
7b93a7d
Compare
59309c6
to
dec8882
Compare
7b93a7d
to
4c1f016
Compare
@@ -6,7 +6,7 @@ | |||
use crate::{ | |||
gas_feature_versions::{RELEASE_V1_14, RELEASE_V1_8, RELEASE_V1_9_SKIPPED}, | |||
gas_schedule::NativeGasParameters, | |||
ver::gas_feature_versions::{RELEASE_V1_12, RELEASE_V1_13, RELEASE_V1_23}, | |||
ver::gas_feature_versions::{RELEASE_V1_12, RELEASE_V1_13, RELEASE_V1_23, RELEASE_V1_25}, |
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.
1_26 now :)
debug_assert!(arguments.len() == 2); | ||
|
||
let permission_addr = safely_pop_arg!(arguments, AccountAddress); | ||
let master_addr = safely_pop_arg!(arguments, AccountAddress); |
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.
don't we need to verify that the handle exists, either here, or in the move code?
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 indeed validated on the move side.
let (_, fields) = MoveStructLayout::signer() | ||
.deserialize(deserializer)? | ||
.into_optional_variant_and_fields(); | ||
Ok(MoveValue::Signer(match fields[0] { | ||
MoveValue::Address(addr) => addr, | ||
_ => return Err(D::Error::custom("signer deserialization error")), | ||
})) |
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.
this deserves a comment on what it does here and why
@@ -691,7 +704,9 @@ impl serde::Serialize for MoveValue { | |||
MoveValue::U128(i) => serializer.serialize_u128(*i), | |||
MoveValue::U256(i) => i.serialize(serializer), | |||
MoveValue::Address(a) => a.serialize(serializer), | |||
MoveValue::Signer(a) => a.serialize(serializer), | |||
MoveValue::Signer(a) => { | |||
MoveStruct::new_variant(0, vec![MoveValue::Address(*a)]).serialize(serializer) |
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.
this deserves a comment on what it does here and why
@@ -691,7 +704,9 @@ impl serde::Serialize for MoveValue { | |||
MoveValue::U128(i) => serializer.serialize_u128(*i), | |||
MoveValue::U256(i) => i.serialize(serializer), | |||
MoveValue::Address(a) => a.serialize(serializer), | |||
MoveValue::Signer(a) => a.serialize(serializer), | |||
MoveValue::Signer(a) => { |
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.
MoveValue::Signer doesn't change?
dec8882
to
cadf003
Compare
558c74e
to
beacad5
Compare
beacad5
to
5a4e0b4
Compare
cadf003
to
1fd9d08
Compare
5a4e0b4
to
3bc592c
Compare
1fd9d08
to
600433c
Compare
3bc592c
to
efd4b1b
Compare
600433c
to
2109874
Compare
efd4b1b
to
b7dadf2
Compare
b7dadf2
to
a96ae99
Compare
Description
Implement rust extension for the permissioned signer, including the new ser/de logic.
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
This will be tested with future PRs. Also a replay-verify is executed to make sure this feature is not breaking.
Key Areas to Review
We still need to keep the old serialization logic in the bcs module because it can otherwise cause on chain divergence.
Checklist