Skip to content

Commit 2c3efde

Browse files
committed
address comments. /reload now allows new module jwts without a full restart
1 parent a9a5c11 commit 2c3efde

5 files changed

Lines changed: 391 additions & 78 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ rand = { version = "0.9", features = ["os_rng"] }
6565
rayon = "1.10.0"
6666
rcgen = "0.13.2"
6767
reqwest = { version = "0.12.4", features = ["json", "rustls-tls", "stream"] }
68+
reqwest-eventsource = "=0.5.0"
6869
rustls = "0.23.23"
6970
serde = { version = "1.0.202", features = ["derive"] }
7071
serde_json = "1.0.117"

crates/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ tree_hash.workspace = true
5252
tree_hash_derive.workspace = true
5353
unicode-normalization.workspace = true
5454
url.workspace = true
55-
reqwest-eventsource = "=0.5.0"
55+
reqwest-eventsource.workspace = true
5656

5757
[dev-dependencies]
5858
tempfile.workspace = true

crates/common/src/signer/schemes/ecdsa.rs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use tree_hash::TreeHash;
99

1010
use crate::{
1111
constants::COMMIT_BOOST_DOMAIN,
12-
signature::compute_domain,
13-
types::{self, Chain, SignatureRequestInfo},
12+
signature::compute_prop_commit_signing_root,
13+
types::{Chain, SignatureRequestInfo},
1414
};
1515

1616
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -91,21 +91,12 @@ impl EcdsaSigner {
9191
) -> Result<EcdsaSignature, alloy::signers::Error> {
9292
match self {
9393
EcdsaSigner::Local(sk) => {
94-
let signing_domain = compute_domain(chain, &B32::from(COMMIT_BOOST_DOMAIN));
95-
let signing_root = match signature_request_info {
96-
Some(SignatureRequestInfo { module_signing_id, nonce }) => {
97-
let object_root = types::PropCommitSigningInfo {
98-
data: *object_root,
99-
module_signing_id: *module_signing_id,
100-
nonce: *nonce,
101-
chain_id: chain.id(),
102-
}
103-
.tree_hash_root();
104-
types::SigningData { object_root, signing_domain }.tree_hash_root()
105-
}
106-
None => types::SigningData { object_root: *object_root, signing_domain }
107-
.tree_hash_root(),
108-
};
94+
let signing_root = compute_prop_commit_signing_root(
95+
chain,
96+
object_root,
97+
signature_request_info,
98+
&B32::from(COMMIT_BOOST_DOMAIN),
99+
);
109100
sk.sign_hash_sync(&signing_root).map(EcdsaSignature::from)
110101
}
111102
}
@@ -139,6 +130,7 @@ mod test {
139130
};
140131

141132
use super::*;
133+
use crate::{signature::compute_domain, types};
142134

143135
#[tokio::test]
144136
async fn test_ecdsa_signer_noncommit() {

0 commit comments

Comments
 (0)