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
9 changes: 4 additions & 5 deletions crates/crypto/src/keystore/kdf.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
//! Key Derivation Function (KDF) implementation
//!
//! Implements scrypt-based key derivation following EIP-2335 specification.
//! Default parameters use fast settings (n=8192) for development.
//! For production, consider using n=262144 (2^18) for stronger security.
//! Default parameters use N=262144 (2^18) as per EIP-2335 standard.

use serde::{Deserialize, Serialize};

use super::error::{KeystoreError, KeystoreResult};
use crate::secure::SecretBytes;

/// Fast scrypt parameters for development (reduced from EIP-2335 standard)
/// Production should use N=262144 (2^18) for stronger security
pub const SCRYPT_N: u32 = 8192; // 2^13 - fast for development
/// Standard scrypt parameters following EIP-2335 specification
/// N=262144 (2^18) provides strong security for key derivation
pub const SCRYPT_N: u32 = 262144; // 2^18 - EIP-2335 standard
pub const SCRYPT_R: u32 = 8; // block size
pub const SCRYPT_P: u32 = 1; // parallelization
pub const SCRYPT_DKLEN: usize = 32; // derived key length
Expand Down
6 changes: 4 additions & 2 deletions crates/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@ impl Node {
};

// Start RPC server if enabled
if let (Some(ref storage), Some(ref debug_executor)) = (&rpc_storage, &rpc_debug_executor) {
if let (Some(ref storage), Some(ref debug_executor), Some(ref sub_mgr)) =
(&rpc_storage, &rpc_debug_executor, &subscription_manager)
{
use cipherbft_rpc::{
RpcConfig, RpcServer, StubExecutionApi, StubMempoolApi, StubNetworkApi,
};
Expand All @@ -879,7 +881,7 @@ impl Node {
executor,
network,
debug_executor.clone(),
subscription_manager.clone().unwrap(),
sub_mgr.clone(),
);

let http_port = self.config.rpc_http_port;
Expand Down