Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
3c06f9f
feat: add withdrawal credentials to genesis
matthias-wright Oct 22, 2025
2231efe
chore: set different VALIDATOR_WITHDRAWAL_PERIOD for e2e feature
matthias-wright Oct 22, 2025
7eef25f
feat: add binary to test withdraw and exit
matthias-wright Oct 23, 2025
ad2622d
feat: shut down runtime if validator is removed from committee
matthias-wright Oct 23, 2025
f78ebf3
feat: implement Drop for application, syncer, and finalizer to coordi…
matthias-wright Oct 23, 2025
019dd57
chore: remove unused CLI args from withdraw and exit bin
matthias-wright Oct 23, 2025
4a1edea
feat: add get validator valance route to rpc
matthias-wright Oct 23, 2025
69237c2
feat: verify that validator that withdrew is no longer on consensus s…
matthias-wright Oct 23, 2025
17ab569
feat: add cli argument to pass optional checkpoint
matthias-wright Oct 23, 2025
2fb35fc
feat: load checkpoint with ssz encoding
matthias-wright Oct 24, 2025
5769f6a
chore: fmt
matthias-wright Oct 24, 2025
c2511b8
chore: switch p2p network config to recommended
matthias-wright Oct 29, 2025
7798dd5
fix: clear added and removed validators only after writing to disk
matthias-wright Oct 29, 2025
b4bf7cf
chore: use height for oracle instead of view
matthias-wright Oct 29, 2025
e468645
chore: use aggressive networking config when e2e flag is enabled
matthias-wright Oct 31, 2025
03e3f00
feat: add epoch to consensus state
matthias-wright Oct 31, 2025
cf50e86
feat: update registry
matthias-wright Oct 31, 2025
5a58921
feat: update block and header
matthias-wright Oct 31, 2025
2895b30
feat: update checkpoint
matthias-wright Oct 31, 2025
453f675
feat: update network oracle
matthias-wright Oct 31, 2025
51e5e63
feat: switch to BLS multisig and make generic over signer
matthias-wright Nov 4, 2025
c7d7f6f
feat: add orchestrator
matthias-wright Nov 5, 2025
9b97227
feat: add keystore
matthias-wright Nov 5, 2025
cf2744d
feat: refactor CLI to include BLS key
matthias-wright Nov 5, 2025
2ad6df6
feat: update syncer (WIP)
matthias-wright Nov 5, 2025
346061b
feat: add consensus key to genesis
matthias-wright Nov 5, 2025
1d6a9e7
feat: add consensus key to validator account
matthias-wright Nov 5, 2025
6e6400c
feat: add epoch to header and block
matthias-wright Nov 6, 2025
2306779
feat: update application
matthias-wright Nov 6, 2025
2ecb81b
feat: make finalized header generic over scheme
matthias-wright Nov 6, 2025
702faa1
feat: implement consensus block trait for BlockEnvelope
matthias-wright Nov 7, 2025
e968f2f
feat: receive finalized blocks via finalizer mailbox
matthias-wright Nov 7, 2025
d40c361
feat: add sync_height and response channel for finalized blocks
matthias-wright Nov 7, 2025
a7ee55f
chore: update finalizer mailbox signature
matthias-wright Nov 7, 2025
44ac39f
chore: update trait bounds
matthias-wright Nov 7, 2025
0ca1658
chore: update network oracle
matthias-wright Nov 7, 2025
2788524
chore: update trait bounds and use context cell
matthias-wright Nov 7, 2025
7de3f72
chore: update types
matthias-wright Nov 7, 2025
fa62267
feat: orchestrator and update syncer
matthias-wright Nov 7, 2025
baba4ea
chore: fmt
matthias-wright Nov 7, 2025
c7bbf45
feat: send new validator list to orchestrator from finalizer
matthias-wright Nov 8, 2025
e36898a
feat: finalizer notifies orchestrator to shutdown simplex from last e…
matthias-wright Nov 9, 2025
824a08a
feat: update DepositRequest type to include both keys and sigs
matthias-wright Nov 10, 2025
af8052f
feat: store BLS pubkey from deposit req and verify sig
matthias-wright Nov 10, 2025
6bd6060
chore: fix compile issues in binaries
matthias-wright Nov 10, 2025
2a2d011
chore: clippy
matthias-wright Nov 10, 2025
f2fec24
chore: implement Manager and Blocker traits for dummy network
matthias-wright Nov 10, 2025
e77617e
feat: start initial simplex instance from finalizer
matthias-wright Nov 11, 2025
37da843
feat: add epoch genesis hash to consensus state
matthias-wright Nov 11, 2025
b8999c0
feat: request epoch genesis hash from finalizer
matthias-wright Nov 11, 2025
ac1d2fa
chore: remove generics from orchestrator message
matthias-wright Nov 11, 2025
84ede86
fix: use subscribe instead of get_block to get the parent block
matthias-wright Nov 11, 2025
302f872
feat: send block + finalization on last block of epoch to finalizer
matthias-wright Nov 11, 2025
e5ba1d9
chore: remove registry
matthias-wright Nov 11, 2025
b171425
fix: use SimulatedOracle for e2e tests
matthias-wright Nov 12, 2025
b498654
fix: fix test_single_engine_with_checkpoint
matthias-wright Nov 12, 2025
00e9a1d
feat: apply marshal update (Fills Gaps Before Processing)
matthias-wright Nov 12, 2025
69876e3
feat: use commonware's epoch boundries
matthias-wright Nov 13, 2025
bafe399
chore: reduce max_repair to 10
matthias-wright Nov 13, 2025
50b52a2
test: don't remove execution requests in test harness
matthias-wright Nov 13, 2025
301af5f
test: fix execution request e2e tests
matthias-wright Nov 13, 2025
b1c20bc
test: fix test_single_engine_with_checkpoint
matthias-wright Nov 13, 2025
b606ddc
feat: remove generic scheme from finalizer and use bls
matthias-wright Nov 13, 2025
1de394d
allow get_public_key and health check before getting genesis
Nov 13, 2025
07645de
chore: update testnet keys
matthias-wright Nov 13, 2025
d0bf2c8
chore: pass in timeouts to orchestrator from config
matthias-wright Nov 13, 2025
9060e71
chore: use local network config for binary tests
matthias-wright Nov 13, 2025
0a61e6d
chore: remove block fetcher bin
matthias-wright Nov 13, 2025
ba57082
test: fix stake and checkpoint binary test
matthias-wright Nov 14, 2025
03acf43
test: fix withdraw and exit binary
matthias-wright Nov 14, 2025
50e5693
chore: add latest view to the consensus state
matthias-wright Nov 14, 2025
7d942d6
fmt
cdrappi Nov 14, 2025
42fc0ee
Only check if building on proper eth block in finalizer
daltoncoder Nov 14, 2025
1ee5da7
fix finalizer
daltoncoder Nov 14, 2025
d564702
feat: set last_processed_height and last_processed_round according to…
matthias-wright Nov 14, 2025
d23728f
chore: set blocks per epoch to 10000
matthias-wright Nov 15, 2025
db63f79
feat: initialize sync variables from consensus state returned by fina…
matthias-wright Nov 18, 2025
e6cc571
fix: increment epoch after writing to disk
matthias-wright Nov 18, 2025
b4835df
add comment
cdrappi Nov 18, 2025
4712cf4
Merge branch 'm/upgrade-commonware-0.0.63' of github.com:SeismicSyste…
cdrappi Nov 18, 2025
6af5d6a
update genesis rpc
cdrappi Nov 18, 2025
fdcfa4a
ok
cdrappi Nov 18, 2025
7995339
mroe
cdrappi Nov 18, 2025
c6f6088
key paths
cdrappi Nov 18, 2025
5c8ff91
OK
cdrappi Nov 18, 2025
2461654
fmt
cdrappi Nov 18, 2025
35294e6
cargo fmt
cdrappi Nov 18, 2025
5e85d7a
better
cdrappi Nov 18, 2025
0f722c6
try
cdrappi Nov 18, 2025
c5c8bf3
bettert
cdrappi Nov 18, 2025
0a3a485
see what we get
cdrappi Nov 18, 2025
5026009
smaller
cdrappi Nov 18, 2025
fdd4ebe
diff
cdrappi Nov 18, 2025
50cfb49
merge in main
cdrappi Nov 20, 2025
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
1 change: 1 addition & 0 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 example_genesis.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
eth_genesis_hash = "0x655cc1ecc77fe1eab4b1e62a1f461b7fddc9b06109b5ab3e9dc68c144b30c773"
eth_genesis_hash = "0x93068b65464eeee04a47a3b16b3123d05a5d83882032525bdb5e297d654857f0"
leader_timeout_ms = 2000
notarization_timeout_ms = 4000
nullify_timeout_ms = 4000
Expand Down
20 changes: 16 additions & 4 deletions node/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,19 @@ impl Command {

// use the context async move to spawn a new runtime
let genesis_path = flags.genesis_path.clone();
let key_store_path = flags.key_store_path.clone();
let rpc_port = flags.rpc_port;
let _rpc_handle = context
.with_label("rpc_genesis")
.spawn(move |_context| async move {
let genesis_sender = Command::check_sender(genesis_path, genesis_tx);
if let Err(e) =
start_rpc_server_for_genesis(genesis_sender, rpc_port, cloned_token).await
if let Err(e) = start_rpc_server_for_genesis(
genesis_sender,
key_store_path,
rpc_port,
cloned_token,
)
.await
{
error!("RPC server failed: {}", e);
}
Expand Down Expand Up @@ -414,12 +420,18 @@ pub fn run_node_local(
// use the context async move to spawn a new runtime
let rpc_port = flags.rpc_port;
let genesis_path = flags.genesis_path.clone();
let key_store_path = flags.key_store_path.clone();
let _rpc_handle = context
.with_label("rpc_genesis")
.spawn(move |_context| async move {
let genesis_sender = Command::check_sender(genesis_path, genesis_tx);
if let Err(e) =
start_rpc_server_for_genesis(genesis_sender, rpc_port, cloned_token).await
if let Err(e) = start_rpc_server_for_genesis(
genesis_sender,
key_store_path,
rpc_port,
cloned_token,
)
.await
{
error!("RPC server failed: {}", e);
}
Expand Down
56 changes: 6 additions & 50 deletions node/src/bin/genesis.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
use clap::Parser;
use commonware_codec::{DecodeExt, Encode as _};
use commonware_cryptography::bls12381::{
dkg::ops,
primitives::{poly, variant::MinPk},
};
use commonware_utils::{from_hex, hex, quorum};
use rand::rngs::OsRng;
use serde::{Deserialize, Serialize};
use std::fs;
use std::path::Path;
use summit_types::PublicKey;
use summit_types::GenesisValidator;

const DEFAULT_GENESIS_FILE: &str = "./example_genesis.toml";

Expand All @@ -23,8 +15,7 @@ pub struct GenesisConfig {
skip_timeout_views: u64,
max_message_size_bytes: u64,
namespace: String,
pub identity: String,
pub validators: Vec<Validator>,
pub validators: Vec<GenesisValidator>,
}

impl GenesisConfig {
Expand All @@ -35,19 +26,6 @@ impl GenesisConfig {
}
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Validator {
pub public_key: String,
pub ip_address: String,
}

impl Validator {
pub fn ed25519_pubkey(&self) -> PublicKey {
let pubkey_bytes = from_hex(&self.public_key).unwrap();
PublicKey::decode(&pubkey_bytes[..]).unwrap()
}
}

#[derive(Parser, Debug)]
struct Args {
/// input for genesis file
Expand All @@ -63,14 +41,14 @@ struct Args {

fn parse_validators(
validators_path: &String,
) -> Result<Vec<Validator>, Box<dyn std::error::Error>> {
) -> Result<Vec<GenesisValidator>, Box<dyn std::error::Error>> {
let rdr = std::fs::File::open(validators_path)?;
let mut validators: Vec<Validator> = serde_json::from_reader(rdr)?;
let mut validators: Vec<GenesisValidator> = serde_json::from_reader(rdr)?;
// NOTE: (important!)
// Sort public keys in the same order we do in summit
validators.sort_by(|a, b| {
let a_pubkey = a.ed25519_pubkey();
let b_pubkey = b.ed25519_pubkey();
let a_pubkey = a.node_pubkey();
let b_pubkey = b.node_pubkey();
a_pubkey.partial_cmp(&b_pubkey).unwrap()
});
Ok(validators)
Expand All @@ -81,32 +59,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

let validators = parse_validators(&args.validators_path)?;
let node_count = validators.len() as u32;
let threshold = quorum(node_count);

let (polynomial, shares) =
ops::generate_shares::<_, MinPk>(&mut OsRng, None, node_count, threshold);

println!("Network polynomial: {}", hex(&polynomial.encode()));
println!("Network pub key: {}", poly::public::<MinPk>(&polynomial));

// Read the genesis config
let mut genesis_config = GenesisConfig::load(&args.genesis_in)?;

// Update the identity with the hex of the polynomial
genesis_config.identity = hex(&polynomial.encode());
genesis_config.validators = validators;

// Write the shares we generated
for (i, _v) in genesis_config.validators.iter().enumerate() {
let node_dir = format!("{}/node{i}", args.out_dir);
fs::create_dir_all(&node_dir)?;

let share_path = Path::new(&node_dir).join("share.pem");
let share_hex = hex(&shares[i].encode());
fs::write(&share_path, share_hex)?;
println!("Node {i}: wrote share to {share_path:?}");
}

// Write the updated genesis config
let updated_genesis = toml::to_string_pretty(&genesis_config)?;
fs::write(format!("{}/genesis.toml", args.out_dir), updated_genesis)?;
Expand Down
1 change: 1 addition & 0 deletions rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ commonware-runtime = { workspace = true }
ethereum_ssz.workspace = true
dirs = "5.0.1"
serde = { workspace = true }
serde_json = { workspace = true }
tracing.workspace = true
72 changes: 72 additions & 0 deletions types/src/key_paths.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
use crate::{PrivateKey, utils::get_expanded_path};
use anyhow::{Context, Result};
use commonware_codec::DecodeExt;
use commonware_cryptography::Signer;
use commonware_cryptography::bls12381::PrivateKey as BlsPrivateKey;
use commonware_utils::from_hex_formatted;

/// Helper struct for managing key paths and loading keys from a key store directory.
///
/// The key store directory should contain:
/// - `node_key.pem`: ED25519 private key for node identity (node key)
/// - `share.pem`: BLS12-381 DKG share (consensus key)
pub struct KeyPaths(String);

impl KeyPaths {
/// Create a new KeyPaths instance from a key store path
pub fn new(key_store_path: String) -> Self {
Self(key_store_path)
}

/// Get the path to the node key file (ED25519)
pub fn node_key_path(&self) -> String {
format!("{}/node_key.pem", self.0)
}

/// Get the path to the consensus key file (BLS share)
pub fn consensus_key_path(&self) -> String {
format!("{}/share.pem", self.0)
}

/// Load the node private key (ED25519) from the key store
pub fn node_private_key(&self) -> Result<PrivateKey, String> {
self.read_node_key_from_file().map_err(|e| e.to_string())
}

/// Load the consensus private key (BLS) from the key store
pub fn consensus_private_key(&self) -> Result<BlsPrivateKey, String> {
self.read_bls_key_from_file().map_err(|e| e.to_string())
}

/// Get the node public key (ED25519) as a hex string
pub fn node_public_key(&self) -> Result<String, String> {
let private_key = self.node_private_key()?;
Ok(private_key.public_key().to_string())
}

/// Get the consensus public key (BLS) as a hex string
pub fn consensus_public_key(&self) -> Result<String, String> {
let private_key = self.consensus_private_key()?;
Ok(private_key.public_key().to_string())
}

/// Read the node private key from file (using anyhow::Result for compatibility)
pub fn read_node_key_from_file(&self) -> Result<PrivateKey> {
let path = get_expanded_path(&self.node_key_path())?;
let encoded_pk = std::fs::read_to_string(&path)
.context(format!("Failed to read node key from {:?}", path))?;
let key = from_hex_formatted(&encoded_pk).context("Invalid hex format for node key")?;
let pk = PrivateKey::decode(&*key).context("Unable to decode node private key")?;
Ok(pk)
}

/// Read the BLS private key from file (using anyhow::Result for compatibility)
pub fn read_bls_key_from_file(&self) -> Result<BlsPrivateKey> {
let path = get_expanded_path(&self.consensus_key_path())?;
let encoded_pk = std::fs::read_to_string(&path)
.context(format!("Failed to read BLS key from {:?}", path))?;
let key = from_hex_formatted(&encoded_pk).context("Invalid hex format for BLS key")?;
let pk = BlsPrivateKey::decode(&*key).context("Unable to decode BLS private key")?;
Ok(pk)
}
}
Loading