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

[feature] Add bloxroute #151

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

Lanikean
Copy link

@Lanikean Lanikean commented Sep 4, 2024

This PR adds a method called send_and_confirm_bx that handles transaction propegation, mirroring the logic in send_and_confirm as closely as possible along with some enhancements.

I've also in my testing process discovered a bug where the program will hang indefinitely if a mine cycle fails.

On a failure of the entire sending and confirming cycle, the on chain proof.last_hash_at will not update, and so will not be greater than the in memory last_hash_at below:

pub async fn get_updated_proof_with_authority(
    client: &RpcClient,
    authority: Pubkey,
    lash_hash_at: i64,
) -> Proof {
    loop {
        let proof = get_proof_with_authority(client, authority).await;
        if proof.last_hash_at.gt(&lash_hash_at) {
            return proof;
        }
        tokio::time::sleep(Duration::from_millis(1_000)).await;
    }
}

I've fixed this by updating last_hash_at in the mine function only if a transaction was succesfully sent, otherwise it will remain at the current difficultly.

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.

1 participant