Skip to content
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

Reasonable query search depth #14

Open
ggwpez opened this issue Jun 1, 2021 · 2 comments
Open

Reasonable query search depth #14

ggwpez opened this issue Jun 1, 2021 · 2 comments

Comments

@ggwpez
Copy link

ggwpez commented Jun 1, 2021

Location: [backend/eth] All queries where past events are read, namely:

  • Adjudicator.ensureConcluded: searches for ChannelUpdate events
  • Adjudicator.ensureWithdrawn: searches for Withdrawn events
  • Adjudicator.Subscribe: searches for ChannelUpdate events
  • Funder.checkFunded: searches for Deposited events
  • Funder.waitforFundingConfirmation: searches for Deposited events

Current situation:
When creating filter queries for events, a startBlockOffset value is needed which defines how many blocks into the past a query should go.
We currently use the constant startBlockOffset=100 for all queries.

Problem: I dont remember how this value was chosen or if it was tested in any way.
We need either one global or one per query startBlockOffset value that is reasonable.
Maybe some research must be done on how to chose this.

Having this would be important for our mainnet release.

@matthiasgeihs
Copy link
Contributor

We should consider using a logic where the caller can specify a time until which to go back. Then the subscription would start at the first block after the specified point in time.

For example, we may know that we only agreed to open a channel at time t, then we only need to listen for events on that channel for t'>=t.

@ggwpez
Copy link
Author

ggwpez commented Jun 4, 2021

For example, we may know that we only agreed to open a channel at time t, then we only need to listen for events on that channel for t'>=t.

We could do some kind of Selector or Predicate type which has multiple constructors; eg. SinceBlockTime, SinceBlockNum or SincePastBlocks(n) (which would query n blocks into the past).
What do you think @matthiasgeihs ?

@matthiasgeihs matthiasgeihs transferred this issue from hyperledger-labs/go-perun Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants