-
Notifications
You must be signed in to change notification settings - Fork 0
(4) Settler: Signatures #50
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
base: solana/settler
Are you sure you want to change the base?
Conversation
…r-proposal-lifecycle
…r-proposal-lifecycle
…r-proposal-lifecycle
…r-proposal-lifecycle
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 would remove this for now
| #[account( | ||
| seeds = [b"entity-registry", &[EntityType::Solver as u8 + 1], solver.key().as_ref()], | ||
| bump = solver_registry.bump, | ||
| seeds::program = crate::controller::ID, |
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.
| seeds::program = crate::controller::ID, | |
| seeds::program = controller::ID, |
This comment applies to every time this happens
| require_keys_eq!( | ||
| ctx.accounts.validator_registry.key(), | ||
| Pubkey::create_program_address( | ||
| &[ | ||
| b"entity-registry", | ||
| &[EntityType::Validator as u8 + 1], | ||
| ed25519_ix_args.pubkey, | ||
| &[ctx.accounts.validator_registry.bump] | ||
| ], | ||
| &crate::controller::ID, | ||
| ) | ||
| .map_err(|_| SettlerError::ValidatorNotAllowlisted)?, | ||
| SettlerError::ValidatorNotAllowlisted, | ||
| ); |
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.
why is this not done in the same way as in add_axia_sig?
|
|
||
| // Updates intent PDA if signature not present and min_validations not met | ||
|
|
||
| if intent.validators.len() == intent.min_validations as usize { |
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 should also check the min_validations in the controller, we can add it in another PR
Adds instructions that validate Ed25519 signatures on-chain.
Used to add Validator signatures on
Intents, and Axia signature onProposals.Rust program modified, as well as Typescript SDK and Typescript tests.
Instructions
Mainly two instructions were added that work in a very similar fashion.
We use instruction introspection to verify that a proof was submitted with the signature verification.
This uses the Solana Ed25519Program to validate a signature.
Both
add_axia_sigandadd_validator_sigrequire an Ed25519Program preinstruction to be present, and to contain the valid data (i.e., a message related to the element being validated, and signed by an authorized pubkey).More info on this implementation can be found in this repo which was what I based myself off for this PR.
add_axia_sigValidates a
Proposal. Only whitelisted Axia, only if final and not expired (among other checks).add_validator_sigValidates an
Intent. Only whitelisted Validators, only if final and not expired (among other checks).change_whitelist_programUnimplemented, a
TODOfrom the PR split (#41).Will allow to change the Whitelist program that this Settler uses.
NOTE: Some files might have content from future PRs given this series of PRs come from a larger PR that was split (#41). I have tried to keep this to a minimum but bear this in mind.