-
Notifications
You must be signed in to change notification settings - Fork 874
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
feat: Agave v2 RPC: replace getRecentBlockhash
with getLatestBlockhash
#3419
base: 10-23-feat_agave_v2_rpc_replace_getconfirmedtransaction_with_gettransaction_
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
950dba5
to
ee67085
Compare
b1112a4
to
4e4ba0c
Compare
ee67085
to
f96e4d2
Compare
ea25c54
to
02c228c
Compare
What's our semver deal here, are we committed to backward compatibility across 1.x? I'd like to just remove the deprecated method TBH, but maybe we can't do that in a 1.x release. Failing that I'd prefer to just hardcode 5000, but not too worried either way. |
We can't just remove them, even if they are deprecated. I can change this to be hard-coded, but we'd lose out on the fact that fees are supposed to change under varying network load. This might not be the prettiest solution, but it does capture fee rate changes with accuracy. It's worth noting that the probability of someone using this field - on a long-deprecated method no less - is quite low. @steveluscher what do you think here? |
OK, hear me out. How absolutely nuts would it be to:
That way you could get this all done in a single call to the server. |
How does a program get this info? |
I was hoping you'd know better than me. This? |
Actually I was tempted to use this and just load it from account data, but it's deprecated. So we can officially kick the can down the road and just load from a deprecated sysvar for now, and probably avoid the requirement for an on-chain program altogether. https://github.com/anza-xyz/agave/blob/32b677bf4f2b4a718f62683e1daec87a3a83b83d/sdk/program/src/sysvar/fees.rs#L42 This sysvar is still updated per-slot by Bank, so it would totally work (for now). It would still be two calls, one to |
Well, the difference with that approach is that you could parallelize the calls, so that's much, much better than the implementation with serial calls. Go for it. |
02c228c
to
c250727
Compare
@steveluscher the feature to disable the fees sysvar ( The only way to get it properly loaded into the test validator is the hackery that is my second commit. The test validator's genesis config overwrites the account fixture if the feature is enabled. If we still want to go this route, we just have to be aware that the sysvar's account itself hasn't been cleaned up on any higher clusters, but it's not being updated anymore. |
Oof. I'm not sure who we're building this for anymore.
Surely that's nobody, right? At this point I'm tempted to just: return {
context,
value: {
blockhash,
feeCalculator: {
get lamportsPerSignature() {
throw new Error(
'The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is ' +
'no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee ' +
'for a given message.',
);
}
},
},
} |
This is a bad idea...