From 7bcb03336f1676089fceef742fe59d2a4204a16c Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Tue, 2 Jul 2024 11:17:46 +0200 Subject: [PATCH] MaxLogsKept = 1 for contract transmitter --- core/services/relay/evm/contract_transmitter.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/services/relay/evm/contract_transmitter.go b/core/services/relay/evm/contract_transmitter.go index 724bbbe4aa..3ed1da7243 100644 --- a/core/services/relay/evm/contract_transmitter.go +++ b/core/services/relay/evm/contract_transmitter.go @@ -86,7 +86,11 @@ func NewOCRContractTransmitterWithRetention( // 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}) + err := lp.RegisterFilter(ctx, logpoller.Filter{ + Name: transmitterFilterName(address), + EventSigs: []common.Hash{transmitted.ID}, + Addresses: []common.Address{address}, Retention: retention, MaxLogsKept: 1}, + ) if err != nil { return nil, err }