Skip to content

Commit

Permalink
[Automation] Fixes to chaincli for Automation v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vreff committed Sep 7, 2023
1 parent abf2423 commit d6945ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/scripts/chaincli/handler/keeper_deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
ocr2config "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper"
ocr3confighelper "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper"
ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types"
"github.com/umbracle/ethgo/abi"

Expand Down Expand Up @@ -297,19 +298,20 @@ func (d *v21KeeperDeployer) SetKeepers(opts *bind.TransactOpts, cls []cmd.HTTPCl
panic(err)
}

signerOnchainPublicKeys, transmitterAccounts, f, _, offchainConfigVersion, offchainConfig, err := ocr2config.ContractSetConfigArgsForTests(
signerOnchainPublicKeys, transmitterAccounts, f, _, offchainConfigVersion, offchainConfig, err := ocr3confighelper.ContractSetConfigArgsForTests(
5*time.Second, // deltaProgress time.Duration,
10*time.Second, // deltaResend time.Duration,
400*time.Millisecond, // deltaInitial time.Duration,
2500*time.Millisecond, // deltaRound time.Duration,
40*time.Millisecond, // deltaGrace time.Duration,
300*time.Millisecond, // deltaCertifiedCommitRequest time.Duration,
30*time.Second, // deltaStage time.Duration,
50, // rMax uint8,
S, // s []int,
oracleIdentities, // oracles []OracleIdentityExtra,
offC, // reportingPluginConfig []byte,
20*time.Millisecond, // maxDurationQuery time.Duration,
1600*time.Millisecond, // maxDurationObservation time.Duration,
800*time.Millisecond, // maxDurationReport time.Duration,
20*time.Millisecond, // maxDurationShouldAcceptFinalizedReport time.Duration,
20*time.Millisecond, // maxDurationShouldTransmitAcceptedReport time.Duration,
1, // f int,
Expand Down
10 changes: 10 additions & 0 deletions core/scripts/chaincli/handler/keeper_launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ name = "ocr2-automation"
forwardingAllowed = false
schemaVersion = 1
contractID = "%s"
contractConfigTrackerPollInterval = "15s"
ocrKeyBundleID = "%s"
transmitterID = "%s"
p2pv2Bootstrappers = [
Expand All @@ -358,6 +359,8 @@ chainID = %d
[pluginConfig]
maxServiceWorkers = 100
cacheEvictionInterval = "1s"
contractVersion = "%s"
mercuryCredentialName = "%s"`

// createOCR2KeeperJob creates an ocr2keeper job in the chainlink node by the given address
Expand All @@ -367,13 +370,20 @@ func (k *Keeper) createOCR2KeeperJob(client cmd.HTTPClient, contractAddr, nodeAd
return fmt.Errorf("failed to get node OCR2 key bundle ID: %s", err)
}

// Correctly assign contract version in OCR job spec.
var contractVersion string = "v2.0"
if k.cfg.RegistryVersion == keeper.RegistryVersion_2_1 {
contractVersion = "v2.1"
}

request, err := json.Marshal(web.CreateJobRequest{
TOML: fmt.Sprintf(ocr2keeperJobTemplate,
contractAddr, // contractID
ocr2KeyConfig.ID, // ocrKeyBundleID
nodeAddr, // transmitterID - node wallet address
k.cfg.BootstrapNodeAddr, // bootstrap node key and address
k.cfg.ChainID, // chainID
contractVersion, // contractVersion
k.cfg.MercuryCredName, // mercury credential name
),
})
Expand Down

0 comments on commit d6945ac

Please sign in to comment.