-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stake and vote management. Integration of the main loop in LiteRPC #229
Conversation
Cargo clippy gives lots of warnings. |
@@ -7,6 +7,7 @@ members = [ | |||
"quic-forward-proxy-integration-test", | |||
"cluster-endpoints", | |||
"history", | |||
"stake_vote", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cargo clippy gives lots of warnings.
commitment: Option<CommitmentConfig>, | ||
data_cache: &DataCache, | ||
) -> Option<HashMap<String, Vec<usize>>> { | ||
let commitment = commitment.unwrap_or_else(|| CommitmentConfig::confirmed()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default one should be finalized.
}; | ||
let epoch = data_cache.epoch_data.get_epoch_at_slot(slot); | ||
|
||
let get_schedule = |schedule_data: Option<&LeaderScheduleData>| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should implement LeaderFetcherInterface to get the schedule.
|
||
#[derive(Clone)] | ||
pub struct LeaderScheduleData { | ||
pub schedule: HashMap<String, Vec<usize>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be leader: HashMap<Index, Pubkey>.
and then schedule should be a Vec,
bail!("Error: read Stake account with empty data"); | ||
} | ||
|
||
if self.data.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate.
rpc_client: Arc<RpcClient>, | ||
grpc_url: String, | ||
) -> anyhow::Result<tokio::task::JoinHandle<()>> { | ||
let mut account_gyzer_stream = subscribe_geyzer(grpc_url).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
geyser subscription for accounts should be done somewhere else.
use solana_lite_rpc_core::structures::epoch::Epoch as LiteRpcEpoch; | ||
use solana_sdk::commitment_config::CommitmentConfig; | ||
|
||
pub async fn get_current_confirmed_slot(data_cache: &DataCache) -> u64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be move somewhere else.
First PR of stake and vote management.
This PR validate the integration of the vote and stake management in current Lite RPC version.