Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ alloy = { version = "0.12", features = [
"ssz",
"getrandom",
"providers",
"signer-local",
] }
ssz_types = "0.10"
ethereum_serde_utils = "0.7.0"
Expand Down Expand Up @@ -78,7 +79,6 @@ blsful = "2.5"
tree_hash = "0.9"
tree_hash_derive = "0.9"
eth2_keystore = { git = "https://github.com/sigp/lighthouse", rev = "8d058e4040b765a96aa4968f4167af7571292be2" }
k256 = "0.13"
aes = "0.8"
ctr = "0.9.2"
cipher = "0.4"
Expand Down
42 changes: 24 additions & 18 deletions api/signer-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ paths:
- BearerAuth: []
responses:
"200":
description: "All public keys available to the module: consensus pubkeys (BLS) and proxy pubkeys (BLS and ECDSA)"
description: "All public keys available to the module: consensus pubkeys (BLS) and proxies (BLS pubkeys and ECDSA addresses)"
content:
application/json:
schema:
Expand All @@ -32,15 +32,15 @@ paths:
description: Consensus validator pubkey
$ref: "#/components/schemas/BlsPubkey"
proxy_bls:
description: BLS proxy validator pubkeys
description: BLS proxy pubkeys
type: array
items:
$ref: "#/components/schemas/BlsPubkey"
proxy_ecdsa:
description: ECDSA proxy validator pubkeys
description: ECDSA proxy addresses
type: array
items:
$ref: "#/components/schemas/EcdsaPubkey"
$ref: "#/components/schemas/EcdsaAddress"
"500":
description: Internal error
content:
Expand Down Expand Up @@ -71,17 +71,23 @@ paths:
application/json:
schema:
type: object
required: [type, pubkey, object_root]
required: [type, object_root]
oneOf:
- required: [pubkey]
- required: [proxy]
properties:
type:
description: Type of the sign request
type: string
enum: [consensus, proxy_bls, proxy_ecdsa]
pubkey:
description: Public key of the validator
description: Public key of the validator for consensus signatures
$ref: "#/components/schemas/BlsPubkey"
proxy:
description: BLS proxy pubkey or ECDSA address for proxy signatures
oneOf:
- $ref: "#/components/schemas/BlsPubkey"
- $ref: "#/components/schemas/EcdsaPubkey"
- $ref: "#/components/schemas/EcdsaAddress"
object_root:
description: The root of the object to be signed
type: string
Expand All @@ -97,12 +103,12 @@ paths:
ProxyBls:
value:
type: "proxy_bls"
pubkey: "0xa3ffa9241f78279f1af04644cb8c79c2d8f02bcf0e28e2f186f6dcccac0a869c2be441fda50f0dea895cfce2e53f0989"
proxy: "0xa3ffa9241f78279f1af04644cb8c79c2d8f02bcf0e28e2f186f6dcccac0a869c2be441fda50f0dea895cfce2e53f0989"
object_root: "0x3e9f4a78b5c21d64f0b8e3d9a7f5c02b4d1e67a3c8f29b5d6e4a3b1c8f72e6d9"
ProxyEcdsa:
value:
type: "proxy_ecdsa"
pubkey: "0x023b2806b1b1dfa34dd90b01546906cef3e4c8e0fc0cba60480e9eb4d0a0828311"
proxy: "0x71f65e9f6336770e22d148bd5e89b391a1c3b0bb"
object_root: "0x3e9f4a78b5c21d64f0b8e3d9a7f5c02b4d1e67a3c8f29b5d6e4a3b1c8f72e6d9"
responses:
"200":
Expand All @@ -119,7 +125,7 @@ paths:
ProxyBls:
value: "0xa3ffa9241f78279f1af04644cb8c79c2d8f02bcf0e28e2f186f6dcccac0a869c2be441fda50f0dea895cfce2e53f0989a3ffa9241f78279f1af04644cb8c79c2d8f02bcf0e28e2f186f6dcccac0a869c2be441fda50f0dea895cfce2e53f0989"
ProxyEcdsa:
value: "0xe6a0c0c41a6d4af9794882c18c5280376cbfb7921453612dea02ed8f47b1208455f07931dc12c4b70c4e8ae216db0136000ec2cf17244189f012de356ac46cec"
value: "0x985b495f49d1b96db3bba3f6c5dd1810950317c10d4c2042bd316f338cdbe74359072e209b85e56ac492092d7860063dd096ca31b4e164ef27e3f8d508e656801c"
"404":
description: Unknown value (pubkey, etc.)
content:
Expand Down Expand Up @@ -201,10 +207,10 @@ paths:
allOf:
- $ref: "#/components/schemas/BlsPubkey"
proxy:
description: the generated proxy public key
description: the generated proxy identifier (BLS pubkey or ECDSA address)
oneOf:
- $ref: "#/components/schemas/BlsPubkey"
- $ref: "#/components/schemas/EcdsaPubkey"
- $ref: "#/components/schemas/EcdsaAddress"
signature:
description: The signature of the proxy delegation
allOf:
Expand All @@ -220,7 +226,7 @@ paths:
value:
message:
delegator: "0xa9e9cff900de07e295a044789fd4bdb6785eb0651ad282f9e76d12afd87e75180bdd64caf2e315b815d7322bd31ab48a"
proxy: "0x023b2806b1b1dfa34dd90b01546906cef3e4c8e0fc0cba60480e9eb4d0a0828311"
proxy: "0x71f65e9f6336770e22d148bd5e89b391a1c3b0bb"
signature: "0xb5b5b71d1701cc45086af3d3d86bf9d3c509442835e5b9f7734923edc9a6c538e743d70613cdef90b7e5b171fbbe6a29075b3f155e4bd66d81ff9dbc3b6d7fa677d169b2ceab727ffa079a31fe1fc0e478752e9da9566a9408e4db24ac6104db"
"404":
description: Unknown value (pubkey, etc.)
Expand Down Expand Up @@ -281,11 +287,11 @@ components:
format: hex
pattern: "^0x[a-fA-F0-9]{96}$"
example: "0xa9e9cff900de07e295a044789fd4bdb6785eb0651ad282f9e76d12afd87e75180bdd64caf2e315b815d7322bd31ab48a"
EcdsaPubkey:
EcdsaAddress:
type: string
format: hex
pattern: "^0x[a-fA-F0-9]{66}$"
example: "0x023b2806b1b1dfa34dd90b01546906cef3e4c8e0fc0cba60480e9eb4d0a0828311"
pattern: "^0x[a-fA-F0-9]{40}$"
example: "0x71f65e9f6336770e22d148bd5e89b391a1c3b0bb"
BlsSignature:
type: string
format: hex
Expand All @@ -294,5 +300,5 @@ components:
EcdsaSignature:
type: string
format: hex
pattern: "^0x[a-fA-F0-9]{128}$"
example: "0xe6a0c0c41a6d4af9794882c18c5280376cbfb7921453612dea02ed8f47b1208455f07931dc12c4b70c4e8ae216db0136000ec2cf17244189f012de356ac46cec"
pattern: "^0x[a-fA-F0-9]{130}$"
example: "0x985b495f49d1b96db3bba3f6c5dd1810950317c10d4c2042bd316f338cdbe74359072e209b85e56ac492092d7860063dd096ca31b4e164ef27e3f8d508e656801c"
2 changes: 1 addition & 1 deletion bin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub mod prelude {
load_pbs_custom_config, LogsSettings, StartCommitModuleConfig, PBS_MODULE_NAME,
},
pbs::{BuilderEvent, BuilderEventClient, OnBuilderApiEvent},
signer::{BlsPublicKey, BlsSignature, EcdsaPublicKey, EcdsaSignature},
signer::{BlsPublicKey, BlsSignature, EcdsaSignature},
types::Chain,
utils::{initialize_tracing_log, utcnow_ms, utcnow_ns, utcnow_sec, utcnow_us},
};
Expand Down
1 change: 0 additions & 1 deletion crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ blst.workspace = true
tree_hash.workspace = true
tree_hash_derive.workspace = true
eth2_keystore.workspace = true
k256.workspace = true
aes.workspace = true
ctr.workspace = true
cipher.workspace = true
Expand Down
14 changes: 7 additions & 7 deletions crates/common/src/commit/client.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

