chainlink-common icon indicating copy to clipboard operation
chainlink-common copied to clipboard

Replace Pending boolean with Confidence

Open reductionista opened this issue 1 year ago • 2 comments

This flag was being used to determine whether to use latest block or finalized block for event reads (originally named Finalized in a draft of the CLIP, but renamed to Pending during review due to some miscommunications around its purpose).

Having it be a Confidence level from 0 to 10 allows for more granularity but still avoids products needing to pass a chain-specific # of confirmations. Instead, the Confidence level should be translated into # of confirmations based on the chain, in the RelayConfig.

Choosing int32 instead of uint32 leaves the door open for special values like Confidence = -1 which could be used to represent the Pending block in the tx pool. (Presently this is not supported, and there are no known use cases, but better to be more flexible in case the need arises.)

Along with this, we should also start using it for method reads to make things more parallel between events & state, the distinction between which the product plugins are not supposed to know or care about.

reductionista avatar Apr 02 '24 19:04 reductionista

Can you please open PRs for the other repos that will need changes so we can review the whole set at once?

jmank88 avatar Apr 10 '24 02:04 jmank88

Can you please open PRs for the other repos that will need changes so we can review the whole set at once?

Ah, I forgot this was still open. I think @ilija42 is deciding on the exact approach, and might already be including changes to this effect (or something different?) in his present work. @ilija42 should I just close this one? If it's still relevant, I can add a linked PR to chainlink repo.

reductionista avatar Apr 10 '24 02:04 reductionista