-
Notifications
You must be signed in to change notification settings - Fork 3
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 custom filtering support (needed for liquidator) #21
base: main
Are you sure you want to change the base?
Conversation
9cae769
to
a52c31e
Compare
@@ -84,6 +84,31 @@ pub fn init( | |||
}, | |||
); | |||
} | |||
Ok(FeedWrite::Snapshot(snapshot_write)) = account_write_queue_receiver.recv() => { |
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.
is this kind of pattern matching on the future-result allowed? I'm worried that this runs two account_write_queue_receiver.recv()
futures and then fails if whichever returns first doesn't match the pattern
connector/src/grpc_plugin_source.rs
Outdated
@@ -219,6 +248,9 @@ async fn feed_data_geyser( | |||
EntityFilter::FilterByProgramId(program_id) => { | |||
snapshot_gpa = tokio::spawn(get_snapshot_gpa(snapshot_rpc_http_url.clone(), program_id.to_string())).fuse(); | |||
}, | |||
EntityFilter::FilterByProgramIdAndCustomCriteria(program_id,filters) => { |
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.
run cargo fmt; also FilterByProgramId sounds very close to FilterByProgramIdAndCustomCriteria with zero extra filters - could that be the same thing? If not, maybe rename FilterByProgramIdFiltered or FilterByProgramIdSelective or so? the "custom criteria" sounds odd to me
connector/src/lib.rs
Outdated
|
||
#[derive(Clone, PartialEq, Debug)] | ||
pub struct SnapshotWrite { | ||
pub accounts: Vec<AccountWrite>, |
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 wonder if it's useful to have a separate SnapshotWrite when it's just a bundle of AccountWrites, consumers may be happy if they don't have to special case?
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.
Ah, the liquidator actually depends on knowing when the first snapshot is done. Making the startup of this convenient for users is probably a separate task.
connector/src/snapshot.rs
Outdated
@@ -38,7 +47,7 @@ pub async fn get_snapshot_gpa( | |||
min_context_slot: None, | |||
}; | |||
let program_accounts_config = RpcProgramAccountsConfig { | |||
filters: None, | |||
filters: fitlers.map(|v| v.iter().map(|f| f.to_rpc_filter()).collect()), |
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.
typo fitlers
7165e7d
to
1096ee3
Compare
No description provided.