Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCFR-934/remove-finality-depth-as-default-value-for-minConfirmation-and-fix-inconsistency #14509

Conversation

huangzhen1997
Copy link
Contributor

@huangzhen1997 huangzhen1997 commented Sep 20, 2024

Description

We shouldn't use FinalityDepth as the default value for minConfirmation when it's not provided by the user.

Update the sql query for fetching pending callback transactions:
if minConfirmation is not null, we check difference if the current block - tx block > minConfirmation,
else we check if the tx block is <= finalizedBlock

Tickets:

BCFR-934

@huangzhen1997 huangzhen1997 marked this pull request as ready for review September 20, 2024 16:03
@huangzhen1997 huangzhen1997 requested review from a team as code owners September 20, 2024 16:03
@huangzhen1997 huangzhen1997 requested review from jmank88 and removed request for a team September 20, 2024 16:03
@huangzhen1997 huangzhen1997 marked this pull request as draft September 20, 2024 16:26
Copy link
Contributor

github-actions bot commented Oct 7, 2024

WF: CI Core#9c9678a

No errors found in this run. 🎉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now passing existing tests, but I think we are missing some coverage. Consider if a user does not set a value. In the old path, a value would be obtained that may or may not be zero, which determines whether we wait for a callback or not. In the new path, we never wait for callback. It would seem that we need a means of getting a callback after finalization (regardless of the particular depth or tags being used).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it valid to set only txRequest.PipelineTaskRunID without txRequest.MinConfirmations, to get a callback based on the configured finality? If that doesn't work already, it seems like a logical way to support this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented. Now the only change in behavior should be the unnoticeable implementation detail of an "immediate" callback in the case of omitting a value for a chain with "instant" finality. So just a bit of latency in the worst case.

Copy link
Contributor

github-actions bot commented Oct 7, 2024

WF: CI Core#871214a

No errors found in this run. 🎉

@jmank88 jmank88 force-pushed the BCFR-934/remove-finality-depth-as-default-value-for-minConfirmation-and-fix-inconsistency branch from 7a49237 to 627a7e1 Compare October 7, 2024 15:54
Copy link
Contributor

github-actions bot commented Oct 7, 2024

WF: CI Core#7a49237

No errors found in this run. 🎉

@jmank88 jmank88 force-pushed the BCFR-934/remove-finality-depth-as-default-value-for-minConfirmation-and-fix-inconsistency branch from 627a7e1 to 4bf6083 Compare October 7, 2024 15:58
Copy link
Contributor

github-actions bot commented Oct 7, 2024

WF: CI Core#627a7e1

No errors found in this run. 🎉

@jmank88 jmank88 force-pushed the BCFR-934/remove-finality-depth-as-default-value-for-minConfirmation-and-fix-inconsistency branch from 4bf6083 to 3b899db Compare October 7, 2024 16:10
Copy link
Contributor

github-actions bot commented Oct 7, 2024

WF: CI Core#6312f63

No errors found in this run. 🎉

@huangzhen1997 huangzhen1997 marked this pull request as ready for review October 7, 2024 16:50
// Store the task run ID, so we can resume the pipeline when tx is confirmed
if !isMinConfirmationSet {
// Store the task run ID, so we can resume the pipeline when tx is finalized
txRequest.PipelineTaskRunID = &t.uuid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmank88 is PipelineTaskRunID only set during this specific functionality? I'm wondering if there is a case where it's being set for a different reason and the minConfirmations gets executed as a side-effect of that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is PipelineTaskRunID only set during this specific functionality?

Yes

and the minConfirmations gets executed as a side-effect of that.

What do you mean that it "gets executed"? AFAIK this parameter only affects the callback behavior, not confirmation.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm referring to a scenario where PipelineTaskRunID is used by another task/process, but it seems it doesn't.

@dimriou dimriou added this pull request to the merge queue Oct 9, 2024
Merged via the queue into develop with commit dbd42db Oct 9, 2024
130 checks passed
@dimriou dimriou deleted the BCFR-934/remove-finality-depth-as-default-value-for-minConfirmation-and-fix-inconsistency branch October 9, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants