Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

musitdev
Copy link
Contributor

First PR of stake and vote management.

  • Main loop that process geyser account notification.
  • Entry point for stake, vote and leader schedule calculus.
  • Integration in the current LiteRpc architecture.
    • add leader schedule to share data
    • leader_shedule RPC
    • start process notification loop.
    • all leader schedule modules definition

This PR validate the integration of the vote and stake management in current Lite RPC version.

@godmodegalactus
Copy link
Collaborator

Cargo clippy gives lots of warnings.

@@ -7,6 +7,7 @@ members = [
"quic-forward-proxy-integration-test",
"cluster-endpoints",
"history",
"stake_vote",
Copy link
Collaborator

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());
Copy link
Collaborator

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>| {
Copy link
Collaborator

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>>,
Copy link
Collaborator

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() {
Copy link
Collaborator

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?;
Copy link
Collaborator

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 {
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants