-
Notifications
You must be signed in to change notification settings - Fork 39
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
Refactor the crypto services #2170
Conversation
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.
LGTM! Big milestone getting rid of that hardcoded key. Couple v minor comments.
Worth getting Stefan/other eyes on it too, the extending entropy stuff seems sensible to me but I don't know if there are gotchas.
Nice that we get away with not having to restart Gateway on testnet redeploy still I think, because the encrypted clients are created on demand 💪
@@ -25,11 +25,6 @@ import ( | |||
gethlog "github.com/ethereum/go-ethereum/log" | |||
) | |||
|
|||
const ( | |||
// todo: this is a convenience for testnet testing and will eventually be retrieved from the L1 | |||
enclavePublicKeyHex = "034d3b7e63a8bcd532ee3d1d6ecad9d67fca7821981a044551f0f0cbec74d0bc5e" |
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 key string still appears a few times in the codebase which can probably be cleaned up? In particular can probably delete the stuff about 'EnclavePublicKey' in transaction_injector.go
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.
good spot. Got rid of them. They weren't used anywhere. Probably a vestige
go/rpc/client.go
Outdated
@@ -17,6 +17,7 @@ const ( | |||
|
|||
Health = "ten_health" | |||
Config = "ten_config" | |||
RPCKey = "ten_rPCKey" |
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.
Not sure if it's case sensitive anyway but this capitalisation seems ugly haha, maybe copilot did that.
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 called the method RPCKey, and the convention is prefix_{lowerCaseFirstChar}{otherChars}
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.
Fair, I'd probably rename it to RpcKey()
to fix that if it doesn't break our linter with a comment to explain it keeps the rpc method name nice lol. I guess that method's not super public facing but a little bit.
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.
LGTM, lets open a ticket for removing the decrypt blob from any front end if there isn't one already
Why this change is needed
In preparation for MainNet, we must use randomness generated inside the enclave.
What changes were made as part of this PR
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks