Skip to content

Stake and vote management. Integration of the main loop in LiteRPC#229

Closed
musitdev wants to merge 2 commits intomainfrom
stakes_and_votes
Closed

Stake and vote management. Integration of the main loop in LiteRPC#229
musitdev wants to merge 2 commits intomainfrom
stakes_and_votes

Conversation

@musitdev
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Cargo clippy gives lots of warnings.

Comment thread Cargo.toml
"quic-forward-proxy-integration-test",
"cluster-endpoints",
"history",
"stake_vote",
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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,

Comment thread stake_vote/src/account.rs
bail!("Error: read Stake account with empty data");
}

if self.data.is_empty() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

duplicate.

Comment thread stake_vote/src/lib.rs
rpc_client: Arc<RpcClient>,
grpc_url: String,
) -> anyhow::Result<tokio::task::JoinHandle<()>> {
let mut account_gyzer_stream = subscribe_geyzer(grpc_url).await?;
Copy link
Copy Markdown
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.

Comment thread stake_vote/src/utils.rs
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
Copy Markdown
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.

3 participants