use alloy::rpc::types::beacon::BlsSignature;
use alloy::{primitives::Address, rpc::types::beacon::BlsSignature};
use eyre::WrapErr;
use reqwest::header::{HeaderMap, HeaderValue, AUTHORIZATION};
use serde::Deserialize;
Expand All @@ -10,12 +10,12 @@ use super::{
constants::{GENERATE_PROXY_KEY_PATH, GET_PUBKEYS_PATH, REQUEST_SIGNATURE_PATH},
error::SignerClientError,
request::{
EncryptionScheme, GenerateProxyRequest, GetPubkeysResponse, PublicKey,
SignConsensusRequest, SignProxyRequest, SignRequest, SignedProxyDelegation,
EncryptionScheme, GenerateProxyRequest, GetPubkeysResponse, ProxyId, SignConsensusRequest,
SignProxyRequest, SignRequest, SignedProxyDelegation,
},
};
use crate::{
signer::{BlsPublicKey, EcdsaPublicKey, EcdsaSignature},
signer::{BlsPublicKey, EcdsaSignature},
DEFAULT_REQUEST_TIMEOUT,
};

Expand Down Expand Up @@ -93,7 +93,7 @@ impl SignerClient {

pub async fn request_proxy_signature_ecdsa(
&self,
request: SignProxyRequest<EcdsaPublicKey>,
request: SignProxyRequest<Address>,
) -> Result<EcdsaSignature, SignerClientError> {
self.request_signature(&request.into()).await
}
Expand All @@ -110,7 +110,7 @@ impl SignerClient {
request: &GenerateProxyRequest,
) -> Result<SignedProxyDelegation<T>, SignerClientError>
where
T: PublicKey + for<'de> Deserialize<'de>,
T: ProxyId + for<'de> Deserialize<'de>,
{
let url = self.url.join(GENERATE_PROXY_KEY_PATH)?;
let res = self.client.post(url).json(&request).send().await?;
Expand Down Expand Up @@ -144,7 +144,7 @@ impl SignerClient {
pub async fn generate_proxy_key_ecdsa(
&self,
consensus_pubkey: BlsPublicKey,
) -> Result<SignedProxyDelegation<EcdsaPublicKey>, SignerClientError> {
) -> Result<SignedProxyDelegation<Address>, SignerClientError> {
let request = GenerateProxyRequest::new(consensus_pubkey, EncryptionScheme::Ecdsa);

let ecdsa_signed_proxy_delegation = self.generate_proxy_key(&request).await?;
Expand Down
Loading
Loading