Near-One/rainbow-bridge

Eth2-to-Near-relay: account for header limits on headers submission

sept-en opened this issue · 0 comments

The Eth2-to-Near-relay loops over max_submitted_headers this doesn't account for blocks already submitted but haven't been finalized.

If we have submitted eth1 headers which aren't canonical or finalized, the limit self.max_submitted_headers may be less than the number of blocks a node is allowed to submit. That will occur if submitters[relayer] is a large value on the eth2 client on NEAR.

Then only iterate over headers.len() < min(self.max_submitted_headers, remaining_headers).