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

Spike: v4 workflow refactor #318

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use v4 workflows in factory
  • Loading branch information
ferglor committed Apr 5, 2024
commit fa230129e31c24dcdb9fa8b9676c395329d560ab
15 changes: 8 additions & 7 deletions pkg/v3/flows/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"log"

ocr2keepersv3 "github.com/smartcontractkit/chainlink-automation/pkg/v3"
conditionalflows "github.com/smartcontractkit/chainlink-automation/pkg/v3/flows/conditional"
logflows "github.com/smartcontractkit/chainlink-automation/pkg/v3/flows/log"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/service"
"github.com/smartcontractkit/chainlink-automation/pkg/v3/types"
conditionalflows "github.com/smartcontractkit/chainlink-automation/pkg/v4/workflows/conditional"
logflows "github.com/smartcontractkit/chainlink-automation/pkg/v4/workflows/log"
recoveryflows "github.com/smartcontractkit/chainlink-automation/pkg/v4/workflows/log/recovery"
common "github.com/smartcontractkit/chainlink-common/pkg/types/automation"
)

Expand All @@ -29,10 +30,10 @@ func NewConditionalTriggerFlows(

// the sampling proposal flow takes random samples of active upkeeps, checks
// them and surfaces the ids if the items are eligible
conditionalProposal := conditionalflows.NewSampleProposalFlow(preprocessors, ratio, getter, metadataStore, runner, logger)
conditionalProposal := conditionalflows.NewConditionalProposalFlow(preprocessors, ratio, getter, metadataStore, runner, logger)

// runs full check pipeline on a coordinated block with coordinated upkeeps
conditionalFinal := conditionalflows.NewFinalConditionalFlow(preprocessors, resultStore, runner, proposalQ, builder, retryQ, stateUpdater, logger)
conditionalFinal := conditionalflows.NewConditionalFinalWorkflow(preprocessors, resultStore, runner, proposalQ, builder, retryQ, logger)

return []service.Recoverable{conditionalProposal, conditionalFinal}
}
Expand All @@ -57,18 +58,18 @@ func NewLogTriggerFlows(
// the log trigger flow is the happy path for log trigger payloads. all
// retryables that are encountered in this flow are elevated to the retry
// flow
logTriggerFlow := logflows.NewLogTriggerFlow(preprocessors, resultStore, runner, logProvider, retryQ, stateUpdater, logger)
logTriggerFlow := logflows.NewLogTriggerFlow(preprocessors, logProvider, retryQ, resultStore, stateUpdater, runner, logger)

// the recovery proposal flow is for nodes to surface payloads that should
// be recovered. these values are passed to the network and the network
// votes on the proposed values
recoveryProposalFlow := logflows.NewRecoveryProposalFlow(preprocessors, runner, metadataStore, rp, stateUpdater, logger)
recoveryProposalFlow := recoveryflows.NewProposalRecoveryFlow(preprocessors, metadataStore, stateUpdater, runner, rp, logger)

// the final recovery flow takes recoverable payloads merged with the latest
// blocks and runs the pipeline for them. these values to run are derived
// from node coordination and it can be assumed that all values should be
// run.
finalRecoveryFlow := logflows.NewFinalRecoveryFlow(preprocessors, resultStore, runner, retryQ, proposals, builder, stateUpdater, logger)
finalRecoveryFlow := recoveryflows.NewFinalRecoveryFlow(preprocessors, resultStore, stateUpdater, retryQ, proposals, builder, runner, logger)

return []service.Recoverable{
logTriggerFlow,
Expand Down