Skip to content

Commit 8ca85b4

Browse files
authored
update the cache used for LatestRoundRequested (#503)
1 parent 6b771a5 commit 8ca85b4

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

relayer/pkg/chainlink/ocr2/contract_reader.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func (c *contractReader) LatestTransmissionDetails(
101101
return
102102
}
103103

104+
// round will never be requested on Starknet so we return 0 values
104105
func (c *contractReader) LatestRoundRequested(
105106
ctx context.Context,
106107
lookback time.Duration,
@@ -110,15 +111,9 @@ func (c *contractReader) LatestRoundRequested(
110111
round uint8,
111112
err error,
112113
) {
113-
transmissionDetails, err := c.reader.LatestTransmissionDetails(ctx, c.address)
114-
if err != nil {
115-
err = fmt.Errorf("couldn't get transmission details: %w", err)
116-
}
117-
118-
configDigest = transmissionDetails.Digest
114+
configDigest = types.ConfigDigest{}
119115
epoch = 0
120116
round = 0
121-
122117
return
123118
}
124119

relayer/pkg/chainlink/ocr2/transmissions_cache.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,7 @@ func (c *transmissionsCache) LatestRoundRequested(
130130
round uint8,
131131
err error,
132132
) {
133-
c.tdLock.RLock()
134-
defer c.tdLock.RUnlock()
135-
configDigest = c.transmissionDetails.Digest
136-
epoch = c.transmissionDetails.Epoch
137-
round = c.transmissionDetails.Round
138-
err = c.assertTransmissionsNotStale()
139-
return
133+
return c.reader.LatestRoundRequested(ctx, lookback)
140134
}
141135

142136
func (c *transmissionsCache) assertTransmissionsNotStale() error {

0 commit comments

Comments
 (0)