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

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brave-ads-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Remove finality depth as the default value for minConfirmation for tx jobs. Fixing user provided zero value case. #external
11 changes: 3 additions & 8 deletions core/services/pipeline/task.eth_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,7 @@ func (t *ETHTxTask) Run(ctx context.Context, lggr logger.Logger, vars Vars, inpu
if err != nil {
return Result{Error: err}, runInfo
}
var minOutgoingConfirmations uint64
if min, isSet := maybeMinConfirmations.Uint64(); isSet {
minOutgoingConfirmations = min
} else {
minOutgoingConfirmations = uint64(cfg.FinalityDepth())
}
minOutgoingConfirmations, isMinConfirmationSet := maybeMinConfirmations.Uint64()

txMeta, err := decodeMeta(txMetaMap)
if err != nil {
Expand Down Expand Up @@ -159,7 +154,7 @@ func (t *ETHTxTask) Run(ctx context.Context, lggr logger.Logger, vars Vars, inpu
SignalCallback: true,
}

if minOutgoingConfirmations > 0 {
if isMinConfirmationSet {
// Store the task run ID, so we can resume the pipeline when tx is confirmed
txRequest.PipelineTaskRunID = &t.uuid
txRequest.MinConfirmations = clnull.Uint32From(uint32(minOutgoingConfirmations))
Expand All @@ -170,7 +165,7 @@ func (t *ETHTxTask) Run(ctx context.Context, lggr logger.Logger, vars Vars, inpu
return Result{Error: errors.Wrapf(ErrTaskRunFailed, "while creating transaction: %v", err)}, retryableRunInfo()
}

if minOutgoingConfirmations > 0 {
if isMinConfirmationSet {
return Result{}, pendingRunInfo()
}

Expand Down
Loading