-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat(sidecar): ERC-2335 Keystore signer #287
Conversation
caecafb
to
c05ba79
Compare
2f55a92
to
cdad85b
Compare
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 config refactor is very nice! Left some comments but overall great.
Wrt the signer, this is what I understand from the current flow with the Keystore:
- sidecar is started with keystore CLI flags +
validator-indexes
flag - at each slot, we check if the proposer duties contain one of our validator indexes
- if so, we try to find the pubkey from the keystore and sign the constraints with it
It would be cleaner to use the keystore as source of truth for which pubkeys we can use to sign messages in the first place, instead of going through validator_indexes
.
In particular here's how I imagined it:
- sidecar is started with keystore CLI flags
- all pubkeys are loaded in memory when creating the keystore
- at each slot, we check if the proposer duties contain on of our pubkeys
- if so, simply sign it with that key
let me know your thoughts
dde211e
to
0ccbc1d
Compare
Thanks for the great review! Yes the flow you described is indeed correct. You're right that in the context of the keystore signer the process of checking validator indexes is redundant. I have to think whether it's still needed for other type of signers though |
16730c7
to
5384ddf
Compare
remove log as well
1340031
to
b60efa9
Compare
…a args are captured in testing environment
@@ -224,24 +248,41 @@ impl<C: StateFetcher, BLS: SignerBLS, ECDSA: SignerECDSA> SidecarDriver<C, BLS, | |||
// parse the request into constraints and sign them | |||
let slot = inclusion_request.slot; | |||
|
|||
let pubkey = match self.constraint_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.
reminder: we're missing a check here. this pubkey is used to sign constraints but we don't know if it is authorized to do so. this can be added after we load delegation info in #290
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.
Great job!
Closes #283. This PR introduces support for running the sidecar by reading the private keys from ERC-2335 keystore files.
Such keystore are expected to be placed inside the
keys
folder of this project which reserved for this purpose only. While we could allow fetching them from a specified path, I like the idea of the sidecar not reading arbitrary folders of the users by mistake.Some refactoring changes have been done as well:
signer
folderSignerBLS
trait has been transformed into an enum because there's not a common trait for all type of signersConfig
struct has been absorbed intoOpts
by squeezingClap
functionalitiesRelies on chainbound/ethereum-package#17.