-
Notifications
You must be signed in to change notification settings - Fork 268
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
account_saver: collect SanitizedTransaction
references
#2820
account_saver: collect SanitizedTransaction
references
#2820
Conversation
SanitizedTransaction
references
runtime/src/account_saver.rs
Outdated
pub fn collect_accounts_to_store<'a, T: SVMMessage>( | ||
txs: &'a [T], | ||
txs_refs: &'a Option<Vec<impl core::borrow::Borrow<SanitizedTransaction>>>, |
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: Can the Borrow
type be imported in the top-of-file use
statement?
More real though, should this be Borrow
? Does a regular reference not work? Or AsRef
instead?
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.
It may be owned or borrowed. If we have SanitizedTransaction we need only copy references. If we have a ResolvedTransactionView we need to convert to an owned SanitizedTransaction.
Of course this just needs to exist until geyser has a sane interface, but since that's blocked for now and we dont want to wait on it, we're stuck with something similar to this.
If we wanted to eat the cost for simplicity, we could also just clone our SanitizedTransaction
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.
'AsRef' unfortunately does not work, since it is not implemented for '&T'.
// references in order to comply with that interface - until it | ||
// is changed. |
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.
Who is owning changing the geyser interface? Should it be required that the interface is updated before releasing v2.1 so that the extra allocation doesn't actually get released to the wild?
How significant is this allocation in practice (assuming geyser is in use)?
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 guess I am "owning" the actual changes of the geyser interface. But have not had luck in getting reviews of related code.
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.
These per batch allocations should be minimal compared to the per ingested allocations of regular transactions. Jemalloc is relatively well suited for these regular allocations
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.
Problem
account_saver
generic, but it should not actually be collecting the generic references until we have transitioned geyser.Summary of Changes
SanitizedTransaction
. ForSanitizedTransaction
we simply collect referencesFixes #