-
Notifications
You must be signed in to change notification settings - Fork 154
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
fog-view: Limit number of user events, and tell client this happened #3151
base: main
Are you sure you want to change the base?
Changes from all commits
28bf64f
704734a
22adbdf
c94da3e
64f407d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,11 @@ impl<R: RecoveryDb> FogViewConnection for PassThroughViewClient<R> { | |
start_from_block_index: u64, | ||
search_keys: Vec<Vec<u8>>, | ||
) -> Result<QueryResponse, Self::Error> { | ||
let (user_events, next_start_from_user_event_id) = | ||
self.db.search_user_events(start_from_user_event_id)?; | ||
const USER_EVENT_LIMIT: usize = 10_000; | ||
let (user_events, next_start_from_user_event_id) = self | ||
.db | ||
.search_user_events(start_from_user_event_id, USER_EVENT_LIMIT)?; | ||
let may_have_more_user_events = user_events.len() >= USER_EVENT_LIMIT; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears that we're returning all the However, the logic for |
||
|
||
let highest_known_block_count = self | ||
.db | ||
|
@@ -75,6 +78,7 @@ impl<R: RecoveryDb> FogViewConnection for PassThroughViewClient<R> { | |
tx_out_search_results: Default::default(), | ||
last_known_block_count: highest_known_block_count, | ||
last_known_block_cumulative_txo_count: cumulative_txo_count, | ||
may_have_more_user_events, | ||
}; | ||
|
||
resp.tx_out_search_results = self.db.get_tx_outs(start_from_block_index, &search_keys)?; | ||
|
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.
In the PR description you write: "I believe that this is a backwards compatible change, because old clients will ignore this flag".
But if it's true that "clients cannot compute an accurate balance check until they have received all relevant user events," then how can an (old) client that ignores this flag accurately compute a balance check?
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.
Good question: