-
Notifications
You must be signed in to change notification settings - Fork 8
Add support for OCR2 Key Management - No creation for now #26
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
Conversation
I don't like putting multiple things in a commit, but there's a redirect on authorization error addition that is part of the new OCR2KeysCard file - see the comments in the file
|
CI Tests are breaking now because of the resolver code being only aware of EVM and SOLANA (as well as being case sensitive which is problematic because they are stored by the keystore in lowercase I believe.) I can update the resolver to be aware of starknet, but that is just kicking the can down the road because the core is moving away from hardcoded knowledge about chain families (which is why the OCR2 key management support I'm adding does not yet support creation of OCR2 keys.) We might want to remove chain family name validation from the CI tests until this is resolved architecturally on the core node side; although, it will likely no longer be a part of the graphql generated definitions going forward - but that's not certain yet.) @jkongie / @HenryNguyen5 - what do y'all think? I'm a newbie here at Chainlink, so feel free to club away ;) |
|
I believe that you may to update the GQL schema with the new type anyway due to how the typecheck works, just to get this in. Since you are using |
|
@jkongie - that's the weirdness though. The backend graphql enum is all caps. The OCR2 key family is created/carried/persisted lowercase, and driven by a different enum. I'll double check that the query doesn't perform any mapping/transformations when bundling the key data. If it does, I'll update the enumeration - otherwise it is indicative that the enumeration names and the keybundle values have been disconnected all along for OCR2 keys. The OCR2 client side graphql bundling code already handles 'starknet' and other lowercase names just fine, it's only breaking in the CI tests. I can modify my tests to avoid names it isn't aware of - since the real world usage doesn't use the forms the tests expect anyhow - but I may change the enumeration instead if it doesn't break other things. Here's the mismatch in core (that will shortly get worse with a growth in chains): This is used by the core for key creation:
This is what the graphql resolver defines (and is a bit out of date :) )
|
…des STARKNET and will be merged before this PR can pass CI tests)
|
Hey Hans, Use the onError callback handler of useOCR2KeysQuery to sign out and redirect on UNAUTHORIZED apollo errors like so: const handleQueryErrors = useQueryErrorHandler()
const { data, loading, refetch } = useOCR2KeysQuery({
fetchPolicy: 'network-only',
onError: handleQueryErrors
})or Call the handler directly const handleQueryErrors = useQueryErrorHandler()
const { data, loading, refetch, error } = useOCR2KeysQuery({
fetchPolicy: 'network-only',
onError: handleQueryErrors
})
handleQueryErrors(error)Note that we make our own handler since the error handling implementation of queries vs mutations may diverge over time.
It may be wise to refactor the 3 hooks to extract common functionality, at a glance, they do the same logic when handling unauth errors. If i understand you correctly, this will give you the intended result of notifying users on query error within the parent container component without having the child view component do that handling (edited) |
Added in |
|
As far as I know, starknet support for GQL is not going to be implemented any time soon so we should ignore it for now |
Description
You may now view OCR2 keys on the same Key Management UI as the other keys, following the same structures and patterns as the original OCR keys (except with different data of course)Please note that OCR2 key creation is not supported at this time as OCR2 keys require the specification of a chain family and that list is now, as far as any client is concerned, dynamically generated by the core node - this usually mean a simple query, but with the very soon to be added support for blockchain plugins, I am very leery of exposing this from the node just yetThere is also an addition to resolve the unhandled session timeout issue (exhibited by the Key Management page) that stems from that screen/view not having a query that would trigger session timeout at the appropriate levelSteps to Test
yarn && yarn setupyarn start