-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
CCIP-2206 Added support for retention in the contract_transmitter.go #12998
Conversation
I see you updated files related to
|
d303671
to
0114f7d
Compare
I see you added a changeset file but it does not contain a tag. Please edit the text include at least one of the following tags:
|
0114f7d
to
aed0693
Compare
Quality Gate passedIssues Measures |
err := lp.RegisterFilter(ctx, logpoller.Filter{Name: transmitterFilterName(address), EventSigs: []common.Hash{transmitted.ID}, Addresses: []common.Address{address}}) | ||
// TODO It would be better to keep MaxLogsKept = 1 for the OCR contract transmitter instead of Retention. We are always interested only in the latest log. | ||
// Although MaxLogsKept is present in the Filter struct, it is not supported by LogPoller yet. | ||
err := lp.RegisterFilter(ctx, logpoller.Filter{Name: transmitterFilterName(address), EventSigs: []common.Hash{transmitted.ID}, Addresses: []common.Address{address}, Retention: retention}) |
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.
Yeah, this was bumped way down in priority after the field was added but before the implementation was added. Shouldn't be difficult, but not sure when I'll have the time to get to it.
contract_transmitter
enables filters in LogPoller that stream all theTransmit
events from the chain to the database. Only to pick the latest one from the database.The following db query is used for that (
SelectLatestLogByEventSigWithConfs
):Unfortunately, the more transmits on the lane/ocr2 contract, the more logs we keep in the database only to pick the latest one for getting the current epoch and configDigest. This grows indefinitely because logs are never evicted from the database. Also, the query needs to gather all
Transmit
logs from a single contract, sort them, and pick the latest one.Example plan on prod-testnet example
The first step is to enable products to pass retention for that filter (each product can pass whatever the value is accurate for them). That way LogPoller will be able to keep this dataset bounded. Ideally, we should pass
MaxLogsKept = 1
, but it's not supported by LP yet.Solution
Add another constructor that allows passing retention. Default stays the same - no logs pruning.
Make ordering much more efficient CCIP-2207 Boosting LogPoller performance by fixing how order by clauses are written #13026