-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
add withdraw durable nonce #26829
add withdraw durable nonce #26829
Conversation
0c783c9
to
05ff1b6
Compare
05ff1b6
to
cca2bec
Compare
@@ -109,17 +109,35 @@ pub fn generate_durable_nonce_accounts<T: 'static + BenchTpsClient + Send + Sync | |||
let (mut nonce_keypairs, _extra) = generate_keypairs(seed_keypair, count as u64); | |||
nonce_keypairs.truncate(count); | |||
|
|||
let to_fund: Vec<(&Keypair, &Keypair)> = authority_keypairs | |||
let to_fund: Vec<NonceCreateSigners> = authority_keypairs |
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.
I replace pair to struct in order to have two different types for Withdraw and Create accounts. It is required because for Create I need two signatures and for Withdraw only one (Sliceable::to_slice
method returns array of signing Keypairs).
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.
Looks good! Just the one nit, which I don't really feel too strongly about, so feel free to go forward with this
bench-tps/src/send_batch.rs
Outdated
&authority.pubkey(), | ||
nonce_rent, | ||
); | ||
struct NonceWithdrawSigners<'a>(&'a Keypair, &'a Keypair); |
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.
nit: It would be clearer for the second parameter to be a Pubkey
since it's not signing, but I think that'll make things more complicated in the implementation, like (&'a Keypair, Pubkey)
, which is probably worse. I imagine you already considered this tradeoff 😅
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.
Actually this is really good point! And it happens that it is quite easy to implement
Before &Keypair was passed although it is not necessary because nonce doesn't sign withdraw account transactions anyways.
Problem
Adds function which withdraws durable nonce accounts.
This is part of the series of PRs adding durable nonce accounts to bench-tps: #25759
Summary of Changes