chainlink icon indicating copy to clipboard operation
chainlink copied to clipboard

Handle reorgs in the automation log buffer

Open ferglor opened this issue 10 months ago • 1 comments

https://smartcontract-it.atlassian.net/browse/AUTO-10013

In this PR, we're:

  • Restructuring the log queues so that rather than a map of upkeep ID -> log list, we store a map of upkeep ID -> blockNumber -> log list
  • Passing the block subscriber to the log buffer so that the buffer can cross reference the latest block seen in an enqueue, with the latest block reported by the block subscriber
  • In the event that the latest block from the subscriber and the latest block seen in an enqueue do not match, we assume a reorg has happened and evict logs for all blocks whose hashes do not match those provided in the block history provided by the block subscriber

ferglor avatar May 04 '24 01:05 ferglor