From fa5b22773e52744d3abab1a05cd12ecc2e103d88 Mon Sep 17 00:00:00 2001 From: Vyzaldy Sanchez Date: Thu, 25 Apr 2024 13:16:55 -0400 Subject: [PATCH] Add `onchainSigningStrategy` job spec field support (#12909) * Adds `onchainSigningStrategy` job spec field support * Makes changeset internal * Fixes typo and remove unnecessary logs * Stores `onchain_signing_strategy` values in the DB * Fixes test error --- .changeset/olive-knives-happen.md | 5 + core/services/job/job_orm_test.go | 5 + core/services/job/models.go | 1 + core/services/job/models_test.go | 7 + core/services/job/orm.go | 4 +- core/services/job/testdata/compact.toml | 7 + core/services/job/testdata/pretty.toml | 7 + core/services/ocr2/database_test.go | 4 +- core/services/ocr2/delegate.go | 8 + core/services/ocr2/validate/validate.go | 48 +++++ core/services/ocr2/validate/validate_test.go | 169 ++++++++++++++++++ ...4_generic_plugin_multichain_keybundle_.sql | 11 ++ 12 files changed, 272 insertions(+), 4 deletions(-) create mode 100644 .changeset/olive-knives-happen.md create mode 100644 core/store/migrate/migrations/0234_generic_plugin_multichain_keybundle_.sql diff --git a/.changeset/olive-knives-happen.md b/.changeset/olive-knives-happen.md new file mode 100644 index 00000000000..7f522c96ff1 --- /dev/null +++ b/.changeset/olive-knives-happen.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal Generic Plugin `onchainSigningStrategy` support diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index f07b68d9987..3c7d5a7afa5 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -66,6 +66,11 @@ observationSource = """ chainID = 1 fromBlock = 1000 +[onchainSigningStrategy] +strategyName = 'single-chain' +[onchainSigningStrategy.config] +publicKey = '8fa807463ad73f9ee855cfd60ba406dcf98a2855b3dd8af613107b0f6890a707' + [pluginConfig] serverURL = 'wss://localhost:8080' serverPubKey = '8fa807463ad73f9ee855cfd60ba406dcf98a2855b3dd8af613107b0f6890a707' diff --git a/core/services/job/models.go b/core/services/job/models.go index 0c6390b3dbf..3d510efa0d2 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -362,6 +362,7 @@ type OCR2OracleSpec struct { BlockchainTimeout models.Interval `toml:"blockchainTimeout"` ContractConfigTrackerPollInterval models.Interval `toml:"contractConfigTrackerPollInterval"` ContractConfigConfirmations uint16 `toml:"contractConfigConfirmations"` + OnchainSigningStrategy JSONConfig `toml:"onchainSigningStrategy"` PluginConfig JSONConfig `toml:"pluginConfig"` PluginType types.OCR2PluginType `toml:"pluginType"` CreatedAt time.Time `toml:"-"` diff --git a/core/services/job/models_test.go b/core/services/job/models_test.go index 4d10fbb43c4..c177b3b81e1 100644 --- a/core/services/job/models_test.go +++ b/core/services/job/models_test.go @@ -219,6 +219,13 @@ func TestOCR2OracleSpec(t *testing.T) { }, }, }, + OnchainSigningStrategy: map[string]interface{}{ + "strategyName": "single-chain", + "config": map[string]interface{}{ + "evm": "", + "publicKey": "0xdeadbeef", + }, + }, PluginConfig: map[string]interface{}{"juelsPerFeeCoinSource": ` // data source 1 ds1 [type=bridge name="%s"]; ds1_parse [type=jsonparse path="data"]; diff --git a/core/services/job/orm.go b/core/services/job/orm.go index 2b2f73396dc..d87b0204263 100644 --- a/core/services/job/orm.go +++ b/core/services/job/orm.go @@ -461,10 +461,10 @@ func (o *orm) insertOCROracleSpec(ctx context.Context, spec *OCROracleSpec) (spe } func (o *orm) insertOCR2OracleSpec(ctx context.Context, spec *OCR2OracleSpec) (specID int32, err error) { - return o.prepareQuerySpecID(ctx, `INSERT INTO ocr2_oracle_specs (contract_id, feed_id, relay, relay_config, plugin_type, plugin_config, p2pv2_bootstrappers, ocr_key_bundle_id, transmitter_id, + return o.prepareQuerySpecID(ctx, `INSERT INTO ocr2_oracle_specs (contract_id, feed_id, relay, relay_config, plugin_type, plugin_config, onchain_signing_strategy, p2pv2_bootstrappers, ocr_key_bundle_id, transmitter_id, blockchain_timeout, contract_config_tracker_poll_interval, contract_config_confirmations, created_at, updated_at) - VALUES (:contract_id, :feed_id, :relay, :relay_config, :plugin_type, :plugin_config, :p2pv2_bootstrappers, :ocr_key_bundle_id, :transmitter_id, + VALUES (:contract_id, :feed_id, :relay, :relay_config, :plugin_type, :plugin_config, :onchain_signing_strategy, :p2pv2_bootstrappers, :ocr_key_bundle_id, :transmitter_id, :blockchain_timeout, :contract_config_tracker_poll_interval, :contract_config_confirmations, NOW(), NOW()) RETURNING id;`, spec) diff --git a/core/services/job/testdata/compact.toml b/core/services/job/testdata/compact.toml index 9f0f54027d2..5517c69ffa1 100644 --- a/core/services/job/testdata/compact.toml +++ b/core/services/job/testdata/compact.toml @@ -30,5 +30,12 @@ LatestTransmissionDetails = "{\n \"chainSpecificName\": \"latestTransmissionDet [relayConfig.codec.configs.MedianReport] typeABI = "[\n {\n \"Name\": \"Timestamp\",\n \"Type\": \"uint32\"\n },\n {\n \"Name\": \"Observers\",\n \"Type\": \"bytes32\"\n },\n {\n \"Name\": \"Observations\",\n \"Type\": \"int192[]\"\n },\n {\n \"Name\": \"JuelsPerFeeCoin\",\n \"Type\": \"int192\"\n }\n]\n" +[onchainSigningStrategy] +strategyName = 'single-chain' + +[onchainSigningStrategy.config] +evm = '' +publicKey = '0xdeadbeef' + [pluginConfig] juelsPerFeeCoinSource = " // data source 1\n ds1 [type=bridge name=\"%s\"];\n ds1_parse [type=jsonparse path=\"data\"];\n ds1_multiply [type=multiply times=2];\n\n // data source 2\n ds2 [type=http method=GET url=\"%s\"];\n ds2_parse [type=jsonparse path=\"data\"];\n ds2_multiply [type=multiply times=2];\n\n ds1 -> ds1_parse -> ds1_multiply -> answer1;\n ds2 -> ds2_parse -> ds2_multiply -> answer1;\n\n answer1 [type=median index=0];\n" diff --git a/core/services/job/testdata/pretty.toml b/core/services/job/testdata/pretty.toml index 88bacff7db2..1bed3efac0d 100644 --- a/core/services/job/testdata/pretty.toml +++ b/core/services/job/testdata/pretty.toml @@ -130,6 +130,13 @@ typeABI = ''' ] ''' +[onchainSigningStrategy] +strategyName = 'single-chain' + +[onchainSigningStrategy.config] +evm = '' +publicKey = '0xdeadbeef' + [pluginConfig] juelsPerFeeCoinSource = """ // data source 1 diff --git a/core/services/ocr2/database_test.go b/core/services/ocr2/database_test.go index 3e78249d087..3d3eec22a6d 100644 --- a/core/services/ocr2/database_test.go +++ b/core/services/ocr2/database_test.go @@ -40,9 +40,9 @@ func MustInsertOCROracleSpec(t *testing.T, db *sqlx.DB, transmitterAddress types require.NoError(t, db.Get(&spec, `INSERT INTO ocr2_oracle_specs ( relay, relay_config, contract_id, p2pv2_bootstrappers, ocr_key_bundle_id, monitoring_endpoint, transmitter_id, -blockchain_timeout, contract_config_tracker_poll_interval, contract_config_confirmations, plugin_type, plugin_config, created_at, updated_at) VALUES ( +blockchain_timeout, contract_config_tracker_poll_interval, contract_config_confirmations, plugin_type, plugin_config, onchain_signing_strategy, created_at, updated_at) VALUES ( 'ethereum', '{}', $1, '{}', $2, $3, $4, -0, 0, 0, 'median', $5, NOW(), NOW() +0, 0, 0, 'median', $5, '{}', NOW(), NOW() ) RETURNING *`, cltest.NewEIP55Address().String(), cltest.DefaultOCR2KeyBundleID, "chain.link:1234", transmitterAddress.String(), jsonConfig)) return spec } diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index 6c76b0ff9c9..2e623ab5467 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -27,6 +27,7 @@ import ( ocr2keepers21 "github.com/smartcontractkit/chainlink-automation/pkg/v3/plugin" "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins/ocr3" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink/v2/core/config/env" "github.com/smartcontractkit/chainlink-vrf/altbn_128" @@ -539,6 +540,13 @@ func (d *Delegate) newServicesGenericPlugin( if err != nil { return nil, err } + // NOTE: we don't need to validate the strategy, since that happens as part of creating the job. + // See: validate/validate.go's `validateSpec`. + onchainSigningStrategy := validate.OCR2OnchainSigningStrategy{} + err = json.Unmarshal(spec.OnchainSigningStrategy.Bytes(), &onchainSigningStrategy) + if err != nil { + return nil, err + } plugEnv := env.NewPlugin(pCfg.PluginName) diff --git a/core/services/ocr2/validate/validate.go b/core/services/ocr2/validate/validate.go index 59f7053de56..9a85d7993a4 100644 --- a/core/services/ocr2/validate/validate.go +++ b/core/services/ocr2/validate/validate.go @@ -16,6 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins" "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink/v2/core/config/env" "github.com/smartcontractkit/chainlink/v2/core/services/job" dkgconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/dkg/config" @@ -172,6 +173,40 @@ func (o *OCR2GenericPluginConfig) UnmarshalJSON(data []byte) error { return nil } +type onchainSigningStrategyInner struct { + StrategyName string `json:"strategyName"` + Config job.JSONConfig `json:"config"` +} + +type OCR2OnchainSigningStrategy struct { + onchainSigningStrategyInner +} + +func (o *OCR2OnchainSigningStrategy) UnmarshalJSON(data []byte) error { + err := json.Unmarshal(data, &o.onchainSigningStrategyInner) + if err != nil { + return err + } + + return nil +} + +func (o *OCR2OnchainSigningStrategy) IsMultiChain() bool { + return o.StrategyName == "multi-chain" +} + +func (o *OCR2OnchainSigningStrategy) PublicKey() (string, error) { + pk, ok := o.Config["publicKey"] + if !ok { + return "", nil + } + name, ok := pk.(string) + if !ok { + return "", fmt.Errorf("expected string publicKey value, but got: %T", pk) + } + return name, nil +} + func validateGenericPluginSpec(ctx context.Context, spec *job.OCR2OracleSpec, rc plugins.RegistrarConfig) error { p := OCR2GenericPluginConfig{} err := json.Unmarshal(spec.PluginConfig.Bytes(), &p) @@ -187,6 +222,19 @@ func validateGenericPluginSpec(ctx context.Context, spec *job.OCR2OracleSpec, rc return errors.New("generic config invalid: only OCR version 2 and 3 are supported") } + onchainSigningStrategy := OCR2OnchainSigningStrategy{} + err = json.Unmarshal(spec.OnchainSigningStrategy.Bytes(), &onchainSigningStrategy) + if err != nil { + return err + } + pk, err := onchainSigningStrategy.PublicKey() + if err != nil { + return err + } + if pk == "" { + return errors.New("generic config invalid: must provide public key for the onchain signing strategy") + } + plugEnv := env.NewPlugin(p.PluginName) command := p.Command diff --git a/core/services/ocr2/validate/validate_test.go b/core/services/ocr2/validate/validate_test.go index fad5a36e51f..05881187ba4 100644 --- a/core/services/ocr2/validate/validate_test.go +++ b/core/services/ocr2/validate/validate_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/require" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" @@ -44,6 +45,11 @@ answer1 [type=median index=0]; """ [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ ds1 [type=bridge name=voter_turnout]; @@ -66,6 +72,8 @@ answer1 [type=median index=0]; var pc medianconfig.PluginConfig require.NoError(t, json.Unmarshal(r.PluginConfig.Bytes(), &pc)) require.NoError(t, medianconfig.ValidatePluginConfig(pc)) + var oss validate.OCR2OnchainSigningStrategy + require.NoError(t, json.Unmarshal(r.OnchainSigningStrategy.Bytes(), &oss)) }, }, { @@ -93,6 +101,11 @@ answer1 [type=median index=0]; """ [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ ds1 [type=bridge name=voter_turnout]; @@ -133,6 +146,11 @@ answer1 [type=median index=0]; """ [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -152,6 +170,11 @@ p2pPeerID = "12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq" p2pv2Bootstrappers = [] [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -173,6 +196,11 @@ observationSource = """ """ [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -194,6 +222,11 @@ blah """ [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -216,6 +249,11 @@ blah """ [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -237,6 +275,11 @@ blah """ [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -256,6 +299,11 @@ p2pv2Bootstrappers = [] monitoringEndpoint = "\t/fd\2ff )(*&^%$#@" [relayConfig] chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -292,6 +340,11 @@ ds1_multiply [type=multiply times=1.23]; ds1 -> ds1_parse -> ds1_multiply -> answer1; answer1 [type=median index=0]; """ +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ ds1 [type=bridge name=voter_turnout]; @@ -326,6 +379,11 @@ ds1_multiply [type=multiply times=1.23]; ds1 -> ds1_parse -> ds1_multiply -> answer1; answer1 [type=median index=0]; """ +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ -> @@ -353,6 +411,11 @@ ds1_multiply [type=multiply times=1.23]; ds1 -> ds1_parse -> ds1_multiply -> answer1; answer1 [type=median index=0]; """ +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" [pluginConfig] juelsPerFeeCoinSource = """ ds1 [type=bridge name=voter_turnout]; @@ -386,6 +449,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] EncryptionPublicKey = "0e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b106069c" SigningPublicKey = "eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc2432b1" @@ -415,6 +484,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] EncryptionPublicKey = "frog" SigningPublicKey = "eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc2432b1" @@ -446,6 +521,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] EncryptionPublicKey = "0e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b10606" SigningPublicKey = "eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc2432b1" @@ -477,6 +558,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] EncryptionPublicKey = "0e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b106069c" SigningPublicKey = "frog" @@ -508,6 +595,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] EncryptionPublicKey = "0e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b106069c" SigningPublicKey = "eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc24" @@ -539,6 +632,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] EncryptionPublicKey = "0e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b106069c" SigningPublicKey = "eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc2432b1" @@ -570,6 +669,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] EncryptionPublicKey = "0e86e8cf899ae9a1b43e023bbe8825b103659bb8d6d4e54f6a3cfae7b106069c" SigningPublicKey = "eb62dbd2beb7c1524275a8019022f6ce6a7e86c9e65e3099452a2b96fc2432b1" @@ -581,6 +686,46 @@ KeyID = "6f3b82406688b8ddb944c6f2e6d808f014c8fa8d568d639c25019568c require.Contains(t, err.Error(), "validation error for keyID") }, }, + { + name: "Generic public onchain signing strategy with no public key", + toml: ` +type = "offchainreporting2" +pluginType = "plugin" +schemaVersion = 1 +relay = "evm" +contractID = "0x613a38AC1659769640aaE063C651F48E0250454C" +p2pPeerID = "12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq" +p2pv2Bootstrappers = [ +"12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq@127.0.0.1:5001", +] +ocrKeyBundleID = "73e8966a78ca09bb912e9565cfb79fbe8a6048fab1f0cf49b18047c3895e0447" +monitoringEndpoint = "chain.link:4321" +transmitterID = "0xF67D0290337bca0847005C7ffD1BC75BA9AAE6e4" +observationTimeout = "10s" +observationSource = """ +ds1 [type=bridge name=voter_turnout]; +ds1_parse [type=jsonparse path="one,two"]; +ds1_multiply [type=multiply times=1.23]; +ds1 -> ds1_parse -> ds1_multiply -> answer1; +answer1 [type=median index=0]; +""" +[relayConfig] +chainID = 1337 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "" +[pluginConfig] +pluginName = "median" +telemetryType = "median" +OCRVersion=2 +`, + assertion: func(t *testing.T, os job.Job, err error) { + require.Error(t, err) + require.Contains(t, err.Error(), "must provide public key for the onchain signing strategy") + }, + }, { name: "Generic plugin config validation - nothing provided", toml: ` @@ -601,6 +746,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] `, assertion: func(t *testing.T, os job.Job, err error) { @@ -627,6 +778,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] PluginName="some random name" `, @@ -655,6 +812,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] PluginName="some random name" OCRVersion=2 @@ -684,6 +847,12 @@ transmitterID = "0x74103Cf8b436465870b26aa9Fa2F62AD62b22E35" [relayConfig] chainID = 4 +[onchainSigningStrategy] +strategyName = "single-chain" +[onchainSigningStrategy.config] +evm = "" +publicKey = "0x1234567890123456789012345678901234567890" + [pluginConfig] PluginName="some random name" OCRVersion=2 diff --git a/core/store/migrate/migrations/0234_generic_plugin_multichain_keybundle_.sql b/core/store/migrate/migrations/0234_generic_plugin_multichain_keybundle_.sql new file mode 100644 index 00000000000..b29ff9de382 --- /dev/null +++ b/core/store/migrate/migrations/0234_generic_plugin_multichain_keybundle_.sql @@ -0,0 +1,11 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE ocr2_oracle_specs + ADD COLUMN onchain_signing_strategy JSONB NOT NULL DEFAULT '{}'; +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +ALTER TABLE ocr2_oracle_specs + DROP COLUMN onchain_signing_strategy; +-- +goose StatementEnd \ No newline at end of file