Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3352b0c
Initial implementation
diegomrsantos Apr 30, 2025
847ace9
add signature collection
diegomrsantos May 5, 2025
d6ac318
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 5, 2025
fddb299
fix get_validator_index
diegomrsantos May 5, 2025
9b264ba
check the owner for all validators; process exit only for our validators
diegomrsantos May 5, 2025
ce1964d
fix is_our_validator
diegomrsantos May 5, 2025
3109ab7
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 6, 2025
89c2cea
add docs to verify_validator_owner
diegomrsantos May 6, 2025
0f74f32
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 6, 2025
b459206
add doc for get_validator_index
diegomrsantos May 6, 2025
92f81c7
parse block_timestamp as secs
diegomrsantos May 6, 2025
7120a81
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 7, 2025
6929260
fix formatting
diegomrsantos May 7, 2025
6eec9ff
process exit at the right slot
diegomrsantos May 8, 2025
b7fe568
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 8, 2025
d0da421
get block ts from exec client if not available
diegomrsantos May 9, 2025
cf67a16
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 9, 2025
807060d
remove unused dep
diegomrsantos May 9, 2025
3e29869
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 13, 2025
b0b7337
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 13, 2025
fb03944
fix domain computation
diegomrsantos May 13, 2025
ecddf0b
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 14, 2025
d0fb2c0
simplify match
diegomrsantos May 14, 2025
36b78b0
use workspace edition and add authors
diegomrsantos May 14, 2025
c0d5ae6
make code more idiomatic
diegomrsantos May 14, 2025
e38a411
renaming to collect_voluntary_exit_partial_signatures
diegomrsantos May 14, 2025
6c6a289
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 14, 2025
ef660fb
remove retry
diegomrsantos May 14, 2025
6d792c4
use duration_to_next_slot instead of calculate_sleep_duration
diegomrsantos May 14, 2025
61e7737
lint
diegomrsantos May 14, 2025
d458461
remove last_processed_slot
diegomrsantos May 14, 2025
57d7a64
remove unused code
diegomrsantos May 14, 2025
34fa7f1
Update anchor/voluntary_exit/src/voluntary_exit_processor.rs
diegomrsantos May 14, 2025
e53362c
use voluntary_exit.get_domain
diegomrsantos May 15, 2025
fab92a4
return error when cluster is liquidated
diegomrsantos May 15, 2025
1736e8f
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 15, 2025
bd8c8a3
simplify is_our_operator
diegomrsantos May 15, 2025
7980067
Update anchor/common/ssv_types/src/share.rs
diegomrsantos May 15, 2025
f4d7877
update ShareMultiIndexMap docs
diegomrsantos May 15, 2025
cebe4e8
Merge branch 'unstable' into voluntary-exit
diegomrsantos May 16, 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
17 changes: 17 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ members = [
"anchor/signature_collector",
"anchor/subnet_tracker",
"anchor/validator_store",
"anchor/voluntary_exit",
]

resolver = "2"
Expand Down Expand Up @@ -57,6 +58,7 @@ ssv_network_config = { path = "anchor/common/ssv_network_config" }
ssv_types = { path = "anchor/common/ssv_types" }
subnet_tracker = { path = "anchor/subnet_tracker" }
version = { path = "anchor/common/version" }
voluntary_exit = { path = "anchor/voluntary_exit" }

beacon_node_fallback = { git = "https://github.com/sigp/lighthouse", rev = "2c153d7e" }
bls = { git = "https://github.com/sigp/lighthouse", rev = "2c153d7e" }
Expand Down
1 change: 1 addition & 0 deletions anchor/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ unused_port = { workspace = true }
validator_metrics = { workspace = true }
validator_services = { workspace = true }
version = { workspace = true }
voluntary_exit = { workspace = true }
zeroize = { workspace = true }
21 changes: 20 additions & 1 deletion anchor/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use task_executor::TaskExecutor;
use tokio::{
net::TcpListener,
select,
sync::{mpsc, oneshot, oneshot::Receiver},
sync::{mpsc, mpsc::unbounded_channel, oneshot, oneshot::Receiver},
time::sleep,
};
use tracing::{debug, error, info, warn};
Expand All @@ -57,6 +57,9 @@ use validator_services::{
preparation_service::PreparationServiceBuilder,
sync_committee_service::SyncCommitteeService,
};
use voluntary_exit::{
voluntary_exit_processor::start_exit_processor, voluntary_exit_tracker::VoluntaryExitTracker,
};
use zeroize::Zeroizing;

