-
Notifications
You must be signed in to change notification settings - Fork 0
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
[NayNay] Registration verifying keys being stripped at Keyring #353
Conversation
- update creation of functional accounts to include existing data - issue found when trying to view programs for testnet address, verifying keys list was always empty even tho config contained the keys
…yingkeys is empty on device key
… passed to constructor
@frankiebee review this please |
keyring: Keyring | ||
signer: Signer |
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.
i think that maybe we do keyring or signer but not both. Your thoughts?
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.
the signer in this case is coming from the deviceKeys account, we could remove the keyring from here and include the deviceKey signer and the registration signer and just switch between the two, thoughts?
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.
I can't comment on this
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.
i think for now we should leave this as-is until we can solidify that registering is working as expected
This fixes?
you seem to only have only touched the signing file i would imagine the fix would be in sec/programs/index.ts |
the issue wasnt with programs, it was due to the data passed to the keyring from the cli not being persisted to the instantiation of the keyring instance, and so even if the account has verifying keys, according to the Keyring instance generated there were no keys or anything. the fix is in |
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.
🦩 🏁
Looks good. I've pointed at what looks like gotchas to me. Great work adding some tests to keys, that feels really good as a guard-rail to me
package.json
Outdated
"bundle:watch": "tsup --watch", | ||
"bundle:node": "tsup --platform node ", | ||
"bundle:browser": "tsup --platform browser", | ||
"build": "tsup", |
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.
I like this rename, AND if it was in a micro-PR by itself it would be already merged 👹
I am not hard-core on this, but just want us to watch that when we do side-tweaks like this, they will get tangles up with the rest of the PR they are in and that delays them being useful.
I do this too FWIW 😆
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.
yeah i agree with you on this, im going to cut a new smaller PR to just address this change and we can get it merged
admin.verifyingKeys = [...vk, verifyingKey] | ||
deviceKey.verifyingKeys = [verifyingKey, ...vk] |
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.
Question: you changed the order of the verifyingKeys
is that significant?
from : [verifyingKeys, ...vk]
to : [...vk, verifyingKeys]
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.
the order change is to ensure the new verifying key is the first verifying key in the list on the device keys account. this will be the new verifying key used for signing
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.
related to #365
src/keys/index.ts
Outdated
const masterAccountView = JSON.parse( | ||
JSON.stringify(this.accounts.masterAccountView) | ||
) |
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.
🌶️ at least extract this as a function cloneDeep(this.accounts.masterAccountView)
that way it's
- self documenting
- as this pattern spreads, we can re-use one function
- if we want to improve it we only have to swap one function
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.
Also de-serialization like this is v slow. consider import { cloneDeep } from 'lodash'
Speed probably doesn't matter here much tho
this.accounts.masterAccountView[childKey][k] = v | ||
setTimeout( |
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.
comment why this is necessary/ needed plz
(I know, but I will also forget!)
keyring: Keyring | ||
signer: Signer |
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.
I can't comment on this
6a6bab7
to
a9f6e68
Compare
…om:entropyxyz/sdk into naynay/keyring-registration-verifying-keys
we need to look more into how we are doing the storage for keyrings on the cli |
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.
I'm going to put my stamp of approval on this for now and get it merged in so a rc can be created for cli. But lets address deeper testing in a separate pr @mixmix
Co-authored-by: mix irving <[email protected]>
Most of what you want is in here. will make more tests a priority as of next steps and PR
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.
Ive commited to the branch some of mixs docs changes! This is good to go!
Description
GitHub Issue or Linear Task
How Has This Been Tested?