-
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): load delegations on startup and send them upon registration #292
Conversation
bolt-sidecar/src/driver.rs
Outdated
let delegatees = self.constraints_client.find_delegatees(&validator_pubkey); | ||
let available_pubkeys = self.constraint_signer.available_pubkeys(); | ||
|
||
// Pick a pubkey to sign constraints with. | ||
// | ||
// Rationale: | ||
// - If there are no delegatee keys, try to use the validator key directly if available. | ||
// - If there are delegatee keys, try to use the first one that is available in the list. | ||
let Some(pubkey) = pick_public_key(validator_pubkey, available_pubkeys, delegatees) else { | ||
error!(%target_slot, "No available public key to sign constraints with"); | ||
let _ = response.send(Err(CommitmentError::Internal)); | ||
return; | ||
}; |
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 is quite inefficient but the logic should check out. Let me know 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.
Overall it's great! Some q's
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 work, lgtm
Overview
Opts
from a TOML file, loaded optionally if theBOLT_SIDECAR_CONFIG_PATH
is definedsigning.delegations
file path option that will parse SignedDelegations from JSON if presentdelegate()
duringregister_validators()
so they are done together to signal delegations regularly. We should maybe think of a better strategy as this could be inefficient if done with many delegations (e.g. 10k+ validators).delegation
andtransaction
types to their own file).Note: this PR changes the constraints API body type for
delegate()
andrevoke()
to take Vec instead of T.Following PRs in bolt-boost and mev-boost should reflect this change.
Meta