/// The filename within the `validators` directory that contains the slashing protection DB.
Expand Down Expand Up @@ -350,11 +353,17 @@ impl Client {
let index_sync_tx =
start_validator_index_syncer(beacon_nodes.clone(), database.clone(), executor.clone());

// We create the channel here so that we can pass the receiver to the syncer. But we need to
// delay starting the voluntary exit processor until we have created the validator store.
let (exit_tx, exit_rx) = unbounded_channel();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dknopik maybe we should bound this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know my liberal policy about unbounded_channel that have a natural boundary due to on-chain limitations ;D

Still, if you want you can estimate how many exits can be burst in a single block, add some safety margin on top and apply that as limit.

let voluntary_exit_tracker = Arc::new(VoluntaryExitTracker::new());

// Start syncer
let (historic_finished_tx, historic_finished_rx) = oneshot::channel();
let mut syncer = eth::SsvEventSyncer::new(
database.clone(),
index_sync_tx,
exit_tx,
eth::Config {
http_urls: config.execution_nodes,
ws_url: config.execution_nodes_websocket,
Expand Down Expand Up @@ -482,6 +491,16 @@ impl Client {
config.prefer_builder_proposals,
);

start_exit_processor(
slot_clock.clone(),
E::slots_per_epoch(),
beacon_nodes.clone(),
validator_store.clone(),
exit_rx,
executor.clone(),
voluntary_exit_tracker.clone(),
);

let selection_proof_config = SelectionProofConfig {
lookahead_slot: 0,
computation_offset: Duration::ZERO,
Expand Down
2 changes: 1 addition & 1 deletion anchor/common/ssv_types/src/share.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{ClusterId, OperatorId};
pub const ENCRYPTED_KEY_LENGTH: usize = 256;

/// One of N shares of a split validator key.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct Share {
/// Public Key of the validator
pub validator_pubkey: PublicKeyBytes,
Expand Down
10 changes: 6 additions & 4 deletions anchor/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ const CONNECTION_TIMEOUT: Duration = Duration::from_secs(5);
type Pool = r2d2::Pool<SqliteConnectionManager>;
type PoolConn = r2d2::PooledConnection<SqliteConnectionManager>;

/// All of the shares that belong to the current operator
/// Primary: public key of validator. uniquely identifies share
/// Secondary: cluster id. corresponds to a list of shares
/// Tertiary: owner of the cluster. corresponds to a list of shares
/// All the shares that belong to the current operator.
/// IMPORTANT: There are parts of the code that assume this only contains shares that belong to the
/// current operator. If this ever changes, make sure to update the code accordingly.
/// Primary: public key of validator, uniquely identifies a share
/// Secondary: cluster id, corresponds to a list of shares
/// Tertiary: owner of the cluster, corresponds to a list of shares
pub type ShareMultiIndexMap = MultiIndexMap<
PublicKeyBytes,
ClusterId,
Expand Down
2 changes: 1 addition & 1 deletion anchor/database/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl NetworkState {
.map(|cluster| cluster.cluster_members)
}

fn get_cluster_members_for_validator(
pub fn get_cluster_members_for_validator(
&self,
validator_pk: &PublicKeyBytes,
) -> Option<IndexSet<OperatorId>> {
Expand Down
1 change: 1 addition & 0 deletions anchor/eth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ tokio = { workspace = true }
tower = "0.5.2"
tracing = { workspace = true }
types = { workspace = true }
voluntary_exit = { workspace = true }
Loading
Loading