From 74af632bc891eb2d1e3f37ce72a842c9e453f330 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Sun, 15 Feb 2026 16:11:39 +0100 Subject: [PATCH 01/11] Minor. --- core/cmd/vrf_keys_commands.go | 2 +- core/scripts/vrfv2/genvrfnum/main.go | 2 +- .../vrfv2/testnet/v2scripts/super_scripts.go | 2 +- .../testnet/v2plusscripts/super_scripts.go | 2 +- core/services/job/models.go | 2 +- core/services/keystore/keys/vrfkey/crypto.go | 3 +- core/services/keystore/keys/vrfkey/export.go | 2 +- core/services/keystore/keys/vrfkey/key_v2.go | 2 +- .../keystore/keys/vrfkey/key_v2_test.go | 2 +- core/services/keystore/keys/vrfkey/models.go | 2 +- core/services/keystore/keys/vrfkey/proof.go | 3 +- .../keys/vrfkey/secp256k1/crypto_test.go | 30 +++++++++++++++++++ .../keys/vrfkey}/secp256k1/curve.go | 0 .../keys/vrfkey}/secp256k1/curve_test.go | 0 .../keys/vrfkey}/secp256k1/field.go | 0 .../keys/vrfkey}/secp256k1/field_test.go | 14 ++++----- .../keys/vrfkey}/secp256k1/point.go | 0 .../keys/vrfkey}/secp256k1/point_test.go | 4 +-- .../keys/vrfkey}/secp256k1/public_key.go | 0 .../keys/vrfkey}/secp256k1/public_key_test.go | 4 +-- .../keys/vrfkey}/secp256k1/scalar.go | 0 .../keys/vrfkey}/secp256k1/scalar_test.go | 4 +-- .../keys/vrfkey}/secp256k1/suite.go | 0 .../keys/vrfkey}/secp256k1/suite_test.go | 0 core/services/pipeline/task.vrf.go | 2 +- core/services/pipeline/task.vrfv2.go | 2 +- core/services/pipeline/task.vrfv2plus.go | 2 +- core/services/signatures/ethdss/ethdss.go | 6 ++-- .../services/signatures/ethdss/ethdss_test.go | 8 ++--- .../signatures/ethschnorr/ethschnorr.go | 4 +-- .../signatures/ethschnorr/ethschnorr_test.go | 2 +- core/services/vrf/delegate_test.go | 2 +- core/services/vrf/proof/proof_response.go | 2 +- core/services/vrf/proof/solidity_proof.go | 2 +- ...rf_coordinator_solidity_crosscheck_test.go | 2 +- .../vrf_hash_to_curve_cost_test.go | 2 +- .../vrf_randomness_output_cost_test.go | 2 +- .../vrf_solidity_crosscheck_test.go | 2 +- .../vrf_v08_solidity_crosscheck_test.go | 2 +- core/services/vrf/v1/integration_test.go | 2 +- core/services/vrf/v2/integration_v2_test.go | 2 +- core/services/vrf/vrfcommon/validate.go | 2 +- core/web/presenters/job.go | 2 +- core/web/presenters/job_test.go | 2 +- core/web/resolver/spec_test.go | 2 +- 45 files changed, 76 insertions(+), 58 deletions(-) create mode 100644 core/services/keystore/keys/vrfkey/secp256k1/crypto_test.go rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/curve.go (100%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/curve_test.go (100%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/field.go (100%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/field_test.go (94%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/point.go (100%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/point_test.go (97%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/public_key.go (100%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/public_key_test.go (91%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/scalar.go (100%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/scalar_test.go (97%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/suite.go (100%) rename core/services/{signatures => keystore/keys/vrfkey}/secp256k1/suite_test.go (100%) diff --git a/core/cmd/vrf_keys_commands.go b/core/cmd/vrf_keys_commands.go index 30bc1ff1f0a..a87ab4f87ea 100644 --- a/core/cmd/vrf_keys_commands.go +++ b/core/cmd/vrf_keys_commands.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" "github.com/urfave/cli" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/scripts/vrfv2/genvrfnum/main.go b/core/scripts/vrfv2/genvrfnum/main.go index cf37d2940d2..18bc9ee3964 100644 --- a/core/scripts/vrfv2/genvrfnum/main.go +++ b/core/scripts/vrfv2/genvrfnum/main.go @@ -20,7 +20,7 @@ import ( evmutils "github.com/smartcontractkit/chainlink-evm/pkg/utils" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go b/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go index 70582d8f613..9ce961a0301 100644 --- a/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go +++ b/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go @@ -26,7 +26,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_owner" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) type CoordinatorConfigV2 struct { diff --git a/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go b/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go index cc8af2eb8ce..4e702b9f650 100644 --- a/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go +++ b/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go @@ -33,7 +33,7 @@ import ( evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/job/models.go b/core/services/job/models.go index 309c399a674..d6a39ea27e0 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -28,9 +28,9 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/bridges" clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/relay" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils/stringutils" "github.com/smartcontractkit/chainlink/v2/core/utils/tomlutils" diff --git a/core/services/keystore/keys/vrfkey/crypto.go b/core/services/keystore/keys/vrfkey/crypto.go index 5fb25884c34..29607dfc039 100644 --- a/core/services/keystore/keys/vrfkey/crypto.go +++ b/core/services/keystore/keys/vrfkey/crypto.go @@ -11,8 +11,7 @@ import ( bm "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) // This file contains golang re-implementations of functions on the VRF solidity diff --git a/core/services/keystore/keys/vrfkey/export.go b/core/services/keystore/keys/vrfkey/export.go index ec70c30a216..4ed9d601b4c 100644 --- a/core/services/keystore/keys/vrfkey/export.go +++ b/core/services/keystore/keys/vrfkey/export.go @@ -10,7 +10,7 @@ import ( commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) func FromEncryptedJSON(keyJSON []byte, password string) (KeyV2, error) { diff --git a/core/services/keystore/keys/vrfkey/key_v2.go b/core/services/keystore/keys/vrfkey/key_v2.go index 16e2d0f3919..e0cecc0ccb8 100644 --- a/core/services/keystore/keys/vrfkey/key_v2.go +++ b/core/services/keystore/keys/vrfkey/key_v2.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) var suite = secp256k1.NewBlakeKeccackSecp256k1() diff --git a/core/services/keystore/keys/vrfkey/key_v2_test.go b/core/services/keystore/keys/vrfkey/key_v2_test.go index 82754444f9d..c4fa6097d00 100644 --- a/core/services/keystore/keys/vrfkey/key_v2_test.go +++ b/core/services/keystore/keys/vrfkey/key_v2_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) func TestVRFKeys_KeyV2(t *testing.T) { diff --git a/core/services/keystore/keys/vrfkey/models.go b/core/services/keystore/keys/vrfkey/models.go index a72d29f85da..23c484a9a4e 100644 --- a/core/services/keystore/keys/vrfkey/models.go +++ b/core/services/keystore/keys/vrfkey/models.go @@ -10,7 +10,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/keystore/keys/vrfkey/proof.go b/core/services/keystore/keys/vrfkey/proof.go index cf3bcd2c15c..c6a819b5ff7 100644 --- a/core/services/keystore/keys/vrfkey/proof.go +++ b/core/services/keystore/keys/vrfkey/proof.go @@ -9,8 +9,7 @@ import ( bm "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) // Proof represents a proof that Gamma was constructed from the Seed diff --git a/core/services/keystore/keys/vrfkey/secp256k1/crypto_test.go b/core/services/keystore/keys/vrfkey/secp256k1/crypto_test.go new file mode 100644 index 00000000000..475ca5991df --- /dev/null +++ b/core/services/keystore/keys/vrfkey/secp256k1/crypto_test.go @@ -0,0 +1,30 @@ +package secp256k1 + +import ( + "math/rand" + "testing" +) + +// randomStream implements cipher.Stream, but with a deterministic output. +type randomStream rand.Rand + +// NewStream returns a randomStream seeded from seed, for deterministic +// randomness in tests of random outputs, and for small property-based tests. +// +// This API is deliberately awkward to prevent it from being used outside of +// tests. +// +// The testing framework runs the tests in a file in series, unless you +// explicitly request otherwise with testing.T.Parallel(). So one such stream +// per file is enough, most of the time. +func NewStream(t *testing.T, seed int64) *randomStream { + return (*randomStream)(rand.New(rand.NewSource(seed))) +} + +// XORKeyStream dumps the output from a math/rand PRNG on dst. +// +// It gives no consideration for the contents of src, and is named so +// misleadingly purely to satisfy the cipher.Stream interface. +func (s *randomStream) XORKeyStream(dst, src []byte) { + (*rand.Rand)(s).Read(dst) +} diff --git a/core/services/signatures/secp256k1/curve.go b/core/services/keystore/keys/vrfkey/secp256k1/curve.go similarity index 100% rename from core/services/signatures/secp256k1/curve.go rename to core/services/keystore/keys/vrfkey/secp256k1/curve.go diff --git a/core/services/signatures/secp256k1/curve_test.go b/core/services/keystore/keys/vrfkey/secp256k1/curve_test.go similarity index 100% rename from core/services/signatures/secp256k1/curve_test.go rename to core/services/keystore/keys/vrfkey/secp256k1/curve_test.go diff --git a/core/services/signatures/secp256k1/field.go b/core/services/keystore/keys/vrfkey/secp256k1/field.go similarity index 100% rename from core/services/signatures/secp256k1/field.go rename to core/services/keystore/keys/vrfkey/secp256k1/field.go diff --git a/core/services/signatures/secp256k1/field_test.go b/core/services/keystore/keys/vrfkey/secp256k1/field_test.go similarity index 94% rename from core/services/signatures/secp256k1/field_test.go rename to core/services/keystore/keys/vrfkey/secp256k1/field_test.go index 70c4f15d2fe..a3b3a9085dd 100644 --- a/core/services/signatures/secp256k1/field_test.go +++ b/core/services/keystore/keys/vrfkey/secp256k1/field_test.go @@ -7,8 +7,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" ) var numFieldSamples = 10 @@ -27,8 +25,6 @@ func observedFieldElt(t *testing.T, s *fieldElt) { observedFieldElts[data] = true } -var randomStream = cryptotest.NewStream(&testing.T{}, 0) - func TestField_SetIntAndEqual(t *testing.T) { tests := []int64{5, 67108864, 67108865, 4294967295} g := newFieldZero() @@ -72,7 +68,7 @@ func TestFieldEltFromInt(t *testing.T) { func TestField_SmokeTestPick(t *testing.T) { f := newFieldZero() - f.Pick(randomStream) + f.Pick(randomStreamPoint) observedFieldElt(t, f) assert.Equal(t, 1, f.int().Cmp(big.NewInt(1000000000)), "should be greater than 1000000000, with very high probability") @@ -81,7 +77,7 @@ func TestField_SmokeTestPick(t *testing.T) { func TestField_Neg(t *testing.T) { f := newFieldZero() for range numFieldSamples { - f.Pick(randomStream) + f.Pick(randomStreamPoint) observedFieldElt(t, f) g := f.Clone() g.Neg(g) @@ -94,7 +90,7 @@ func TestField_Neg(t *testing.T) { func TestField_Sub(t *testing.T) { f := newFieldZero() for range numFieldSamples { - f.Pick(randomStream) + f.Pick(randomStreamPoint) observedFieldElt(t, f) require.True(t, f.Sub(f, f).Equal(fieldZero), "subtracting something from itself should give zero: "+ @@ -115,7 +111,7 @@ func TestField_SetBytesAndBytes(t *testing.T) { f := newFieldZero() g := newFieldZero() for range numFieldSamples { - f.Pick(randomStream) + f.Pick(randomStreamPoint) observedFieldElt(t, f) g.SetBytes(f.Bytes()) require.True(t, g.Equal(f), @@ -129,7 +125,7 @@ func TestField_MaybeSquareRootInField(t *testing.T) { minusOne := fieldEltFromInt(-1) assert.Nil(t, maybeSqrtInField(minusOne), "-1 is not a square, in this field") for range numFieldSamples { - f.Pick(randomStream) + f.Pick(randomStreamPoint) observedFieldElt(t, f) require.Equal(t, -1, f.int().Cmp(q), "picked larger value than q: %s", f) require.NotEqual(t, -1, f.int().Cmp(big.NewInt(-1)), diff --git a/core/services/signatures/secp256k1/point.go b/core/services/keystore/keys/vrfkey/secp256k1/point.go similarity index 100% rename from core/services/signatures/secp256k1/point.go rename to core/services/keystore/keys/vrfkey/secp256k1/point.go diff --git a/core/services/signatures/secp256k1/point_test.go b/core/services/keystore/keys/vrfkey/secp256k1/point_test.go similarity index 97% rename from core/services/signatures/secp256k1/point_test.go rename to core/services/keystore/keys/vrfkey/secp256k1/point_test.go index b415825d0bd..5558647e72e 100644 --- a/core/services/signatures/secp256k1/point_test.go +++ b/core/services/keystore/keys/vrfkey/secp256k1/point_test.go @@ -11,13 +11,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" ) var numPointSamples = 10 -var randomStreamPoint = cryptotest.NewStream(&testing.T{}, 0) +var randomStreamPoint = NewStream(&testing.T{}, 0) func TestPoint_String(t *testing.T) { require.Equal(t, "Secp256k1{X: fieldElt{0}, Y: fieldElt{0}}", newPoint().String()) diff --git a/core/services/signatures/secp256k1/public_key.go b/core/services/keystore/keys/vrfkey/secp256k1/public_key.go similarity index 100% rename from core/services/signatures/secp256k1/public_key.go rename to core/services/keystore/keys/vrfkey/secp256k1/public_key.go diff --git a/core/services/signatures/secp256k1/public_key_test.go b/core/services/keystore/keys/vrfkey/secp256k1/public_key_test.go similarity index 91% rename from core/services/signatures/secp256k1/public_key_test.go rename to core/services/keystore/keys/vrfkey/secp256k1/public_key_test.go index 428aba2e7ad..79758918b97 100644 --- a/core/services/signatures/secp256k1/public_key_test.go +++ b/core/services/keystore/keys/vrfkey/secp256k1/public_key_test.go @@ -3,14 +3,12 @@ package secp256k1 import ( "testing" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestValueScanIdentityPointSet(t *testing.T) { - randomStream := cryptotest.NewStream(t, 0) + randomStream := NewStream(t, 0) for range 10 { p := NewBlakeKeccackSecp256k1().Point().Pick(randomStream) var pk, nPk, nnPk PublicKey diff --git a/core/services/signatures/secp256k1/scalar.go b/core/services/keystore/keys/vrfkey/secp256k1/scalar.go similarity index 100% rename from core/services/signatures/secp256k1/scalar.go rename to core/services/keystore/keys/vrfkey/secp256k1/scalar.go diff --git a/core/services/signatures/secp256k1/scalar_test.go b/core/services/keystore/keys/vrfkey/secp256k1/scalar_test.go similarity index 97% rename from core/services/signatures/secp256k1/scalar_test.go rename to core/services/keystore/keys/vrfkey/secp256k1/scalar_test.go index 266db370263..be36a7056e8 100644 --- a/core/services/signatures/secp256k1/scalar_test.go +++ b/core/services/keystore/keys/vrfkey/secp256k1/scalar_test.go @@ -11,8 +11,6 @@ import ( "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/group/curve25519" - - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" ) var numScalarSamples = 10 @@ -32,7 +30,7 @@ func observedScalar(t *testing.T, s kyber.Scalar) { observedScalars[scalar] = true } -var randomStreamScalar = cryptotest.NewStream(&testing.T{}, 0) +var randomStreamScalar = NewStream(&testing.T{}, 0) func TestScalar_SetAndEqual(t *testing.T) { tests := []int64{5, 67108864, 67108865, 4294967295} diff --git a/core/services/signatures/secp256k1/suite.go b/core/services/keystore/keys/vrfkey/secp256k1/suite.go similarity index 100% rename from core/services/signatures/secp256k1/suite.go rename to core/services/keystore/keys/vrfkey/secp256k1/suite.go diff --git a/core/services/signatures/secp256k1/suite_test.go b/core/services/keystore/keys/vrfkey/secp256k1/suite_test.go similarity index 100% rename from core/services/signatures/secp256k1/suite_test.go rename to core/services/keystore/keys/vrfkey/secp256k1/suite_test.go diff --git a/core/services/pipeline/task.vrf.go b/core/services/pipeline/task.vrf.go index 682c94df28a..3873a12f780 100644 --- a/core/services/pipeline/task.vrf.go +++ b/core/services/pipeline/task.vrf.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/pipeline/task.vrfv2.go b/core/services/pipeline/task.vrfv2.go index 00880ab188c..04a603bbcc9 100644 --- a/core/services/pipeline/task.vrfv2.go +++ b/core/services/pipeline/task.vrfv2.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/pipeline/task.vrfv2plus.go b/core/services/pipeline/task.vrfv2plus.go index 94e11908ab0..afbaffc9384 100644 --- a/core/services/pipeline/task.vrfv2plus.go +++ b/core/services/pipeline/task.vrfv2plus.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2plus_interface" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/signatures/ethdss/ethdss.go b/core/services/signatures/ethdss/ethdss.go index 7d850ee9b98..55e7c4d1172 100644 --- a/core/services/signatures/ethdss/ethdss.go +++ b/core/services/signatures/ethdss/ethdss.go @@ -25,11 +25,11 @@ import ( "errors" "math/big" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/ethschnorr" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" - "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/share" + + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/signatures/ethschnorr" ) // Suite represents the functionalities needed by the dss package diff --git a/core/services/signatures/ethdss/ethdss_test.go b/core/services/signatures/ethdss/ethdss_test.go index 59e1b084896..5f7b38130f9 100644 --- a/core/services/signatures/ethdss/ethdss_test.go +++ b/core/services/signatures/ethdss/ethdss_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/ethschnorr" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" - "go.dedis.ch/kyber/v3" dkg "go.dedis.ch/kyber/v3/share/dkg/rabin" + + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" + "github.com/smartcontractkit/chainlink/v2/core/services/signatures/ethschnorr" ) var suite = secp256k1.NewBlakeKeccackSecp256k1() diff --git a/core/services/signatures/ethschnorr/ethschnorr.go b/core/services/signatures/ethschnorr/ethschnorr.go index 63af14ff71b..b6517cf2ec9 100644 --- a/core/services/signatures/ethschnorr/ethschnorr.go +++ b/core/services/signatures/ethschnorr/ethschnorr.go @@ -22,9 +22,9 @@ import ( "fmt" "math/big" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" - "go.dedis.ch/kyber/v3" + + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) var secp256k1Suite = secp256k1.NewBlakeKeccackSecp256k1() diff --git a/core/services/signatures/ethschnorr/ethschnorr_test.go b/core/services/signatures/ethschnorr/ethschnorr_test.go index 3d3bce3b7e6..ca2513fc188 100644 --- a/core/services/signatures/ethschnorr/ethschnorr_test.go +++ b/core/services/signatures/ethschnorr/ethschnorr_test.go @@ -14,8 +14,8 @@ import ( "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/group/curve25519" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" ) var numSignatures = 5 diff --git a/core/services/vrf/delegate_test.go b/core/services/vrf/delegate_test.go index cf1ab973a8f..d8324ff9d72 100644 --- a/core/services/vrf/delegate_test.go +++ b/core/services/vrf/delegate_test.go @@ -41,8 +41,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf" vrf_mocks "github.com/smartcontractkit/chainlink/v2/core/services/vrf/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/solidity_cross_tests" diff --git a/core/services/vrf/proof/proof_response.go b/core/services/vrf/proof/proof_response.go index 63dcc475d85..923ce176325 100644 --- a/core/services/vrf/proof/proof_response.go +++ b/core/services/vrf/proof/proof_response.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) // ProofResponse is the data which is sent back to the VRFCoordinator, so that diff --git a/core/services/vrf/proof/solidity_proof.go b/core/services/vrf/proof/solidity_proof.go index 03acb22a225..c6a84ef6bf0 100644 --- a/core/services/vrf/proof/solidity_proof.go +++ b/core/services/vrf/proof/solidity_proof.go @@ -15,7 +15,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) // SolidityProof contains precalculations which VRF.sol needs to verify proofs diff --git a/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go index 32f4f18f491..5455143daa3 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go @@ -11,7 +11,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" proof2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/solidity_cross_tests" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" diff --git a/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go b/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go index fcf3b574c41..1eafcf1d2d1 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go @@ -23,7 +23,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) type contract struct { diff --git a/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go b/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go index d62e28a49d7..ecc860dc4e6 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) func TestMeasureRandomValueFromVRFProofGasCost(t *testing.T) { diff --git a/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go index 667a8ce05ea..94c93db036d 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go @@ -21,7 +21,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" proof2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go index 078bba47637..6766cf87b37 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go @@ -8,6 +8,7 @@ import ( gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/solidity_vrf_v08_verifier_wrapper" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" proof2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" "github.com/ethereum/go-ethereum/eth/ethconfig" @@ -21,7 +22,6 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" ) // Note these tests are identical to the ones in vrf_solidity_crosscheck_test.go, diff --git a/core/services/vrf/v1/integration_test.go b/core/services/vrf/v1/integration_test.go index 0aba0e8d17d..691bb343ccf 100644 --- a/core/services/vrf/v1/integration_test.go +++ b/core/services/vrf/v1/integration_test.go @@ -25,8 +25,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index 790542dc4b4..a28b5e400e1 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -76,8 +76,8 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" v1 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v1" v22 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2" diff --git a/core/services/vrf/vrfcommon/validate.go b/core/services/vrf/vrfcommon/validate.go index 4220fa39994..f2357b86b55 100644 --- a/core/services/vrf/vrfcommon/validate.go +++ b/core/services/vrf/vrfcommon/validate.go @@ -11,8 +11,8 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" ) var ( diff --git a/core/web/presenters/job.go b/core/web/presenters/job.go index f31980fc141..3d8e061c866 100644 --- a/core/web/presenters/job.go +++ b/core/web/presenters/job.go @@ -16,8 +16,8 @@ import ( clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) diff --git a/core/web/presenters/job_test.go b/core/web/presenters/job_test.go index 1d7f16932c3..1327476f17f 100644 --- a/core/web/presenters/job_test.go +++ b/core/web/presenters/job_test.go @@ -20,8 +20,8 @@ import ( clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/resolver/spec_test.go b/core/web/resolver/spec_test.go index 09e3b64910c..d7a595a5004 100644 --- a/core/web/resolver/spec_test.go +++ b/core/web/resolver/spec_test.go @@ -21,8 +21,8 @@ import ( evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/relay" - "github.com/smartcontractkit/chainlink/v2/core/services/signatures/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) From b5ad4ce5648138669f0c2ea7d53d09d62ce5cb1f Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Sun, 15 Feb 2026 17:53:34 +0100 Subject: [PATCH 02/11] Minor. # Conflicts: # core/scripts/go.mod # core/services/blockhashstore/delegate_test.go # core/services/keystore/keys/ethkey/models.go # core/services/ocr2/plugins/ocr2keeper/integration_test.go # core/web/presenters/eth_key.go # core/web/presenters/eth_key_test.go # core/web/presenters/job.go # core/web/resolver/eth_key_test.go # deployment/go.mod # go.mod # integration-tests/go.mod # integration-tests/load/go.mod # system-tests/lib/go.mod # system-tests/tests/go.mod --- .../integrationhelpers/integration_helpers.go | 2 +- .../ccip/configs/sui/contract_reader.go | 2 +- core/capabilities/ccip/delegate.go | 4 +- core/capabilities/ccip/launcher/diff_test.go | 2 +- .../ccip/launcher/launcher_test.go | 2 +- .../ccip/launcher/test_helpers.go | 2 +- .../ccip/ocrimpls/contract_transmitter.go | 2 +- .../ocrimpls/contract_transmitter_test.go | 2 +- core/capabilities/ccip/ocrimpls/keyring.go | 2 +- .../ccip/oraclecreator/create_test.go | 4 +- .../capabilities/ccip/oraclecreator/plugin.go | 4 +- .../ccip/oraclecreator/plugin_test.go | 2 +- core/capabilities/fakes/consensus_nodag.go | 2 +- .../fakes/consensus_nodag_test.go | 2 +- core/capabilities/fakes/streams_trigger.go | 2 +- .../gateway_connector/service_wrapper.go | 2 +- .../gateway_connector/service_wrapper_test.go | 2 +- .../integration_tests/framework/don.go | 6 +- .../framework/don_configuration.go | 6 +- .../framework/fake_libocr.go | 2 +- .../integration_tests/framework/peer.go | 4 +- .../keystone/llo_feed_test.go | 2 +- .../integration_tests/keystone/setup.go | 2 +- .../remote/aggregation/signed_report.go | 2 +- .../remote/aggregation/signed_report_test.go | 2 +- core/capabilities/streams/codec_test.go | 2 +- core/capabilities/streams/trigger_test.go | 2 +- core/capabilities/vault/vaulttypes/types.go | 2 +- core/cmd/aptos_keys_commands.go | 2 +- core/cmd/aptos_keys_commands_test.go | 2 +- core/cmd/cosmos_keys_commands.go | 2 +- core/cmd/cosmos_keys_commands_test.go | 2 +- core/cmd/csa_keys_commands_test.go | 2 +- core/cmd/ocr2_keys_commands.go | 3 +- core/cmd/ocr2_keys_commands_test.go | 2 +- core/cmd/ocr_keys_commands.go | 4 +- core/cmd/ocr_keys_commands_test.go | 2 +- core/cmd/p2p_keys_commands_test.go | 2 +- core/cmd/solana_keys_commands.go | 2 +- core/cmd/solana_keys_commands_test.go | 2 +- core/cmd/starknet_keys_commands.go | 2 +- core/cmd/starknet_keys_commands_test.go | 2 +- core/cmd/sui_keys_commands.go | 2 +- core/cmd/sui_keys_commands_test.go | 2 +- core/cmd/ton_keys_commands.go | 2 +- core/cmd/ton_keys_commands_test.go | 2 +- core/cmd/tron_keys_commands.go | 2 +- core/cmd/tron_keys_commands_test.go | 2 +- core/cmd/vrf_keys_commands.go | 2 +- core/config/p2p_config.go | 2 +- core/config/toml/types.go | 8 +- core/internal/cltest/cltest.go | 26 +- core/internal/cltest/factories.go | 4 +- core/internal/cltest/job_factories.go | 2 +- core/internal/features/features_test.go | 4 +- .../features/ocr2/features_ocr2_helper.go | 4 +- .../features/ocr2/features_ocr2_test.go | 2 +- .../scripts/chaincli/handler/keeper_launch.go | 2 +- core/scripts/go.sum | 1 + core/scripts/vrfv2/genvrfnum/main.go | 4 +- .../vrfv2/testnet/v2scripts/super_scripts.go | 2 +- core/scripts/vrfv2plus/testnet/proofs.go | 2 +- .../testnet/v2plusscripts/super_scripts.go | 4 +- .../ccv/ccvcommitteeverifier/delegate.go | 2 +- core/services/chainlink/config_general.go | 6 +- core/services/chainlink/config_p2p.go | 2 +- core/services/chainlink/config_test.go | 4 +- core/services/feeds/service.go | 4 +- core/services/feeds/service_test.go | 8 +- .../fluxmonitorv2/flux_monitor_test.go | 2 +- .../fluxmonitorv2/integrations_test.go | 2 +- core/services/fluxmonitorv2/key_store.go | 2 +- .../mocks/key_store_interface.go | 2 +- core/services/job/job_orm_test.go | 2 +- core/services/job/models.go | 6 +- core/services/job/orm.go | 4 +- core/services/job/runner_integration_test.go | 2 +- core/services/keystore/aptos.go | 2 +- core/services/keystore/aptos_test.go | 4 +- core/services/keystore/cosmos.go | 2 +- core/services/keystore/cosmos_test.go | 4 +- core/services/keystore/csa.go | 2 +- core/services/keystore/csa_test.go | 2 +- core/services/keystore/dkg_recipient.go | 2 +- core/services/keystore/dkgrecipient_test.go | 4 +- core/services/keystore/eth.go | 2 +- core/services/keystore/eth_test.go | 4 +- core/services/keystore/helpers_test.go | 2 +- .../services/keystore/internal/exportutils.go | 84 ---- core/services/keystore/internal/raw.go | 30 -- core/services/keystore/internal/raw_test.go | 33 -- .../services/keystore/keys/aptoskey/export.go | 47 --- .../keystore/keys/aptoskey/export_test.go | 19 - core/services/keystore/keys/aptoskey/key.go | 87 ---- .../keystore/keys/aptoskey/key_test.go | 19 - .../keystore/keys/cosmoskey/export.go | 47 --- .../keystore/keys/cosmoskey/export_test.go | 19 - core/services/keystore/keys/cosmoskey/key.go | 78 ---- core/services/keystore/keys/csakey/export.go | 43 -- .../keystore/keys/csakey/export_test.go | 19 - core/services/keystore/keys/csakey/key_v2.go | 83 ---- .../keystore/keys/csakey/key_v2_test.go | 32 -- .../keystore/keys/dkgrecipientkey/export.go | 43 -- .../keystore/keys/dkgrecipientkey/key.go | 61 --- .../keystore/keys/dkgrecipientkey/key_test.go | 87 ---- core/services/keystore/keys/ethkey/export.go | 23 -- .../keystore/keys/ethkey/export_test.go | 18 - core/services/keystore/keys/ethkey/key_v2.go | 87 ---- .../keystore/keys/ethkey/key_v2_test.go | 36 -- .../services/keystore/keys/exporttestutils.go | 51 --- .../keystore/keys/models/legacy_key.go | 104 ----- core/services/keystore/keys/models/models.go | 365 ----------------- .../keystore/keys/models/models_test.go | 171 -------- .../keystore/keys/ocr2key/cosmos_keyring.go | 116 ------ .../keys/ocr2key/cosmos_keyring_test.go | 59 --- .../keystore/keys/ocr2key/ed25519_keyring.go | 141 ------- .../keys/ocr2key/ed25519_keyring_test.go | 59 --- .../keystore/keys/ocr2key/evm_keyring.go | 118 ------ .../keystore/keys/ocr2key/evm_keyring_test.go | 169 -------- core/services/keystore/keys/ocr2key/export.go | 90 ----- .../keystore/keys/ocr2key/export_test.go | 41 -- .../keys/ocr2key/generic_key_bundle.go | 191 --------- .../keys/ocr2key/generic_key_bundle_test.go | 154 ------- .../keystore/keys/ocr2key/key_bundle.go | 152 ------- .../keystore/keys/ocr2key/key_bundle_test.go | 63 --- .../keystore/keys/ocr2key/offchain_keyring.go | 138 ------- .../keys/ocr2key/offchain_keyring_test.go | 68 ---- .../keystore/keys/ocr2key/solana_keyring.go | 111 ----- .../keys/ocr2key/solana_keyring_test.go | 55 --- .../keystore/keys/ocr2key/ton_keyring.go | 118 ------ .../keystore/keys/ocr2key/ton_keyring_test.go | 95 ----- .../keystore/keys/ocrkey/config_public_key.go | 72 ---- .../keys/ocrkey/config_public_key_test.go | 42 -- core/services/keystore/keys/ocrkey/export.go | 59 --- .../keystore/keys/ocrkey/export_test.go | 19 - .../keystore/keys/ocrkey/helpers_test.go | 13 - core/services/keystore/keys/ocrkey/key_v2.go | 190 --------- .../keystore/keys/ocrkey/key_v2_test.go | 37 -- .../keys/ocrkey/off_chain_private_key.go | 24 -- .../keys/ocrkey/off_chain_private_key_test.go | 20 - .../keys/ocrkey/off_chain_public_key.go | 67 --- .../keys/ocrkey/off_chain_public_key_test.go | 48 --- .../keys/ocrkey/on_chain_private_key.go | 25 -- .../keys/ocrkey/on_chain_private_key_test.go | 25 -- .../keys/ocrkey/on_chain_public_key.go | 13 - .../keys/ocrkey/on_chain_public_key_test.go | 22 - .../keys/ocrkey/on_chain_signing_address.go | 69 ---- .../ocrkey/on_chain_signing_address_test.go | 25 -- core/services/keystore/keys/p2pkey/export.go | 55 --- .../keystore/keys/p2pkey/export_test.go | 19 - core/services/keystore/keys/p2pkey/key_v2.go | 117 ------ .../keystore/keys/p2pkey/key_v2_test.go | 22 - core/services/keystore/keys/p2pkey/peer_id.go | 96 ----- .../keystore/keys/p2pkey/peer_id_test.go | 72 ---- core/services/keystore/keys/sha256.go | 85 ---- core/services/keystore/keys/sha256_test.go | 59 --- core/services/keystore/keys/solkey/export.go | 47 --- .../keystore/keys/solkey/export_test.go | 19 - core/services/keystore/keys/solkey/key.go | 84 ---- .../services/keystore/keys/starkkey/export.go | 45 --- .../keystore/keys/starkkey/export_test.go | 31 -- core/services/keystore/keys/starkkey/key.go | 91 ----- .../keystore/keys/starkkey/ocr2key.go | 188 --------- .../keystore/keys/starkkey/ocr2key_test.go | 202 ---------- core/services/keystore/keys/starkkey/utils.go | 51 --- core/services/keystore/keys/suikey/export.go | 47 --- .../keystore/keys/suikey/export_test.go | 19 - core/services/keystore/keys/suikey/key.go | 107 ----- .../services/keystore/keys/suikey/key_test.go | 19 - core/services/keystore/keys/tonkey/export.go | 49 --- .../keystore/keys/tonkey/export_test.go | 19 - core/services/keystore/keys/tonkey/key.go | 141 ------- .../services/keystore/keys/tonkey/key_test.go | 142 ------- .../services/keystore/keys/tronkey/account.go | 178 -------- .../keystore/keys/tronkey/account_test.go | 177 -------- core/services/keystore/keys/tronkey/export.go | 45 --- .../keystore/keys/tronkey/export_test.go | 19 - core/services/keystore/keys/tronkey/key.go | 84 ---- .../keystore/keys/tronkey/key_test.go | 63 --- .../vrfkey/benchmark_vrf_validation_test.go | 26 -- core/services/keystore/keys/vrfkey/crypto.go | 187 --------- .../keystore/keys/vrfkey/crypto_test.go | 29 -- core/services/keystore/keys/vrfkey/export.go | 86 ---- .../keystore/keys/vrfkey/export_test.go | 19 - core/services/keystore/keys/vrfkey/key_v2.go | 153 ------- .../keystore/keys/vrfkey/key_v2_test.go | 28 -- core/services/keystore/keys/vrfkey/models.go | 73 ---- .../keystore/keys/vrfkey/models_test.go | 32 -- core/services/keystore/keys/vrfkey/proof.go | 67 --- .../keystore/keys/vrfkey/proof_test.go | 25 -- .../keys/vrfkey/secp256k1/crypto_test.go | 30 -- .../keystore/keys/vrfkey/secp256k1/curve.go | 46 --- .../keys/vrfkey/secp256k1/curve_test.go | 20 - .../keystore/keys/vrfkey/secp256k1/field.go | 169 -------- .../keys/vrfkey/secp256k1/field_test.go | 154 ------- .../keystore/keys/vrfkey/secp256k1/point.go | 381 ------------------ .../keys/vrfkey/secp256k1/point_test.go | 226 ----------- .../keys/vrfkey/secp256k1/public_key.go | 150 ------- .../keys/vrfkey/secp256k1/public_key_test.go | 38 -- .../keystore/keys/vrfkey/secp256k1/scalar.go | 232 ----------- .../keys/vrfkey/secp256k1/scalar_test.go | 187 --------- .../keystore/keys/vrfkey/secp256k1/suite.go | 91 ----- .../keys/vrfkey/secp256k1/suite_test.go | 15 - .../keystore/keys/workflowkey/export.go | 43 -- .../services/keystore/keys/workflowkey/key.go | 129 ------ .../keystore/keys/workflowkey/key_test.go | 116 ------ core/services/keystore/keystoretest.go | 2 +- core/services/keystore/master.go | 32 +- core/services/keystore/mocks/aptos.go | 2 +- core/services/keystore/mocks/cosmos.go | 2 +- core/services/keystore/mocks/csa.go | 2 +- core/services/keystore/mocks/eth.go | 2 +- core/services/keystore/mocks/ocr.go | 2 +- core/services/keystore/mocks/ocr2.go | 2 +- core/services/keystore/mocks/p2p.go | 2 +- core/services/keystore/mocks/solana.go | 2 +- core/services/keystore/mocks/starknet.go | 2 +- core/services/keystore/mocks/sui.go | 2 +- core/services/keystore/mocks/ton.go | 2 +- core/services/keystore/mocks/tron.go | 2 +- core/services/keystore/mocks/vrf.go | 2 +- core/services/keystore/mocks/workflow.go | 2 +- core/services/keystore/ocr.go | 2 +- core/services/keystore/ocr2.go | 2 +- core/services/keystore/ocr2_test.go | 2 +- core/services/keystore/ocr_test.go | 2 +- core/services/keystore/orm.go | 4 +- core/services/keystore/p2p.go | 2 +- core/services/keystore/p2p_test.go | 2 +- core/services/keystore/solana.go | 2 +- core/services/keystore/solana_test.go | 4 +- core/services/keystore/starknet.go | 2 +- core/services/keystore/starknet_test.go | 4 +- core/services/keystore/sui.go | 2 +- core/services/keystore/sui_test.go | 4 +- core/services/keystore/ton.go | 2 +- core/services/keystore/ton_test.go | 4 +- core/services/keystore/tron.go | 2 +- core/services/keystore/tron_test.go | 4 +- core/services/keystore/vrf.go | 2 +- core/services/keystore/vrf_test.go | 2 +- core/services/keystore/workflow.go | 2 +- core/services/keystore/workflow_test.go | 4 +- core/services/ocr2/delegate.go | 2 +- .../ccip/testhelpers/integration/chainlink.go | 4 +- .../testhelpers_1_4_0/chainlink.go | 4 +- .../v1/internal/testutils.go | 4 +- .../ocr2/plugins/functions/plugin_test.go | 2 +- .../ocr2/plugins/generic/oraclefactory.go | 2 +- .../services/ocr2/plugins/llo/helpers_test.go | 6 +- .../ocr2/plugins/llo/integration_test.go | 2 +- .../ocr2/plugins/mercury/helpers_test.go | 6 +- .../ocr2/plugins/mercury/integration_test.go | 2 +- .../plugins/ocr2keeper/integration_21_test.go | 2 +- core/services/ocr2/plugins/vault/plugin.go | 2 +- .../ocr2/plugins/vault/plugin_test.go | 2 +- core/services/ocrcommon/adapters.go | 2 +- core/services/ocrcommon/adapters_test.go | 2 +- .../ocrcommon/discoverer_database_test.go | 2 +- core/services/ocrcommon/peer_wrapper.go | 2 +- core/services/ocrcommon/peer_wrapper_test.go | 2 +- core/services/p2p/shared_peer_test.go | 2 +- core/services/p2p/signer.go | 2 +- core/services/p2p/signer_test.go | 2 +- core/services/p2p/wrapper/wrapper_test.go | 2 +- core/services/pipeline/task.vrf.go | 4 +- core/services/pipeline/task.vrfv2.go | 2 +- core/services/pipeline/task.vrfv2plus.go | 2 +- .../testutils/signing_keystore.go | 2 +- .../relay/evm/chain_components_test.go | 2 +- .../relay/evm/mercury/wsrpc/client_test.go | 2 +- .../relay/evm/mercury/wsrpc/pool_test.go | 2 +- core/services/signatures/ethdss/ethdss.go | 2 +- .../services/signatures/ethdss/ethdss_test.go | 2 +- .../signatures/ethschnorr/ethschnorr.go | 2 +- .../signatures/ethschnorr/ethschnorr_test.go | 2 +- .../services/standardcapabilities/delegate.go | 4 +- .../telemetry_ingress_batch_client_test.go | 2 +- .../telemetry_ingress_client_test.go | 2 +- core/services/telemetry/manager_test.go | 2 +- core/services/vrf/delegate_test.go | 4 +- core/services/vrf/proof/proof_response.go | 4 +- core/services/vrf/proof/solidity_proof.go | 4 +- ...rf_coordinator_solidity_crosscheck_test.go | 4 +- .../vrf_hash_to_curve_cost_test.go | 4 +- .../vrf_randomness_output_cost_test.go | 4 +- .../vrf_solidity_crosscheck_test.go | 4 +- .../vrf_v08_solidity_crosscheck_test.go | 4 +- core/services/vrf/v1/integration_test.go | 4 +- .../vrf/v2/integration_helpers_test.go | 2 +- .../vrf/v2/integration_v2_plus_test.go | 4 +- .../v2/integration_v2_reverted_txns_test.go | 2 +- core/services/vrf/v2/integration_v2_test.go | 6 +- core/services/vrf/vrfcommon/validate.go | 2 +- core/services/vrf/vrftesthelpers/helpers.go | 4 +- core/services/workflows/artifacts/store.go | 2 +- .../workflows/artifacts/store_test.go | 2 +- core/services/workflows/artifacts/v2/store.go | 2 +- .../workflows/artifacts/v2/store_test.go | 2 +- .../cmd/cre/utils/standalone_engine.go | 2 +- core/services/workflows/syncer/handler.go | 2 +- .../services/workflows/syncer/handler_test.go | 2 +- core/services/workflows/syncer/v2/handler.go | 2 +- .../workflows/syncer/v2/handler_test.go | 2 +- .../syncer/v2/workflow_syncer_v2_test.go | 2 +- .../workflows/syncer/workflow_syncer_test.go | 2 +- core/services/workflows/v2/config.go | 2 +- core/services/workflows/v2/config_test.go | 2 +- core/services/workflows/v2/secrets.go | 2 +- core/services/workflows/v2/secrets_test.go | 2 +- core/web/aptos_keys_controller.go | 2 +- core/web/cosmos_keys_controller.go | 2 +- core/web/eth_keys_controller.go | 2 +- core/web/eth_keys_controller_test.go | 2 +- core/web/jobs_controller_test.go | 4 +- core/web/p2p_keys_controller.go | 2 +- core/web/p2p_keys_controller_test.go | 2 +- core/web/presenters/aptos_key.go | 2 +- core/web/presenters/cosmos_key.go | 2 +- core/web/presenters/csa_key.go | 2 +- core/web/presenters/csa_key_test.go | 2 +- core/web/presenters/dkg_recipient_key.go | 2 +- core/web/presenters/job_test.go | 4 +- core/web/presenters/ocr_keys.go | 4 +- core/web/presenters/p2p_key.go | 2 +- core/web/presenters/p2p_key_test.go | 2 +- core/web/presenters/solana_key.go | 2 +- core/web/presenters/starknet_key.go | 2 +- core/web/presenters/sui_key.go | 2 +- core/web/presenters/ton_key.go | 2 +- core/web/presenters/tron_key.go | 2 +- core/web/presenters/vrf_key.go | 2 +- core/web/presenters/workflow_key.go | 2 +- core/web/resolver/aptos_key.go | 2 +- core/web/resolver/aptos_key_test.go | 2 +- core/web/resolver/cosmos_key.go | 2 +- core/web/resolver/cosmos_key_test.go | 2 +- core/web/resolver/csa_keys.go | 2 +- core/web/resolver/csa_keys_test.go | 2 +- core/web/resolver/eth_key.go | 2 +- core/web/resolver/mutation.go | 8 +- core/web/resolver/ocr.go | 2 +- core/web/resolver/ocr2_keys.go | 2 +- core/web/resolver/ocr2_keys_test.go | 2 +- core/web/resolver/ocr_test.go | 2 +- core/web/resolver/p2p.go | 2 +- core/web/resolver/p2p_test.go | 2 +- core/web/resolver/query.go | 2 +- core/web/resolver/solana_key.go | 2 +- core/web/resolver/solana_key_test.go | 2 +- core/web/resolver/spec_test.go | 4 +- core/web/resolver/starknet_key.go | 2 +- core/web/resolver/starknet_key_test.go | 2 +- core/web/resolver/sui_key.go | 2 +- core/web/resolver/sui_key_test.go | 2 +- core/web/resolver/ton_key.go | 2 +- core/web/resolver/ton_key_test.go | 2 +- core/web/resolver/tron_key.go | 2 +- core/web/resolver/tron_key_test.go | 2 +- core/web/resolver/vrf.go | 2 +- core/web/resolver/vrf_test.go | 2 +- core/web/solana_keys_controller.go | 2 +- core/web/starknet_keys_controller.go | 2 +- core/web/sui_keys_controller.go | 2 +- core/web/ton_keys_controller.go | 2 +- core/web/tron_keys_controller.go | 2 +- core/web/vault_controller_test.go | 2 +- .../changeset/testhelpers/test_environment.go | 2 +- .../changeset/v1_6/cs_update_rmn_config.go | 2 +- deployment/ccip/view/v1_6/ccip_home.go | 2 +- deployment/ccip/view/v1_6/rmnhome.go | 2 +- deployment/common/view/nops_test.go | 2 +- deployment/common/view/v1_0/capreg.go | 2 +- deployment/common/view/v2_0/capreg.go | 2 +- .../configure_capabilities_registry.go | 2 +- .../configure_capabilities_registry_test.go | 2 +- .../v2/changeset/expand_ocr3_configs_test.go | 2 +- .../operations/contracts/update_don.go | 2 +- .../operations/contracts/update_nodes.go | 2 +- .../v2/changeset/pkg/p2p_ids.go | 2 +- .../changeset/sequences/add_capabilities.go | 2 +- .../v2/changeset/set_dons_families_test.go | 2 +- .../v2/changeset/types.go | 2 +- .../v2/changeset/update_don.go | 2 +- deployment/cre/ocr3/config_test.go | 2 +- deployment/cre/ocr3/ocr3_1/config_test.go | 2 +- deployment/cre/ocr3/types_test.go | 2 +- deployment/cre/test/dons.go | 2 +- deployment/cre/test/p2p_ids.go | 2 +- deployment/environment.go | 2 +- deployment/environment/crib/ccip_deployer.go | 2 +- deployment/environment/test/jd.go | 2 +- deployment/environment/test/jd_test.go | 2 +- deployment/environment/test/nodes.go | 6 +- deployment/environment_test.go | 2 +- deployment/go.sum | 1 + deployment/keystone/changeset/add_dons.go | 2 +- .../keystone/changeset/add_dons_test.go | 2 +- .../keystone/changeset/add_nodes_test.go | 2 +- .../append_node_capabilities_test.go | 2 +- .../internal/append_node_capabilities.go | 2 +- .../internal/append_node_capabilities_test.go | 2 +- .../changeset/internal/deploy_test.go | 2 +- .../changeset/internal/remove_dons_test.go | 2 +- .../keystone/changeset/internal/types.go | 2 +- .../keystone/changeset/internal/update_don.go | 2 +- .../changeset/internal/update_don_test.go | 2 +- .../internal/update_node_capabilities.go | 2 +- .../internal/update_node_capabilities_test.go | 2 +- .../changeset/internal/update_nodes.go | 2 +- .../changeset/internal/update_nodes_test.go | 2 +- .../contracts/add_capabilites_op.go | 2 +- .../contracts/add_capabilities_op_test.go | 2 +- .../deploy_configure_forwarders_seq.go | 2 +- .../deploy_configure_forwarders_seq_test.go | 2 +- deployment/keystone/changeset/test/dons.go | 2 +- .../keystone/changeset/test/registry.go | 2 +- deployment/keystone/changeset/test/utils.go | 2 +- deployment/keystone/changeset/update_don.go | 2 +- .../keystone/changeset/update_don_test.go | 2 +- .../changeset/update_node_capabilities.go | 2 +- .../update_node_capabilities_test.go | 2 +- deployment/keystone/changeset/update_nodes.go | 2 +- .../keystone/changeset/update_nodes_test.go | 2 +- deployment/utils/nodetestutils/node.go | 8 +- go.sum | 2 + integration-tests/go.sum | 1 + integration-tests/load/go.sum | 1 + system-tests/lib/cre/contracts/keystone.go | 2 +- .../lib/cre/contracts/keystone_test.go | 2 +- system-tests/lib/cre/don/secrets/secrets.go | 2 +- system-tests/lib/crypto/dkgrecipient.go | 2 +- system-tests/lib/crypto/p2p.go | 2 +- system-tests/lib/crypto/sol.go | 2 +- system-tests/lib/go.sum | 1 + system-tests/tests/go.sum | 1 + .../tests/load/cre/workflow_don_load_test.go | 2 +- .../tests/load/cre/writer_don_load_test.go | 2 +- .../cre/v2_http_trigger_regression_test.go | 2 +- 439 files changed, 421 insertions(+), 9952 deletions(-) delete mode 100644 core/services/keystore/internal/exportutils.go delete mode 100644 core/services/keystore/internal/raw.go delete mode 100644 core/services/keystore/internal/raw_test.go delete mode 100644 core/services/keystore/keys/aptoskey/export.go delete mode 100644 core/services/keystore/keys/aptoskey/export_test.go delete mode 100644 core/services/keystore/keys/aptoskey/key.go delete mode 100644 core/services/keystore/keys/aptoskey/key_test.go delete mode 100644 core/services/keystore/keys/cosmoskey/export.go delete mode 100644 core/services/keystore/keys/cosmoskey/export_test.go delete mode 100644 core/services/keystore/keys/cosmoskey/key.go delete mode 100644 core/services/keystore/keys/csakey/export.go delete mode 100644 core/services/keystore/keys/csakey/export_test.go delete mode 100644 core/services/keystore/keys/csakey/key_v2.go delete mode 100644 core/services/keystore/keys/csakey/key_v2_test.go delete mode 100644 core/services/keystore/keys/dkgrecipientkey/export.go delete mode 100644 core/services/keystore/keys/dkgrecipientkey/key.go delete mode 100644 core/services/keystore/keys/dkgrecipientkey/key_test.go delete mode 100644 core/services/keystore/keys/ethkey/export.go delete mode 100644 core/services/keystore/keys/ethkey/export_test.go delete mode 100644 core/services/keystore/keys/ethkey/key_v2.go delete mode 100644 core/services/keystore/keys/ethkey/key_v2_test.go delete mode 100644 core/services/keystore/keys/exporttestutils.go delete mode 100644 core/services/keystore/keys/models/legacy_key.go delete mode 100644 core/services/keystore/keys/models/models.go delete mode 100644 core/services/keystore/keys/models/models_test.go delete mode 100644 core/services/keystore/keys/ocr2key/cosmos_keyring.go delete mode 100644 core/services/keystore/keys/ocr2key/cosmos_keyring_test.go delete mode 100644 core/services/keystore/keys/ocr2key/ed25519_keyring.go delete mode 100644 core/services/keystore/keys/ocr2key/ed25519_keyring_test.go delete mode 100644 core/services/keystore/keys/ocr2key/evm_keyring.go delete mode 100644 core/services/keystore/keys/ocr2key/evm_keyring_test.go delete mode 100644 core/services/keystore/keys/ocr2key/export.go delete mode 100644 core/services/keystore/keys/ocr2key/export_test.go delete mode 100644 core/services/keystore/keys/ocr2key/generic_key_bundle.go delete mode 100644 core/services/keystore/keys/ocr2key/generic_key_bundle_test.go delete mode 100644 core/services/keystore/keys/ocr2key/key_bundle.go delete mode 100644 core/services/keystore/keys/ocr2key/key_bundle_test.go delete mode 100644 core/services/keystore/keys/ocr2key/offchain_keyring.go delete mode 100644 core/services/keystore/keys/ocr2key/offchain_keyring_test.go delete mode 100644 core/services/keystore/keys/ocr2key/solana_keyring.go delete mode 100644 core/services/keystore/keys/ocr2key/solana_keyring_test.go delete mode 100644 core/services/keystore/keys/ocr2key/ton_keyring.go delete mode 100644 core/services/keystore/keys/ocr2key/ton_keyring_test.go delete mode 100644 core/services/keystore/keys/ocrkey/config_public_key.go delete mode 100644 core/services/keystore/keys/ocrkey/config_public_key_test.go delete mode 100644 core/services/keystore/keys/ocrkey/export.go delete mode 100644 core/services/keystore/keys/ocrkey/export_test.go delete mode 100644 core/services/keystore/keys/ocrkey/helpers_test.go delete mode 100644 core/services/keystore/keys/ocrkey/key_v2.go delete mode 100644 core/services/keystore/keys/ocrkey/key_v2_test.go delete mode 100644 core/services/keystore/keys/ocrkey/off_chain_private_key.go delete mode 100644 core/services/keystore/keys/ocrkey/off_chain_private_key_test.go delete mode 100644 core/services/keystore/keys/ocrkey/off_chain_public_key.go delete mode 100644 core/services/keystore/keys/ocrkey/off_chain_public_key_test.go delete mode 100644 core/services/keystore/keys/ocrkey/on_chain_private_key.go delete mode 100644 core/services/keystore/keys/ocrkey/on_chain_private_key_test.go delete mode 100644 core/services/keystore/keys/ocrkey/on_chain_public_key.go delete mode 100644 core/services/keystore/keys/ocrkey/on_chain_public_key_test.go delete mode 100644 core/services/keystore/keys/ocrkey/on_chain_signing_address.go delete mode 100644 core/services/keystore/keys/ocrkey/on_chain_signing_address_test.go delete mode 100644 core/services/keystore/keys/p2pkey/export.go delete mode 100644 core/services/keystore/keys/p2pkey/export_test.go delete mode 100644 core/services/keystore/keys/p2pkey/key_v2.go delete mode 100644 core/services/keystore/keys/p2pkey/key_v2_test.go delete mode 100644 core/services/keystore/keys/p2pkey/peer_id.go delete mode 100644 core/services/keystore/keys/p2pkey/peer_id_test.go delete mode 100644 core/services/keystore/keys/sha256.go delete mode 100644 core/services/keystore/keys/sha256_test.go delete mode 100644 core/services/keystore/keys/solkey/export.go delete mode 100644 core/services/keystore/keys/solkey/export_test.go delete mode 100644 core/services/keystore/keys/solkey/key.go delete mode 100644 core/services/keystore/keys/starkkey/export.go delete mode 100644 core/services/keystore/keys/starkkey/export_test.go delete mode 100644 core/services/keystore/keys/starkkey/key.go delete mode 100644 core/services/keystore/keys/starkkey/ocr2key.go delete mode 100644 core/services/keystore/keys/starkkey/ocr2key_test.go delete mode 100644 core/services/keystore/keys/starkkey/utils.go delete mode 100644 core/services/keystore/keys/suikey/export.go delete mode 100644 core/services/keystore/keys/suikey/export_test.go delete mode 100644 core/services/keystore/keys/suikey/key.go delete mode 100644 core/services/keystore/keys/suikey/key_test.go delete mode 100644 core/services/keystore/keys/tonkey/export.go delete mode 100644 core/services/keystore/keys/tonkey/export_test.go delete mode 100644 core/services/keystore/keys/tonkey/key.go delete mode 100644 core/services/keystore/keys/tonkey/key_test.go delete mode 100644 core/services/keystore/keys/tronkey/account.go delete mode 100644 core/services/keystore/keys/tronkey/account_test.go delete mode 100644 core/services/keystore/keys/tronkey/export.go delete mode 100644 core/services/keystore/keys/tronkey/export_test.go delete mode 100644 core/services/keystore/keys/tronkey/key.go delete mode 100644 core/services/keystore/keys/tronkey/key_test.go delete mode 100644 core/services/keystore/keys/vrfkey/benchmark_vrf_validation_test.go delete mode 100644 core/services/keystore/keys/vrfkey/crypto.go delete mode 100644 core/services/keystore/keys/vrfkey/crypto_test.go delete mode 100644 core/services/keystore/keys/vrfkey/export.go delete mode 100644 core/services/keystore/keys/vrfkey/export_test.go delete mode 100644 core/services/keystore/keys/vrfkey/key_v2.go delete mode 100644 core/services/keystore/keys/vrfkey/key_v2_test.go delete mode 100644 core/services/keystore/keys/vrfkey/models.go delete mode 100644 core/services/keystore/keys/vrfkey/models_test.go delete mode 100644 core/services/keystore/keys/vrfkey/proof.go delete mode 100644 core/services/keystore/keys/vrfkey/proof_test.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/crypto_test.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/curve.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/curve_test.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/field.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/field_test.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/point.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/point_test.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/public_key.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/public_key_test.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/scalar.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/scalar_test.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/suite.go delete mode 100644 core/services/keystore/keys/vrfkey/secp256k1/suite_test.go delete mode 100644 core/services/keystore/keys/workflowkey/export.go delete mode 100644 core/services/keystore/keys/workflowkey/key.go delete mode 100644 core/services/keystore/keys/workflowkey/key_test.go diff --git a/core/capabilities/ccip/ccip_integration_tests/integrationhelpers/integration_helpers.go b/core/capabilities/ccip/ccip_integration_tests/integrationhelpers/integration_helpers.go index 0253e28b002..6ddc24db8d9 100644 --- a/core/capabilities/ccip/ccip_integration_tests/integrationhelpers/integration_helpers.go +++ b/core/capabilities/ccip/ccip_integration_tests/integrationhelpers/integration_helpers.go @@ -37,11 +37,11 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/read" evmtestutils "github.com/smartcontractkit/chainlink-evm/pkg/testutils" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" configsevm "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm" cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) const chainID = 1337 diff --git a/core/capabilities/ccip/configs/sui/contract_reader.go b/core/capabilities/ccip/configs/sui/contract_reader.go index 99aa1471866..e0dff8a505b 100644 --- a/core/capabilities/ccip/configs/sui/contract_reader.go +++ b/core/capabilities/ccip/configs/sui/contract_reader.go @@ -13,7 +13,7 @@ import ( "github.com/smartcontractkit/chainlink-sui/relayer/client" "github.com/smartcontractkit/chainlink-sui/relayer/codec" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" ) func PublicKeyToAddress(pubKeyHex string) (string, error) { diff --git a/core/capabilities/ccip/delegate.go b/core/capabilities/ccip/delegate.go index 87c7cabb8a8..42cf0456bc5 100644 --- a/core/capabilities/ccip/delegate.go +++ b/core/capabilities/ccip/delegate.go @@ -28,6 +28,8 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common" configsevm "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/launcher" @@ -36,8 +38,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" diff --git a/core/capabilities/ccip/launcher/diff_test.go b/core/capabilities/ccip/launcher/diff_test.go index 37c4a229580..5759d1bdd76 100644 --- a/core/capabilities/ccip/launcher/diff_test.go +++ b/core/capabilities/ccip/launcher/diff_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" ) diff --git a/core/capabilities/ccip/launcher/launcher_test.go b/core/capabilities/ccip/launcher/launcher_test.go index 4f5a115aaa6..6e155dce98b 100644 --- a/core/capabilities/ccip/launcher/launcher_test.go +++ b/core/capabilities/ccip/launcher/launcher_test.go @@ -14,11 +14,11 @@ import ( ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-evm/pkg/utils" cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" ) diff --git a/core/capabilities/ccip/launcher/test_helpers.go b/core/capabilities/ccip/launcher/test_helpers.go index ba428b1c310..30bae02cada 100644 --- a/core/capabilities/ccip/launcher/test_helpers.go +++ b/core/capabilities/ccip/launcher/test_helpers.go @@ -6,7 +6,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/capabilities" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" diff --git a/core/capabilities/ccip/ocrimpls/contract_transmitter.go b/core/capabilities/ccip/ocrimpls/contract_transmitter.go index 37a96aafd10..c78a4d957b5 100644 --- a/core/capabilities/ccip/ocrimpls/contract_transmitter.go +++ b/core/capabilities/ccip/ocrimpls/contract_transmitter.go @@ -17,7 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" ) // ToCalldataFunc is a function that takes in the OCR3 report and signature data and processes them. diff --git a/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go b/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go index 0acafa347de..82e2b632845 100644 --- a/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go +++ b/core/capabilities/ccip/ocrimpls/contract_transmitter_test.go @@ -25,6 +25,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/multi_ocr3_helper" kschaintype "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/types/ccip/consts" "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" @@ -52,7 +53,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) func Test_ContractTransmitter_TransmitWithoutSignatures(t *testing.T) { diff --git a/core/capabilities/ccip/ocrimpls/keyring.go b/core/capabilities/ccip/ocrimpls/keyring.go index d65dcc999c0..92454c3188a 100644 --- a/core/capabilities/ccip/ocrimpls/keyring.go +++ b/core/capabilities/ccip/ocrimpls/keyring.go @@ -8,7 +8,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" ) // OCR3SignerVerifierExtra is an extension of OCR3SignerVerifier that diff --git a/core/capabilities/ccip/oraclecreator/create_test.go b/core/capabilities/ccip/oraclecreator/create_test.go index c36c3b56448..1e7bfbbb374 100644 --- a/core/capabilities/ccip/oraclecreator/create_test.go +++ b/core/capabilities/ccip/oraclecreator/create_test.go @@ -23,12 +23,12 @@ import ( ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common" cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) diff --git a/core/capabilities/ccip/oraclecreator/plugin.go b/core/capabilities/ccip/oraclecreator/plugin.go index 141391815d0..f3559852965 100644 --- a/core/capabilities/ccip/oraclecreator/plugin.go +++ b/core/capabilities/ccip/oraclecreator/plugin.go @@ -34,6 +34,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types/ccip/consts" cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" _ "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipaptos" // Register Aptos plugin config factories _ "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm" // Register EVM plugin config factories _ "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipsolana" // Register Solana plugin config factories @@ -43,8 +45,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls" cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr3/promwrapper" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" diff --git a/core/capabilities/ccip/oraclecreator/plugin_test.go b/core/capabilities/ccip/oraclecreator/plugin_test.go index 83360b0299e..72a408cc5e8 100644 --- a/core/capabilities/ccip/oraclecreator/plugin_test.go +++ b/core/capabilities/ccip/oraclecreator/plugin_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" diff --git a/core/capabilities/fakes/consensus_nodag.go b/core/capabilities/fakes/consensus_nodag.go index be4bb17e878..0d2c86da79b 100644 --- a/core/capabilities/fakes/consensus_nodag.go +++ b/core/capabilities/fakes/consensus_nodag.go @@ -21,7 +21,7 @@ import ( sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" valuespb "github.com/smartcontractkit/chainlink-protos/cre/go/values/pb" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" ) type fakeConsensusNoDAG struct { diff --git a/core/capabilities/fakes/consensus_nodag_test.go b/core/capabilities/fakes/consensus_nodag_test.go index 1e107f3377d..d0d7e64b544 100644 --- a/core/capabilities/fakes/consensus_nodag_test.go +++ b/core/capabilities/fakes/consensus_nodag_test.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" ) const ( diff --git a/core/capabilities/fakes/streams_trigger.go b/core/capabilities/fakes/streams_trigger.go index db2e4ee1e20..5f34e02b54b 100644 --- a/core/capabilities/fakes/streams_trigger.go +++ b/core/capabilities/fakes/streams_trigger.go @@ -22,8 +22,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/capabilities/streams" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" ) diff --git a/core/capabilities/gateway_connector/service_wrapper.go b/core/capabilities/gateway_connector/service_wrapper.go index 20205fd2fe3..26938c51775 100644 --- a/core/capabilities/gateway_connector/service_wrapper.go +++ b/core/capabilities/gateway_connector/service_wrapper.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/jonboulle/clockwork" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-evm/pkg/keys" @@ -16,7 +17,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" "github.com/smartcontractkit/chainlink/v2/core/services/gateway/network" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" ) type Keystore interface { diff --git a/core/capabilities/gateway_connector/service_wrapper_test.go b/core/capabilities/gateway_connector/service_wrapper_test.go index b74a06cbc50..c40715dc809 100644 --- a/core/capabilities/gateway_connector/service_wrapper_test.go +++ b/core/capabilities/gateway_connector/service_wrapper_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-evm/pkg/keys" "github.com/smartcontractkit/chainlink-evm/pkg/keys/keystest" @@ -18,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" evmtestutils "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/testutils" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/capabilities/integration_tests/framework/don.go b/core/capabilities/integration_tests/framework/don.go index 4d407973da3..09f2beeac4a 100644 --- a/core/capabilities/integration_tests/framework/don.go +++ b/core/capabilities/integration_tests/framework/don.go @@ -17,6 +17,7 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" @@ -24,13 +25,14 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink-protos/cre/go/values" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink-evm/pkg/assets" evmtestutils "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink-evm/pkg/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/capabilities/compute" @@ -39,8 +41,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" "github.com/smartcontractkit/chainlink/v2/core/services/standardcapabilities" diff --git a/core/capabilities/integration_tests/framework/don_configuration.go b/core/capabilities/integration_tests/framework/don_configuration.go index 9d416852d07..7d1bfe15156 100644 --- a/core/capabilities/integration_tests/framework/don_configuration.go +++ b/core/capabilities/integration_tests/framework/don_configuration.go @@ -4,10 +4,10 @@ import ( "errors" "fmt" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commoncap "github.com/smartcontractkit/chainlink-common/pkg/capabilities" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) diff --git a/core/capabilities/integration_tests/framework/fake_libocr.go b/core/capabilities/integration_tests/framework/fake_libocr.go index f2d3e372245..1397c389b8c 100644 --- a/core/capabilities/integration_tests/framework/fake_libocr.go +++ b/core/capabilities/integration_tests/framework/fake_libocr.go @@ -19,7 +19,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/generic" ) diff --git a/core/capabilities/integration_tests/framework/peer.go b/core/capabilities/integration_tests/framework/peer.go index 4f1c028efac..e7803e4cd2d 100644 --- a/core/capabilities/integration_tests/framework/peer.go +++ b/core/capabilities/integration_tests/framework/peer.go @@ -8,10 +8,10 @@ import ( "strings" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) diff --git a/core/capabilities/integration_tests/keystone/llo_feed_test.go b/core/capabilities/integration_tests/keystone/llo_feed_test.go index b2ef9635eae..9c7c6192837 100644 --- a/core/capabilities/integration_tests/keystone/llo_feed_test.go +++ b/core/capabilities/integration_tests/keystone/llo_feed_test.go @@ -20,8 +20,8 @@ import ( datastreamsllo "github.com/smartcontractkit/chainlink-data-streams/llo" feeds_consumer "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/feeds_consumer_1_0_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/capabilities/integration_tests/framework" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/llo/cre" ) diff --git a/core/capabilities/integration_tests/keystone/setup.go b/core/capabilities/integration_tests/keystone/setup.go index dc1cdd98397..bff6be08be7 100644 --- a/core/capabilities/integration_tests/keystone/setup.go +++ b/core/capabilities/integration_tests/keystone/setup.go @@ -20,8 +20,8 @@ import ( v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" feeds_consumer "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/feeds_consumer_1_0_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/capabilities/integration_tests/framework" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" ) diff --git a/core/capabilities/remote/aggregation/signed_report.go b/core/capabilities/remote/aggregation/signed_report.go index 049e18b6530..70b65eb4140 100644 --- a/core/capabilities/remote/aggregation/signed_report.go +++ b/core/capabilities/remote/aggregation/signed_report.go @@ -10,11 +10,11 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-protos/cre/go/values" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ocr2types "github.com/smartcontractkit/libocr/offchainreporting2/types" ) diff --git a/core/capabilities/remote/aggregation/signed_report_test.go b/core/capabilities/remote/aggregation/signed_report_test.go index 24fe5ea96e3..07d2470e9f5 100644 --- a/core/capabilities/remote/aggregation/signed_report_test.go +++ b/core/capabilities/remote/aggregation/signed_report_test.go @@ -21,8 +21,8 @@ import ( "github.com/smartcontractkit/chainlink-protos/cre/go/values" // "github.com/smartcontractkit/chainlink/common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/aggregation" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) func TestSignedReportAggregator_Aggregate(t *testing.T) { diff --git a/core/capabilities/streams/codec_test.go b/core/capabilities/streams/codec_test.go index ef7431cd9e5..9b5f7e70e42 100644 --- a/core/capabilities/streams/codec_test.go +++ b/core/capabilities/streams/codec_test.go @@ -13,12 +13,12 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/datastreams" "github.com/smartcontractkit/chainlink-common/pkg/logger" v3 "github.com/smartcontractkit/chainlink-common/pkg/types/mercury/v3" "github.com/smartcontractkit/chainlink-protos/cre/go/values" "github.com/smartcontractkit/chainlink/v2/core/capabilities/streams" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" ) diff --git a/core/capabilities/streams/trigger_test.go b/core/capabilities/streams/trigger_test.go index 82b63ad01ba..0e529eeff17 100644 --- a/core/capabilities/streams/trigger_test.go +++ b/core/capabilities/streams/trigger_test.go @@ -15,6 +15,7 @@ import ( ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/datastreams" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" @@ -25,7 +26,6 @@ import ( remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" "github.com/smartcontractkit/chainlink/v2/core/capabilities/streams" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) diff --git a/core/capabilities/vault/vaulttypes/types.go b/core/capabilities/vault/vaulttypes/types.go index 12da4815bef..31f223fb219 100644 --- a/core/capabilities/vault/vaulttypes/types.go +++ b/core/capabilities/vault/vaulttypes/types.go @@ -13,10 +13,10 @@ import ( ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "google.golang.org/protobuf/proto" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" vaultcommon "github.com/smartcontractkit/chainlink-common/pkg/capabilities/actions/vault" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink/v2/core/build" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) var DefaultNamespace = "main" diff --git a/core/cmd/aptos_keys_commands.go b/core/cmd/aptos_keys_commands.go index cabad347510..f37f27f87c8 100644 --- a/core/cmd/aptos_keys_commands.go +++ b/core/cmd/aptos_keys_commands.go @@ -1,8 +1,8 @@ package cmd import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/aptos_keys_commands_test.go b/core/cmd/aptos_keys_commands_test.go index 5343e3ae601..0ddc22cb84d 100644 --- a/core/cmd/aptos_keys_commands_test.go +++ b/core/cmd/aptos_keys_commands_test.go @@ -11,12 +11,12 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/cosmos_keys_commands.go b/core/cmd/cosmos_keys_commands.go index 11974198fd6..7df1dd49eab 100644 --- a/core/cmd/cosmos_keys_commands.go +++ b/core/cmd/cosmos_keys_commands.go @@ -1,8 +1,8 @@ package cmd import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/cosmos_keys_commands_test.go b/core/cmd/cosmos_keys_commands_test.go index 0f934a84624..4e0b2954fff 100644 --- a/core/cmd/cosmos_keys_commands_test.go +++ b/core/cmd/cosmos_keys_commands_test.go @@ -11,12 +11,12 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/csa_keys_commands_test.go b/core/cmd/csa_keys_commands_test.go index aa296bd80e7..6dcc1d52cb6 100644 --- a/core/cmd/csa_keys_commands_test.go +++ b/core/cmd/csa_keys_commands_test.go @@ -10,13 +10,13 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/ocr2_keys_commands.go b/core/cmd/ocr2_keys_commands.go index 8721b09c0e0..950bb48e5c5 100644 --- a/core/cmd/ocr2_keys_commands.go +++ b/core/cmd/ocr2_keys_commands.go @@ -13,7 +13,6 @@ import ( "github.com/smartcontractkit/chainlink-common/keystore/corekeys" cutils "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) @@ -168,7 +167,7 @@ func (s *Shell) DeleteOCR2KeyBundle(c *cli.Context) error { if !c.Args().Present() { return s.errorOut(errors.New("Must pass the key ID to be deleted")) } - id, err := keys.Sha256HashFromHex(c.Args().Get(0)) + id, err := corekeys.Sha256HashFromHex(c.Args().Get(0)) if err != nil { return s.errorOut(err) } diff --git a/core/cmd/ocr2_keys_commands_test.go b/core/cmd/ocr2_keys_commands_test.go index c3c0c17c34e..0aa55880c0c 100644 --- a/core/cmd/ocr2_keys_commands_test.go +++ b/core/cmd/ocr2_keys_commands_test.go @@ -12,12 +12,12 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/ocr_keys_commands.go b/core/cmd/ocr_keys_commands.go index 9ea738b019a..0ed73371ab8 100644 --- a/core/cmd/ocr_keys_commands.go +++ b/core/cmd/ocr_keys_commands.go @@ -11,8 +11,8 @@ import ( "github.com/pkg/errors" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" cutils "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) @@ -160,7 +160,7 @@ func (s *Shell) DeleteOCRKeyBundle(c *cli.Context) error { if !c.Args().Present() { return s.errorOut(errors.New("Must pass the key ID to be deleted")) } - id, err := keys.Sha256HashFromHex(c.Args().Get(0)) + id, err := corekeys.Sha256HashFromHex(c.Args().Get(0)) if err != nil { return s.errorOut(err) } diff --git a/core/cmd/ocr_keys_commands_test.go b/core/cmd/ocr_keys_commands_test.go index cbe15fc7808..ad24b64a817 100644 --- a/core/cmd/ocr_keys_commands_test.go +++ b/core/cmd/ocr_keys_commands_test.go @@ -11,12 +11,12 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/p2p_keys_commands_test.go b/core/cmd/p2p_keys_commands_test.go index df267e08366..1e5c03d9aed 100644 --- a/core/cmd/p2p_keys_commands_test.go +++ b/core/cmd/p2p_keys_commands_test.go @@ -10,13 +10,13 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "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" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/solana_keys_commands.go b/core/cmd/solana_keys_commands.go index 636f8a7014a..a04b4152dad 100644 --- a/core/cmd/solana_keys_commands.go +++ b/core/cmd/solana_keys_commands.go @@ -1,8 +1,8 @@ package cmd import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/solana_keys_commands_test.go b/core/cmd/solana_keys_commands_test.go index ca6c4678b8d..07933143213 100644 --- a/core/cmd/solana_keys_commands_test.go +++ b/core/cmd/solana_keys_commands_test.go @@ -11,12 +11,12 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/starknet_keys_commands.go b/core/cmd/starknet_keys_commands.go index 5722e5bd946..7e901995f30 100644 --- a/core/cmd/starknet_keys_commands.go +++ b/core/cmd/starknet_keys_commands.go @@ -1,8 +1,8 @@ package cmd import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/starknet_keys_commands_test.go b/core/cmd/starknet_keys_commands_test.go index 683a78cb3ee..5a64ea4f5da 100644 --- a/core/cmd/starknet_keys_commands_test.go +++ b/core/cmd/starknet_keys_commands_test.go @@ -11,12 +11,12 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/sui_keys_commands.go b/core/cmd/sui_keys_commands.go index 29b77e86793..5047248f449 100644 --- a/core/cmd/sui_keys_commands.go +++ b/core/cmd/sui_keys_commands.go @@ -1,8 +1,8 @@ package cmd import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/sui_keys_commands_test.go b/core/cmd/sui_keys_commands_test.go index e57db1ef5cf..1be880eab4e 100644 --- a/core/cmd/sui_keys_commands_test.go +++ b/core/cmd/sui_keys_commands_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/core/cmd/ton_keys_commands.go b/core/cmd/ton_keys_commands.go index 0c47e560b81..72c9a138603 100644 --- a/core/cmd/ton_keys_commands.go +++ b/core/cmd/ton_keys_commands.go @@ -1,8 +1,8 @@ package cmd import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/ton_keys_commands_test.go b/core/cmd/ton_keys_commands_test.go index 3af934868a8..ddb1b59b739 100644 --- a/core/cmd/ton_keys_commands_test.go +++ b/core/cmd/ton_keys_commands_test.go @@ -11,12 +11,12 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/tron_keys_commands.go b/core/cmd/tron_keys_commands.go index 67b3242e1f5..8a5bd0c4a37 100644 --- a/core/cmd/tron_keys_commands.go +++ b/core/cmd/tron_keys_commands.go @@ -1,8 +1,8 @@ package cmd import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/tron_keys_commands_test.go b/core/cmd/tron_keys_commands_test.go index 29480600d74..b63128a3cfc 100644 --- a/core/cmd/tron_keys_commands_test.go +++ b/core/cmd/tron_keys_commands_test.go @@ -11,12 +11,12 @@ import ( "github.com/stretchr/testify/require" "github.com/urfave/cli" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/cmd/vrf_keys_commands.go b/core/cmd/vrf_keys_commands.go index a87ab4f87ea..1802eda7f81 100644 --- a/core/cmd/vrf_keys_commands.go +++ b/core/cmd/vrf_keys_commands.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" "github.com/urfave/cli" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/config/p2p_config.go b/core/config/p2p_config.go index 1417fec493d..cc7c24c5bc5 100644 --- a/core/config/p2p_config.go +++ b/core/config/p2p_config.go @@ -1,7 +1,7 @@ package config import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) type P2P interface { diff --git a/core/config/toml/types.go b/core/config/toml/types.go index e543ea4f68a..cc3d0fe094b 100644 --- a/core/config/toml/types.go +++ b/core/config/toml/types.go @@ -16,13 +16,13 @@ import ( chain_selectors "github.com/smartcontractkit/chain-selectors" ocrcommontypes "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/build" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/parse" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/sessions" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" @@ -1348,7 +1348,7 @@ type OCR2 struct { ContractSubscribeInterval *commonconfig.Duration ContractTransmitterTransmitTimeout *commonconfig.Duration DatabaseTimeout *commonconfig.Duration - KeyBundleID *keys.Sha256Hash + KeyBundleID *corekeys.Sha256Hash CaptureEATelemetry *bool CaptureAutomationCustomTelemetry *bool AllowNoBootstrappers *bool @@ -1418,7 +1418,7 @@ type OCR struct { ContractSubscribeInterval *commonconfig.Duration DefaultTransactionQueueDepth *uint32 // Optional - KeyBundleID *keys.Sha256Hash + KeyBundleID *corekeys.Sha256Hash SimulateTransactions *bool TransmitterAddress *types.EIP55Address CaptureEATelemetry *bool diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index 33345597dd4..559b1583bdb 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -56,6 +56,19 @@ import ( evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" evmutils "github.com/smartcontractkit/chainlink-evm/pkg/utils" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/capabilities" @@ -71,19 +84,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/llo" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" "github.com/smartcontractkit/chainlink/v2/core/services/pg" diff --git a/core/internal/cltest/factories.go b/core/internal/cltest/factories.go index 52f32ff3111..e720f245fbe 100644 --- a/core/internal/cltest/factories.go +++ b/core/internal/cltest/factories.go @@ -22,6 +22,8 @@ import ( evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" evmutils "github.com/smartcontractkit/chainlink-evm/pkg/utils" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -30,8 +32,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keeper" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" diff --git a/core/internal/cltest/job_factories.go b/core/internal/cltest/job_factories.go index 08550b7d9b7..dd32b29913f 100644 --- a/core/internal/cltest/job_factories.go +++ b/core/internal/cltest/job_factories.go @@ -7,6 +7,7 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" @@ -14,7 +15,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) diff --git a/core/internal/features/features_test.go b/core/internal/features/features_test.go index 8ffdbd818f9..fd030b44ae8 100644 --- a/core/internal/features/features_test.go +++ b/core/internal/features/features_test.go @@ -45,6 +45,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/consumer_wrapper" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/flags_wrapper" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/link_token_interface" @@ -68,8 +70,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/webhook" diff --git a/core/internal/features/ocr2/features_ocr2_helper.go b/core/internal/features/ocr2/features_ocr2_helper.go index 3367dfaf3a0..78e4ffa00b3 100644 --- a/core/internal/features/ocr2/features_ocr2_helper.go +++ b/core/internal/features/ocr2/features_ocr2_helper.go @@ -47,6 +47,8 @@ import ( evmtestutils "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink-evm/pkg/transmitter" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/common/logpoller/mocks" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" @@ -54,8 +56,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/testhelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" diff --git a/core/internal/features/ocr2/features_ocr2_test.go b/core/internal/features/ocr2/features_ocr2_test.go index d6a930c0402..7ad413fe2cd 100644 --- a/core/internal/features/ocr2/features_ocr2_test.go +++ b/core/internal/features/ocr2/features_ocr2_test.go @@ -28,6 +28,7 @@ import ( confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper" ocrtypes2 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/keys" "github.com/smartcontractkit/chainlink-evm/pkg/transmitter" @@ -36,7 +37,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) diff --git a/core/scripts/chaincli/handler/keeper_launch.go b/core/scripts/chaincli/handler/keeper_launch.go index 2e9604e6c90..51d928dcc0b 100644 --- a/core/scripts/chaincli/handler/keeper_launch.go +++ b/core/scripts/chaincli/handler/keeper_launch.go @@ -22,13 +22,13 @@ import ( "github.com/smartcontractkit/chainlink-common/keystore" "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" iregistry21 "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/i_keeper_registry_master_wrapper_2_1" registry12 "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/keeper_registry_wrapper1_2" registry20 "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/keeper_registry_wrapper2_0" "github.com/smartcontractkit/chainlink/v2/core/cmd" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keeper" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" "github.com/smartcontractkit/chainlink/v2/core/web" ) diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 9003d264d5a..c1ab5c011c0 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1616,6 +1616,7 @@ github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4/go.mod h1:Zpvul9sTcZNAZOVzt5vBl1XZGNvQebFpnpn3/KOQvOQ= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= diff --git a/core/scripts/vrfv2/genvrfnum/main.go b/core/scripts/vrfv2/genvrfnum/main.go index 18bc9ee3964..e149d2499cb 100644 --- a/core/scripts/vrfv2/genvrfnum/main.go +++ b/core/scripts/vrfv2/genvrfnum/main.go @@ -17,10 +17,10 @@ import ( "github.com/shopspring/decimal" "github.com/smartcontractkit/chainlink-common/keystore" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" evmutils "github.com/smartcontractkit/chainlink-evm/pkg/utils" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go b/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go index 9ce961a0301..a14a7c906eb 100644 --- a/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go +++ b/core/scripts/vrfv2/testnet/v2scripts/super_scripts.go @@ -22,11 +22,11 @@ import ( evmtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_owner" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) type CoordinatorConfigV2 struct { diff --git a/core/scripts/vrfv2plus/testnet/proofs.go b/core/scripts/vrfv2plus/testnet/proofs.go index 8f1cef0ca6c..aeb7316ae73 100644 --- a/core/scripts/vrfv2plus/testnet/proofs.go +++ b/core/scripts/vrfv2plus/testnet/proofs.go @@ -12,8 +12,8 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/shopspring/decimal" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/extraargs" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go b/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go index 4e702b9f650..72b412da60d 100644 --- a/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go +++ b/core/scripts/vrfv2plus/testnet/v2plusscripts/super_scripts.go @@ -23,6 +23,8 @@ import ( "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/model" "github.com/smartcontractkit/chainlink/core/scripts/common/vrf/util" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/blockhash_store" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/link_token_interface" @@ -32,8 +34,6 @@ import ( evmclient "github.com/smartcontractkit/chainlink-evm/pkg/client" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" helpers "github.com/smartcontractkit/chainlink/core/scripts/common" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/ccv/ccvcommitteeverifier/delegate.go b/core/services/ccv/ccvcommitteeverifier/delegate.go index 1570407b61c..f42deda5f67 100644 --- a/core/services/ccv/ccvcommitteeverifier/delegate.go +++ b/core/services/ccv/ccvcommitteeverifier/delegate.go @@ -18,6 +18,7 @@ import ( "github.com/smartcontractkit/chainlink-ccv/protocol/common/hmac" "github.com/smartcontractkit/chainlink-ccv/verifier/commit" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/config" @@ -25,7 +26,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ccv/ccvcommon" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) type Delegate struct { diff --git a/core/services/chainlink/config_general.go b/core/services/chainlink/config_general.go index ab96ae60f46..38a50faacfd 100644 --- a/core/services/chainlink/config_general.go +++ b/core/services/chainlink/config_general.go @@ -17,13 +17,13 @@ import ( evmcfg "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" solcfg "github.com/smartcontractkit/chainlink-solana/pkg/solana/config" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/config" coreconfig "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/env" "github.com/smartcontractkit/chainlink/v2/core/config/parse" v2 "github.com/smartcontractkit/chainlink/v2/core/config/toml" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/utils" ) @@ -603,4 +603,4 @@ func (g *generalConfig) LOOPP() coreconfig.LOOPP { return &looppConfig{l: g.c.LOOPP} } -var zeroSha256Hash = keys.Sha256Hash{} +var zeroSha256Hash = corekeys.Sha256Hash{} diff --git a/core/services/chainlink/config_p2p.go b/core/services/chainlink/config_p2p.go index f7118429631..a70d647f9ff 100644 --- a/core/services/chainlink/config_p2p.go +++ b/core/services/chainlink/config_p2p.go @@ -1,10 +1,10 @@ package chainlink import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/toml" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/libocr/commontypes" ) diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index a2d6540a121..a3d78004f1d 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -33,11 +33,11 @@ import ( evmcfg "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" "github.com/smartcontractkit/chainlink-evm/pkg/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/toml" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/feeds/service.go b/core/services/feeds/service.go index 896d9c4a957..54e999159b3 100644 --- a/core/services/feeds/service.go +++ b/core/services/feeds/service.go @@ -27,6 +27,8 @@ import ( pb "github.com/smartcontractkit/chainlink-protos/orchestrator/feedsmanager" "github.com/smartcontractkit/chainlink/v2/core/services/cresettings" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/types" ccip "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" @@ -37,8 +39,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr" ocr2 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" diff --git a/core/services/feeds/service_test.go b/core/services/feeds/service_test.go index 7d237884ed1..d2f13ab9ebb 100644 --- a/core/services/feeds/service_test.go +++ b/core/services/feeds/service_test.go @@ -33,6 +33,10 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/heads" "github.com/smartcontractkit/chainlink-evm/pkg/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" @@ -44,10 +48,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/feeds/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/job" jobmocks "github.com/smartcontractkit/chainlink/v2/core/services/job/mocks" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/versioning" diff --git a/core/services/fluxmonitorv2/flux_monitor_test.go b/core/services/fluxmonitorv2/flux_monitor_test.go index 35632519864..cb17e391859 100644 --- a/core/services/fluxmonitorv2/flux_monitor_test.go +++ b/core/services/fluxmonitorv2/flux_monitor_test.go @@ -25,6 +25,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/flux_aggregator_wrapper" "github.com/smartcontractkit/chainlink-evm/pkg/log" "github.com/smartcontractkit/chainlink-evm/pkg/txmgr" @@ -40,7 +41,6 @@ import ( fmmocks "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/job" jobmocks "github.com/smartcontractkit/chainlink/v2/core/services/job/mocks" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" pipelinemocks "github.com/smartcontractkit/chainlink/v2/core/services/pipeline/mocks" "github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight" diff --git a/core/services/fluxmonitorv2/integrations_test.go b/core/services/fluxmonitorv2/integrations_test.go index 379ec4b7cfb..fcd91eac537 100644 --- a/core/services/fluxmonitorv2/integrations_test.go +++ b/core/services/fluxmonitorv2/integrations_test.go @@ -30,6 +30,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/flags_wrapper" faw "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/flux_aggregator_wrapper" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/link_token_interface" @@ -45,7 +46,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/fluxmonitorv2" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/store/models" "github.com/smartcontractkit/chainlink/v2/core/utils" diff --git a/core/services/fluxmonitorv2/key_store.go b/core/services/fluxmonitorv2/key_store.go index da91024b204..26ea88ea960 100644 --- a/core/services/fluxmonitorv2/key_store.go +++ b/core/services/fluxmonitorv2/key_store.go @@ -6,8 +6,8 @@ import ( "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" ) // KeyStoreInterface defines an interface to interact with the keystore diff --git a/core/services/fluxmonitorv2/mocks/key_store_interface.go b/core/services/fluxmonitorv2/mocks/key_store_interface.go index 32a2100de22..c021fe4f258 100644 --- a/core/services/fluxmonitorv2/mocks/key_store_interface.go +++ b/core/services/fluxmonitorv2/mocks/key_store_interface.go @@ -8,7 +8,7 @@ import ( common "github.com/ethereum/go-ethereum/common" - ethkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" + ethkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" mock "github.com/stretchr/testify/mock" ) diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index 2ad65c4a23e..3bc64f199ea 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -29,6 +29,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/keys" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -43,7 +44,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keeper" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr" ocr2validate "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" diff --git a/core/services/job/models.go b/core/services/job/models.go index d6a39ea27e0..20e7da2c643 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -21,14 +21,14 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/bridges" clnull "github.com/smartcontractkit/chainlink/v2/core/null" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/v2/core/store/models" @@ -296,7 +296,7 @@ type OCROracleSpec struct { ContractAddress evmtypes.EIP55Address `toml:"contractAddress"` P2PV2Bootstrappers pq.StringArray `toml:"p2pv2Bootstrappers" db:"p2pv2_bootstrappers"` IsBootstrapPeer bool `toml:"isBootstrapPeer"` - EncryptedOCRKeyBundleID *keys.Sha256Hash `toml:"keyBundleID"` + EncryptedOCRKeyBundleID *corekeys.Sha256Hash `toml:"keyBundleID"` TransmitterAddress *evmtypes.EIP55Address `toml:"transmitterAddress"` ObservationTimeout sqlutil.Interval `toml:"observationTimeout"` BlockchainTimeout sqlutil.Interval `toml:"blockchainTimeout"` diff --git a/core/services/job/orm.go b/core/services/job/orm.go index 9dc7b2f27e2..5cb52f79290 100644 --- a/core/services/job/orm.go +++ b/core/services/job/orm.go @@ -17,6 +17,7 @@ import ( "github.com/lib/pq" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types" evmconfig "github.com/smartcontractkit/chainlink-evm/pkg/config" @@ -27,7 +28,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" medianconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/median/config" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/relay" @@ -1026,7 +1026,7 @@ func LoadConfigVarsOCR(evmOcrCfg evmconfig.OCR, ocrCfg OCRConfig, os OCROracleSp if err != nil { return nil, err } - encryptedOCRKeyBundleID, err := keys.Sha256HashFromHex(kb) + encryptedOCRKeyBundleID, err := corekeys.Sha256HashFromHex(kb) if err != nil { return nil, err } diff --git a/core/services/job/runner_integration_test.go b/core/services/job/runner_integration_test.go index 7f503592840..489368ff2cd 100644 --- a/core/services/job/runner_integration_test.go +++ b/core/services/job/runner_integration_test.go @@ -24,6 +24,7 @@ import ( "github.com/smartcontractkit/freeport" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -41,7 +42,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" "github.com/smartcontractkit/chainlink/v2/core/services/ocr" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" diff --git a/core/services/keystore/aptos.go b/core/services/keystore/aptos.go index 2187c14b299..b1cbafbd776 100644 --- a/core/services/keystore/aptos.go +++ b/core/services/keystore/aptos.go @@ -6,9 +6,9 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" ) type Aptos interface { diff --git a/core/services/keystore/aptos_test.go b/core/services/keystore/aptos_test.go index b2e29f51d64..9459272d8d1 100644 --- a/core/services/keystore/aptos_test.go +++ b/core/services/keystore/aptos_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" ) func Test_AptosKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/cosmos.go b/core/services/keystore/cosmos.go index 38bdc063e34..16608397e92 100644 --- a/core/services/keystore/cosmos.go +++ b/core/services/keystore/cosmos.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" ) type Cosmos interface { diff --git a/core/services/keystore/cosmos_test.go b/core/services/keystore/cosmos_test.go index 8dd6f8a347c..9fcf40e4c56 100644 --- a/core/services/keystore/cosmos_test.go +++ b/core/services/keystore/cosmos_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" ) func Test_CosmosKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/csa.go b/core/services/keystore/csa.go index f60d614eedb..2b2b7d2ec8f 100644 --- a/core/services/keystore/csa.go +++ b/core/services/keystore/csa.go @@ -8,8 +8,8 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ) // ErrCSAKeyExists describes the error when the CSA key already exists diff --git a/core/services/keystore/csa_test.go b/core/services/keystore/csa_test.go index 281cd0933c5..f97af3f28f5 100644 --- a/core/services/keystore/csa_test.go +++ b/core/services/keystore/csa_test.go @@ -9,11 +9,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ) func Test_CSAKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/dkg_recipient.go b/core/services/keystore/dkg_recipient.go index e0e74c0ca33..61c2a225ff5 100644 --- a/core/services/keystore/dkg_recipient.go +++ b/core/services/keystore/dkg_recipient.go @@ -6,7 +6,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" ) // ErrDKGRecipientKeyExists describes the error when the DKG recipient key already exists diff --git a/core/services/keystore/dkgrecipient_test.go b/core/services/keystore/dkgrecipient_test.go index 54bef0d77a2..03ac71e6095 100644 --- a/core/services/keystore/dkgrecipient_test.go +++ b/core/services/keystore/dkgrecipient_test.go @@ -9,12 +9,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" ) func Test_DKGRecipientKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/eth.go b/core/services/keystore/eth.go index 38722a6be24..fdb63732051 100644 --- a/core/services/keystore/eth.go +++ b/core/services/keystore/eth.go @@ -13,11 +13,11 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types/core" evmkeystore "github.com/smartcontractkit/chainlink-evm/pkg/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/keystore/eth_test.go b/core/services/keystore/eth_test.go index 7e2cc168e4f..813e7862ca9 100644 --- a/core/services/keystore/eth_test.go +++ b/core/services/keystore/eth_test.go @@ -16,12 +16,12 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/txmgr/txmgrtest" "github.com/smartcontractkit/chainlink-evm/pkg/utils" + keystorekeys "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - keystorekeys "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" ) func Test_EthKeyStore(t *testing.T) { diff --git a/core/services/keystore/helpers_test.go b/core/services/keystore/helpers_test.go index 26293034f22..e6ca7eccafd 100644 --- a/core/services/keystore/helpers_test.go +++ b/core/services/keystore/helpers_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/smartcontractkit/chainlink-common/keystore" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/models" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/models" ) func ExposedNewMaster(t *testing.T, ds sqlutil.DataSource) *master { diff --git a/core/services/keystore/internal/exportutils.go b/core/services/keystore/internal/exportutils.go deleted file mode 100644 index 2f6b5cef2cd..00000000000 --- a/core/services/keystore/internal/exportutils.go +++ /dev/null @@ -1,84 +0,0 @@ -package internal - -import ( - "encoding/json" - "fmt" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" -) - -type Encrypted interface { - GetCrypto() keystore.CryptoJSON -} - -// EncryptedKeyExport represents a chain specific encrypted key -type EncryptedKeyExport struct { - KeyType string `json:"keyType"` - PublicKey string `json:"publicKey"` - Crypto keystore.CryptoJSON `json:"crypto"` -} - -func (x EncryptedKeyExport) GetCrypto() keystore.CryptoJSON { - return x.Crypto -} - -// FromEncryptedJSON gets key [K] from keyJSON [E] and password -func FromEncryptedJSON[E Encrypted, K any]( - identifier string, - keyJSON []byte, - password string, - passwordFunc func(string) string, - privKeyToKey func(export E, rawPrivKey Raw) (K, error), -) (K, error) { - // unmarshal byte data to [E] Encrypted key export - var export E - if err := json.Unmarshal(keyJSON, &export); err != nil { - return *new(K), err - } - - // decrypt data using prefixed password - privKey, err := keystore.DecryptDataV3(export.GetCrypto(), passwordFunc(password)) - if err != nil { - return *new(K), fmt.Errorf("failed to decrypt %s key: %w", identifier, err) - } - - // convert unmarshalled data and decrypted key to [K] key format - key, err := privKeyToKey(export, NewRaw(privKey)) - if err != nil { - return *new(K), fmt.Errorf("failed to convert %s key to key bundle: %w", identifier, err) - } - - return key, nil -} - -type Key interface { - Raw() Raw -} - -// ToEncryptedJSON returns encrypted JSON [E] representing key [K] -func ToEncryptedJSON[E Encrypted, K Key]( - identifier string, - key K, - password string, - scryptParams commonkeystore.ScryptParams, - passwordFunc func(string) string, - buildExport func(id string, key K, cryptoJSON keystore.CryptoJSON) E, -) (export []byte, err error) { - // encrypt data using prefixed password - cryptoJSON, err := keystore.EncryptDataV3( - key.Raw().bytes, - []byte(passwordFunc(password)), - scryptParams.N, - scryptParams.P, - ) - if err != nil { - return nil, fmt.Errorf("could not encrypt %s key: %w", identifier, err) - } - - // build [E] export struct using encrypted key, identifier, and original key [K] - encryptedKeyExport := buildExport(identifier, key, cryptoJSON) - - return json.Marshal(encryptedKeyExport) -} diff --git a/core/services/keystore/internal/raw.go b/core/services/keystore/internal/raw.go deleted file mode 100644 index ae97519851a..00000000000 --- a/core/services/keystore/internal/raw.go +++ /dev/null @@ -1,30 +0,0 @@ -// Package internal declares a Raw private key type, -// only available for use in the keystore sub-tree. -package internal - -// Raw is a wrapper type that holds private key bytes -// and is designed to prevent accidental logging. -// The only way to access the internal bytes (without reflection) is to use Bytes, -// which is only available to ancestor packages of the parent keystore/ directory. -type Raw struct { - bytes []byte -} - -func NewRaw(b []byte) Raw { - return Raw{bytes: b} -} - -func (raw Raw) String() string { - return "" -} - -func (raw Raw) GoString() string { - return raw.String() -} - -// Bytes is a func for accessing the internal bytes field of Raw. -// It is not declared as a method, because that would allow access from callers which cannot otherwise access this internal package. -func Bytes(raw Raw) []byte { return raw.bytes } - -// RawBytes is a helper to use Bytes with keys that have a Raw() method. -func RawBytes(key interface{ Raw() Raw }) []byte { return Bytes(key.Raw()) } diff --git a/core/services/keystore/internal/raw_test.go b/core/services/keystore/internal/raw_test.go deleted file mode 100644 index dc5162a53e2..00000000000 --- a/core/services/keystore/internal/raw_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package internal - -import ( - "encoding/hex" - "encoding/json" - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestRaw_nonprintable(t *testing.T) { - bytes, err := hex.DecodeString("f0d07ab448018b2754475f9a3b580218b0675a1456aad96ad607c7bbd7d9237b") - require.NoError(t, err) - r := NewRaw(bytes) - - exp := "" - - assert.Equal(t, exp, fmt.Sprint(r)) - - assert.Equal(t, exp, fmt.Sprintf("%v", r)) - - assert.Equal(t, exp, fmt.Sprintf("%#v", r)) - - assert.Equal(t, exp, r.String()) //nolint:gosimple // S1025 deliberately testing formatting verbs - - got, err := json.Marshal(r) //nolint:staticcheck // SA9005 deliberately testing marshalling - - if assert.NoError(t, err) { - assert.Equal(t, `{}`, string(got)) - } -} diff --git a/core/services/keystore/keys/aptoskey/export.go b/core/services/keystore/keys/aptoskey/export.go deleted file mode 100644 index cb0ae6113c3..00000000000 --- a/core/services/keystore/keys/aptoskey/export.go +++ /dev/null @@ -1,47 +0,0 @@ -package aptoskey - -import ( - "encoding/hex" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "Aptos" - -// FromEncryptedJSON gets key from json and password -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -// ToEncryptedJSON returns encrypted JSON representing key -func (key Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: hex.EncodeToString(key.pubKey), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "aptoskey" + password -} diff --git a/core/services/keystore/keys/aptoskey/export_test.go b/core/services/keystore/keys/aptoskey/export_test.go deleted file mode 100644 index a920e432298..00000000000 --- a/core/services/keystore/keys/aptoskey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package aptoskey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestAptosKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return New() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/aptoskey/key.go b/core/services/keystore/keys/aptoskey/key.go deleted file mode 100644 index 2ea6d44c0db..00000000000 --- a/core/services/keystore/keys/aptoskey/key.go +++ /dev/null @@ -1,87 +0,0 @@ -package aptoskey - -import ( - "crypto" - "crypto/ed25519" - crypto_rand "crypto/rand" - "fmt" - "io" - - "golang.org/x/crypto/sha3" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -// Key represents Aptos key -type Key struct { - // TODO: store initial Account() derivation to support key rotation - raw internal.Raw - signFn func(io.Reader, []byte, crypto.SignerOpts) ([]byte, error) - pubKey ed25519.PublicKey -} - -func KeyFor(raw internal.Raw) Key { - privKey := ed25519.NewKeyFromSeed(internal.Bytes(raw)) - pubKey := privKey.Public().(ed25519.PublicKey) - return Key{ - raw: raw, - signFn: privKey.Sign, - pubKey: pubKey, - } -} - -// New creates new Key -func New() (Key, error) { - return newFrom(crypto_rand.Reader) -} - -// MustNewInsecure return Key if no error -func MustNewInsecure(reader io.Reader) Key { - key, err := newFrom(reader) - if err != nil { - panic(err) - } - return key -} - -// newFrom creates new Key from a provided random reader -func newFrom(reader io.Reader) (Key, error) { - pub, priv, err := ed25519.GenerateKey(reader) - if err != nil { - return Key{}, err - } - return Key{ - raw: internal.NewRaw(priv.Seed()), - signFn: priv.Sign, - pubKey: pub, - }, nil -} - -// ID gets Key ID -func (key Key) ID() string { - return key.PublicKeyStr() -} - -// https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md#long -func (key Key) Account() string { - authKey := sha3.Sum256(append([]byte(key.pubKey), 0x00)) - return fmt.Sprintf("%064x", authKey) -} - -// GetPublic get Key's public key -func (key Key) GetPublic() ed25519.PublicKey { - return key.pubKey -} - -// PublicKeyStr returns hex encoded public key -func (key Key) PublicKeyStr() string { - return fmt.Sprintf("%064x", key.pubKey) -} - -// Raw returns the seed from private key -func (key Key) Raw() internal.Raw { return key.raw } - -// Sign is used to sign a message -func (key Key) Sign(msg []byte) ([]byte, error) { - return key.signFn(crypto_rand.Reader, msg, crypto.Hash(0)) // no specific hash function used -} diff --git a/core/services/keystore/keys/aptoskey/key_test.go b/core/services/keystore/keys/aptoskey/key_test.go deleted file mode 100644 index 955eb153bf5..00000000000 --- a/core/services/keystore/keys/aptoskey/key_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package aptoskey - -import ( - "encoding/hex" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func TestAptosKey(t *testing.T) { - bytes, err := hex.DecodeString("f0d07ab448018b2754475f9a3b580218b0675a1456aad96ad607c7bbd7d9237b") - require.NoError(t, err) - k := KeyFor(internal.NewRaw(bytes)) - assert.Equal(t, "2acd605efc181e2af8a0b8c0686a5e12578efa1253d15a235fa5e5ad970c4b29", k.PublicKeyStr()) - assert.Equal(t, "69d8b07f5945185873c622ea66873b0e1fb921de7b94d904d3ef9be80770682e", k.Account()) -} diff --git a/core/services/keystore/keys/cosmoskey/export.go b/core/services/keystore/keys/cosmoskey/export.go deleted file mode 100644 index acbe5540cf5..00000000000 --- a/core/services/keystore/keys/cosmoskey/export.go +++ /dev/null @@ -1,47 +0,0 @@ -package cosmoskey - -import ( - "encoding/hex" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "Cosmos" - -// FromEncryptedJSON gets key from json and password -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -// ToEncryptedJSON returns encrypted JSON representing key -func (key Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: hex.EncodeToString(key.PublicKey().Bytes()), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "cosmoskey" + password -} diff --git a/core/services/keystore/keys/cosmoskey/export_test.go b/core/services/keystore/keys/cosmoskey/export_test.go deleted file mode 100644 index 48b68c6b09b..00000000000 --- a/core/services/keystore/keys/cosmoskey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package cosmoskey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestCosmosKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return New(), nil -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/cosmoskey/key.go b/core/services/keystore/keys/cosmoskey/key.go deleted file mode 100644 index fcd5109a334..00000000000 --- a/core/services/keystore/keys/cosmoskey/key.go +++ /dev/null @@ -1,78 +0,0 @@ -package cosmoskey - -import ( - "crypto/ecdsa" - cryptorand "crypto/rand" - "fmt" - "io" - "math/big" - - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/ethereum/go-ethereum/crypto" - - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -var secpSigningAlgo, _ = keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), []keyring.SignatureAlgo{hd.Secp256k1}) - -func KeyFor(raw internal.Raw) Key { - d := big.NewInt(0).SetBytes(internal.Bytes(raw)) - privKey := secpSigningAlgo.Generate()(d.Bytes()) - return Key{ - raw: raw, - signFn: privKey.Sign, - pubKey: privKey.PubKey(), - } -} - -// Key represents Cosmos key -type Key struct { - raw internal.Raw - signFn func([]byte) ([]byte, error) - pubKey cryptotypes.PubKey -} - -// New creates new Key -func New() Key { - return newFrom(cryptorand.Reader) -} - -// MustNewInsecure return Key -func MustNewInsecure(reader io.Reader) Key { - return newFrom(reader) -} - -func newFrom(reader io.Reader) Key { - rawKey, err := ecdsa.GenerateKey(crypto.S256(), reader) - if err != nil { - panic(err) - } - privKey := secpSigningAlgo.Generate()(rawKey.D.Bytes()) - - return Key{ - raw: internal.NewRaw(rawKey.D.Bytes()), - signFn: privKey.Sign, - pubKey: privKey.PubKey(), - } -} - -func (key Key) ID() string { - return key.PublicKeyStr() -} - -func (key Key) PublicKey() (pubKey cryptotypes.PubKey) { - return key.pubKey -} - -func (key Key) PublicKeyStr() string { - return fmt.Sprintf("%X", key.pubKey.Bytes()) -} - -func (key Key) Raw() internal.Raw { return key.raw } - -func (key Key) Sign(data []byte) ([]byte, error) { - return key.signFn(data) -} diff --git a/core/services/keystore/keys/csakey/export.go b/core/services/keystore/keys/csakey/export.go deleted file mode 100644 index 5b4a8232970..00000000000 --- a/core/services/keystore/keys/csakey/export.go +++ /dev/null @@ -1,43 +0,0 @@ -package csakey - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "CSA" - -func FromEncryptedJSON(keyJSON []byte, password string) (KeyV2, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (KeyV2, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -func (k KeyV2) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - k, - password, - scryptParams, - adulteratedPassword, - func(id string, key KeyV2, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: key.PublicKeyString(), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "csakey" + password -} diff --git a/core/services/keystore/keys/csakey/export_test.go b/core/services/keystore/keys/csakey/export_test.go deleted file mode 100644 index bc1a475b17a..00000000000 --- a/core/services/keystore/keys/csakey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package csakey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestCSAKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return NewV2() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/csakey/key_v2.go b/core/services/keystore/keys/csakey/key_v2.go deleted file mode 100644 index 789135c645b..00000000000 --- a/core/services/keystore/keys/csakey/key_v2.go +++ /dev/null @@ -1,83 +0,0 @@ -package csakey - -import ( - "crypto" - "crypto/ed25519" - cryptorand "crypto/rand" - "encoding/hex" - "fmt" - "io" - "math/big" - - "github.com/smartcontractkit/wsrpc/credentials" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func KeyFor(raw internal.Raw) KeyV2 { - privKey := ed25519.PrivateKey(internal.Bytes(raw)) - return KeyV2{ - raw: raw, - signer: &privKey, - PublicKey: privKey.Public().(ed25519.PublicKey), - } -} - -type KeyV2 struct { - raw internal.Raw - signer crypto.Signer - - PublicKey ed25519.PublicKey - Version int -} - -func (k KeyV2) StaticSizedPublicKey() (sspk credentials.StaticSizedPublicKey) { - if len(k.PublicKey) != ed25519.PublicKeySize { - panic(fmt.Sprintf("expected ed25519.PublicKey to have len %d but got len %d", ed25519.PublicKeySize, len(k.PublicKey))) - } - copy(sspk[:], k.PublicKey) - return sspk -} - -func NewV2() (KeyV2, error) { - pubKey, privKey, err := ed25519.GenerateKey(cryptorand.Reader) - if err != nil { - return KeyV2{}, err - } - return KeyV2{ - raw: internal.NewRaw(privKey), - signer: &privKey, - PublicKey: pubKey, - Version: 2, - }, nil -} - -func MustNewV2XXXTestingOnly(k *big.Int) KeyV2 { - seed := make([]byte, ed25519.SeedSize) - copy(seed, k.Bytes()) - privKey := ed25519.NewKeyFromSeed(seed) - return KeyV2{ - raw: internal.NewRaw(privKey), - signer: privKey, - PublicKey: privKey.Public().(ed25519.PublicKey), - Version: 2, - } -} - -func (k KeyV2) ID() string { - return k.PublicKeyString() -} - -func (k KeyV2) PublicKeyString() string { - return hex.EncodeToString(k.PublicKey) -} - -func (k KeyV2) Raw() internal.Raw { - return k.raw -} - -func (k KeyV2) Public() crypto.PublicKey { return k.PublicKey } - -func (k KeyV2) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) { - return k.signer.Sign(rand, message, opts) -} diff --git a/core/services/keystore/keys/csakey/key_v2_test.go b/core/services/keystore/keys/csakey/key_v2_test.go deleted file mode 100644 index d4c237a100e..00000000000 --- a/core/services/keystore/keys/csakey/key_v2_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package csakey - -import ( - "crypto/ed25519" - "encoding/hex" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func TestCSAKeyV2_FromRawPrivateKey(t *testing.T) { - pubKey, privKey, err := ed25519.GenerateKey(nil) - require.NoError(t, err) - - keyV2 := KeyFor(internal.NewRaw(privKey)) - - assert.Equal(t, pubKey, keyV2.PublicKey) - assert.Equal(t, []byte(privKey), internal.Bytes(keyV2.raw)) - assert.Equal(t, hex.EncodeToString(pubKey), keyV2.PublicKeyString()) -} - -func TestCSAKeyV2_NewV2(t *testing.T) { - keyV2, err := NewV2() - require.NoError(t, err) - - assert.Equal(t, 2, keyV2.Version) - assert.NotNil(t, keyV2.PublicKey) - assert.NotNil(t, keyV2.raw) -} diff --git a/core/services/keystore/keys/dkgrecipientkey/export.go b/core/services/keystore/keys/dkgrecipientkey/export.go deleted file mode 100644 index 3c8ccd73191..00000000000 --- a/core/services/keystore/keys/dkgrecipientkey/export.go +++ /dev/null @@ -1,43 +0,0 @@ -package dkgrecipientkey - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "DKGRecipient" - -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -func (k Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - k, - password, - scryptParams, - adulteratedPassword, - func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: key.PublicKeyString(), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "dkgrecipientkey" + password -} diff --git a/core/services/keystore/keys/dkgrecipientkey/key.go b/core/services/keystore/keys/dkgrecipientkey/key.go deleted file mode 100644 index 81143f08ee0..00000000000 --- a/core/services/keystore/keys/dkgrecipientkey/key.go +++ /dev/null @@ -1,61 +0,0 @@ -package dkgrecipientkey - -import ( - cryptorand "crypto/rand" - "encoding/hex" - - "github.com/smartcontractkit/smdkg/dkgocr/dkgocrtypes" - "github.com/smartcontractkit/smdkg/p256keyring" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -var _ internal.Key = &Key{} -var _ dkgocrtypes.P256Keyring = &Key{} - -type Key struct { - raw internal.Raw - keyRing dkgocrtypes.P256Keyring -} - -func New() (Key, error) { - keyRing, err := p256keyring.New(cryptorand.Reader) - if err != nil { - return Key{}, err - } - rawBytes, err := keyRing.MarshalBinary() - if err != nil { - return Key{}, err - } - - return Key{raw: internal.NewRaw(rawBytes), keyRing: keyRing}, nil -} - -func (k Key) PublicKey() dkgocrtypes.P256ParticipantPublicKey { - return k.keyRing.PublicKey() -} - -func (k Key) PublicKeyString() string { - return hex.EncodeToString(k.keyRing.PublicKey()[:]) -} - -func (k Key) ID() string { - return k.PublicKeyString() -} - -func (k Key) ECDH(publicKey dkgocrtypes.P256ParticipantPublicKey) (dkgocrtypes.P256ECDHSharedSecret, error) { - return k.keyRing.ECDH(publicKey) -} - -func KeyFor(raw internal.Raw) Key { - keyRing := &p256keyring.P256Keyring{} - err := keyRing.UnmarshalBinary(internal.Bytes(raw)) - if err != nil { - panic(err) - } - return Key{raw: raw, keyRing: keyRing} -} - -func (k Key) Raw() internal.Raw { - return k.raw -} diff --git a/core/services/keystore/keys/dkgrecipientkey/key_test.go b/core/services/keystore/keys/dkgrecipientkey/key_test.go deleted file mode 100644 index db9ca4da27d..00000000000 --- a/core/services/keystore/keys/dkgrecipientkey/key_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package dkgrecipientkey - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func TestNew(t *testing.T) { - key, err := New() - require.NoError(t, err) - - assert.NotNil(t, key.PublicKey()) - assert.NotNil(t, key.Raw()) - assert.Equal(t, key.ID(), key.PublicKeyString()) -} - -func TestPublicKey(t *testing.T) { - key, err := New() - require.NoError(t, err) - - pubKey := key.PublicKey() - assert.NotNil(t, pubKey) - assert.Len(t, pubKey, 33) -} - -func TestPublicKeyString(t *testing.T) { - key, err := New() - require.NoError(t, err) - - pubKeyStr := key.PublicKeyString() - assert.NotEmpty(t, pubKeyStr) - assert.Len(t, pubKeyStr, 66) -} - -func TestECDH(t *testing.T) { - key1, err := New() - require.NoError(t, err) - - key2, err := New() - require.NoError(t, err) - - secret1, err := key1.ECDH(key2.PublicKey()) - require.NoError(t, err) - - secret2, err := key2.ECDH(key1.PublicKey()) - require.NoError(t, err) - - assert.Equal(t, secret1, secret2) - assert.NotEmpty(t, secret1) -} - -func TestRaw(t *testing.T) { - key, err := New() - require.NoError(t, err) - - raw := key.Raw() - assert.NotNil(t, raw) - - rawBytes := internal.Bytes(raw) - assert.NotEmpty(t, rawBytes) - - key2 := KeyFor(raw) - assert.Equal(t, key.PublicKeyString(), key2.PublicKeyString()) -} - -func TestKeyUniqueness(t *testing.T) { - key1, err := New() - require.NoError(t, err) - - key2, err := New() - require.NoError(t, err) - - key3, err := New() - require.NoError(t, err) - - assert.NotEqual(t, key1.PublicKey(), key2.PublicKey()) - assert.NotEqual(t, key1.PublicKey(), key3.PublicKey()) - assert.NotEqual(t, key2.PublicKey(), key3.PublicKey()) - - assert.NotEqual(t, key1.PublicKeyString(), key2.PublicKeyString()) - assert.NotEqual(t, key1.PublicKeyString(), key3.PublicKeyString()) - assert.NotEqual(t, key2.PublicKeyString(), key3.PublicKeyString()) -} diff --git a/core/services/keystore/keys/ethkey/export.go b/core/services/keystore/keys/ethkey/export.go deleted file mode 100644 index b8f1ee6d910..00000000000 --- a/core/services/keystore/keys/ethkey/export.go +++ /dev/null @@ -1,23 +0,0 @@ -package ethkey - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/google/uuid" - "github.com/pkg/errors" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" -) - -func (key KeyV2) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - // DEV: uuid is derived directly from the address, since it is not stored internally - id, err := uuid.FromBytes(key.Address.Bytes()[:16]) - if err != nil { - return nil, errors.Wrapf(err, "could not generate ethkey UUID") - } - dKey := &keystore.Key{ - Id: id, - Address: key.Address, - PrivateKey: key.getPK(), - } - return keystore.EncryptKey(dKey, password, scryptParams.N, scryptParams.P) -} diff --git a/core/services/keystore/keys/ethkey/export_test.go b/core/services/keystore/keys/ethkey/export_test.go deleted file mode 100644 index 588fef050bc..00000000000 --- a/core/services/keystore/keys/ethkey/export_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package ethkey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestEthKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, func(keyJSON []byte, password string) (kt keys.KeyType, err error) { - t.SkipNow() - return kt, err - }) -} - -func createKey() (keys.KeyType, error) { - return NewV2() -} diff --git a/core/services/keystore/keys/ethkey/key_v2.go b/core/services/keystore/keys/ethkey/key_v2.go deleted file mode 100644 index dcf951a775f..00000000000 --- a/core/services/keystore/keys/ethkey/key_v2.go +++ /dev/null @@ -1,87 +0,0 @@ -package ethkey - -import ( - "bytes" - "crypto/ecdsa" - "crypto/rand" - "fmt" - "math/big" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - gethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - - "github.com/smartcontractkit/chainlink-evm/pkg/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -var curve = crypto.S256() - -func KeyFor(raw internal.Raw) KeyV2 { - var privateKey ecdsa.PrivateKey - d := big.NewInt(0).SetBytes(internal.Bytes(raw)) - privateKey.Curve = curve - privateKey.D = d - privateKey.X, privateKey.Y = curve.ScalarBaseMult(d.Bytes()) - k := newKeyV2(&privateKey) - k.raw = raw - return k -} - -type KeyV2 struct { - raw internal.Raw - getPK func() *ecdsa.PrivateKey - Address common.Address - EIP55Address types.EIP55Address -} - -func newKeyV2(privKey *ecdsa.PrivateKey) KeyV2 { - address := crypto.PubkeyToAddress(privKey.PublicKey) - eip55 := types.EIP55AddressFromAddress(address) - return KeyV2{ - getPK: func() *ecdsa.PrivateKey { return privKey }, - Address: address, - EIP55Address: eip55, - } -} - -func NewV2() (KeyV2, error) { - privateKeyECDSA, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) - if err != nil { - return KeyV2{}, err - } - return FromPrivateKey(privateKeyECDSA), nil -} - -func FromPrivateKey(privKey *ecdsa.PrivateKey) (key KeyV2) { - key = newKeyV2(privKey) - key.raw = internal.NewRaw(privKey.D.Bytes()) - return -} - -func (key KeyV2) ID() string { - return key.Address.Hex() -} - -func (key KeyV2) Raw() internal.Raw { return key.raw } - -func (key KeyV2) Sign(data []byte) ([]byte, error) { return crypto.Sign(data, key.getPK()) } - -// Cmp uses byte-order address comparison to give a stable comparison between two keys -func (key KeyV2) Cmp(key2 KeyV2) int { - return bytes.Compare(key.Address.Bytes(), key2.Address.Bytes()) -} - -func (key KeyV2) SignerFn(chainID *big.Int) bind.SignerFn { - return func(from common.Address, tx *gethtypes.Transaction) (*gethtypes.Transaction, error) { - signer := gethtypes.LatestSignerForChainID(chainID) - h := signer.Hash(tx) - sig, err := key.Sign(h[:]) - if err != nil { - return nil, fmt.Errorf("failed to sign transaction: %w", err) - } - return tx.WithSignature(signer, sig) - } -} diff --git a/core/services/keystore/keys/ethkey/key_v2_test.go b/core/services/keystore/keys/ethkey/key_v2_test.go deleted file mode 100644 index 2541967bae2..00000000000 --- a/core/services/keystore/keys/ethkey/key_v2_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package ethkey - -import ( - "crypto/ecdsa" - "crypto/rand" - "testing" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-evm/pkg/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func TestEthKeyV2_ToKey(t *testing.T) { - privateKeyECDSA, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) - require.NoError(t, err) - - k := KeyFor(internal.NewRaw(privateKeyECDSA.D.Bytes())) - - assert.Equal(t, k.getPK(), privateKeyECDSA) - assert.Equal(t, k.getPK().X, privateKeyECDSA.X) - assert.Equal(t, k.getPK().Y, privateKeyECDSA.Y) - assert.Equal(t, types.EIP55AddressFromAddress(crypto.PubkeyToAddress(privateKeyECDSA.PublicKey)).Hex(), k.ID()) -} - -func TestEthKeyV2_NewV2(t *testing.T) { - keyV2, err := NewV2() - require.NoError(t, err) - - assert.NotZero(t, keyV2.Address) - assert.NotNil(t, keyV2.getPK()) - assert.Equal(t, keyV2.Address.Hex(), keyV2.ID()) -} diff --git a/core/services/keystore/keys/exporttestutils.go b/core/services/keystore/keys/exporttestutils.go deleted file mode 100644 index 4a1db6e877f..00000000000 --- a/core/services/keystore/keys/exporttestutils.go +++ /dev/null @@ -1,51 +0,0 @@ -package keys - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -// KeyType represents a key type for keys testing -type KeyType interface { - ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) - Raw() internal.Raw - ID() string -} - -// CreateKeyFunc represents a function to create a key -type CreateKeyFunc func() (KeyType, error) - -// DecryptFunc represents a function to decrypt a key -type DecryptFunc func(keyJSON []byte, password string) (KeyType, error) - -// RunKeyExportImportTestcase executes a testcase to validate keys import/export functionality -func RunKeyExportImportTestcase(t *testing.T, createKey CreateKeyFunc, decrypt DecryptFunc) { - key, err := createKey() - require.NoError(t, err) - - json, err := key.ToEncryptedJSON("password", commonkeystore.FastScryptParams) - require.NoError(t, err) - - assert.NotEmpty(t, json) - - imported, err := decrypt(json, "password") - require.NoError(t, err) - - require.Equal(t, key.ID(), imported.ID()) - require.Equal(t, internal.RawBytes(key), internal.RawBytes(imported)) -} - -func RequireEqualKeys(t *testing.T, a, b interface { - ID() string - Raw() internal.Raw -}) { - t.Helper() - require.Equal(t, a.ID(), b.ID(), "ids be equal") - require.Equal(t, a.Raw(), b.Raw(), "raw bytes must be equal") - require.EqualExportedValues(t, a, b) -} diff --git a/core/services/keystore/keys/models/legacy_key.go b/core/services/keystore/keys/models/legacy_key.go deleted file mode 100644 index 84d2b187a62..00000000000 --- a/core/services/keystore/keys/models/legacy_key.go +++ /dev/null @@ -1,104 +0,0 @@ -package models - -import ( - "encoding/json" - "slices" - - "github.com/pkg/errors" -) - -type rawLegacyKey []string -type rawLegacyKeys map[string]rawLegacyKey - -type LegacyKeyStorage struct { - legacyRawKeys rawLegacyKeys -} - -func (rlk *rawLegacyKeys) len() (n int) { - for _, v := range *rlk { - n += len(v) - } - return n -} - -func (rlk *rawLegacyKeys) has(name string) bool { - for n := range *rlk { - if n == name { - return true - } - } - return false -} - -func (rlk *rawLegacyKeys) hasValueInField(fieldName, value string) bool { - return slices.Contains((*rlk)[fieldName], value) -} - -// StoreUnsupported will store the raw keys that no longer have support in the node -// it will check if raw json contains keys that have not been added to the key ring -// and stores them internally -func (k *LegacyKeyStorage) StoreUnsupported(allRawKeysJSON []byte, keyRing *KeyRing) error { - if keyRing == nil { - return errors.New("keyring is nil") - } - supportedKeyRingJson, err := json.Marshal(keyRing.raw()) - if err != nil { - return err - } - - var ( - allKeys = rawLegacyKeys{} - supportedKeys = rawLegacyKeys{} - ) - - err = json.Unmarshal(allRawKeysJSON, &allKeys) - if err != nil { - return err - } - err = json.Unmarshal(supportedKeyRingJson, &supportedKeys) - if err != nil { - return err - } - - k.legacyRawKeys = rawLegacyKeys{} - for fName, fValue := range allKeys { - if !supportedKeys.has(fName) { - k.legacyRawKeys[fName] = fValue - continue - } - for _, v := range allKeys[fName] { - if !supportedKeys.hasValueInField(fName, v) { - k.legacyRawKeys[fName] = append(k.legacyRawKeys[fName], v) - } - } - } - - return nil -} - -// UnloadUnsupported will inject the unsupported keys into the raw key ring json -func (k *LegacyKeyStorage) UnloadUnsupported(supportedRawKeyRingJson []byte) ([]byte, error) { - supportedKeys := rawLegacyKeys{} - err := json.Unmarshal(supportedRawKeyRingJson, &supportedKeys) - if err != nil { - return nil, err - } - - for fName, vals := range k.legacyRawKeys { - if !supportedKeys.has(fName) { - supportedKeys[fName] = vals - continue - } - for _, v := range vals { - if !supportedKeys.hasValueInField(fName, v) { - supportedKeys[fName] = append(supportedKeys[fName], v) - } - } - } - - allKeysJson, err := json.Marshal(supportedKeys) - if err != nil { - return nil, err - } - return allKeysJson, nil -} diff --git a/core/services/keystore/keys/models/models.go b/core/services/keystore/keys/models/models.go deleted file mode 100644 index 93653d75219..00000000000 --- a/core/services/keystore/keys/models/models.go +++ /dev/null @@ -1,365 +0,0 @@ -package models - -import ( - "encoding/json" - "math/big" - "time" - - gethkeystore "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/pkg/errors" - - "github.com/smartcontractkit/chainlink-common/keystore" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" -) - -type EncryptedKeyRing struct { - UpdatedAt time.Time - EncryptedKeys []byte -} - -func (ekr EncryptedKeyRing) Decrypt(password string) (*KeyRing, error) { - if len(ekr.EncryptedKeys) == 0 { - return NewKeyRing(), nil - } - var cryptoJSON gethkeystore.CryptoJSON - err := json.Unmarshal(ekr.EncryptedKeys, &cryptoJSON) - if err != nil { - return nil, err - } - marshalledRawKeyRingJson, err := gethkeystore.DecryptDataV3(cryptoJSON, adulteratedPassword(password)) - if err != nil { - return nil, err - } - var rawKeys rawKeyRing - err = json.Unmarshal(marshalledRawKeyRingJson, &rawKeys) - if err != nil { - return nil, err - } - ring, err := rawKeys.keys() - if err != nil { - return nil, err - } - - err = rawKeys.LegacyKeys.StoreUnsupported(marshalledRawKeyRingJson, ring) - if err != nil { - return nil, err - } - ring.LegacyKeys = rawKeys.LegacyKeys - - return ring, nil -} - -type KeyStates struct { - // Key ID => chain ID => state - KeyIDChainID map[string]map[string]*ethkey.State - // Chain ID => Key ID => state - ChainIDKeyID map[string]map[string]*ethkey.State - All []*ethkey.State -} - -func NewKeyStates() *KeyStates { - return &KeyStates{ - KeyIDChainID: make(map[string]map[string]*ethkey.State), - ChainIDKeyID: make(map[string]map[string]*ethkey.State), - } -} - -// warning: not thread-safe! caller must sync -// adds or replaces a state -func (ks *KeyStates) Add(state *ethkey.State) { - cid := state.EVMChainID.String() - kid := state.KeyID() - - keyStates, exists := ks.KeyIDChainID[kid] - if !exists { - keyStates = make(map[string]*ethkey.State) - ks.KeyIDChainID[kid] = keyStates - } - keyStates[cid] = state - - chainStates, exists := ks.ChainIDKeyID[cid] - if !exists { - chainStates = make(map[string]*ethkey.State) - ks.ChainIDKeyID[cid] = chainStates - } - chainStates[kid] = state - - exists = false - for i, existingState := range ks.All { - if existingState.ID == state.ID { - ks.All[i] = state - exists = true - break - } - } - if !exists { - ks.All = append(ks.All, state) - } -} - -// warning: not thread-safe! caller must sync -func (ks *KeyStates) Get(addr common.Address, chainID *big.Int) *ethkey.State { - chainStates, exists := ks.KeyIDChainID[addr.Hex()] - if !exists { - return nil - } - return chainStates[chainID.String()] -} - -// warning: not thread-safe! caller must sync -func (ks *KeyStates) Disable(addr common.Address, chainID *big.Int, updatedAt time.Time) { - state := ks.Get(addr, chainID) - state.Disabled = true - state.UpdatedAt = updatedAt -} - -// warning: not thread-safe! caller must sync -func (ks *KeyStates) Enable(addr common.Address, chainID *big.Int, updatedAt time.Time) { - state := ks.Get(addr, chainID) - state.Disabled = false - state.UpdatedAt = updatedAt -} - -// warning: not thread-safe! caller must sync -func (ks *KeyStates) Delete(addr common.Address) { - var chainIDs []*big.Int - for i := len(ks.All) - 1; i >= 0; i-- { - if ks.All[i].Address.Address() == addr { - chainIDs = append(chainIDs, ks.All[i].EVMChainID.ToInt()) - ks.All = append(ks.All[:i], ks.All[i+1:]...) - } - } - for _, cid := range chainIDs { - delete(ks.KeyIDChainID[addr.Hex()], cid.String()) - delete(ks.ChainIDKeyID[cid.String()], addr.Hex()) - } -} - -type KeyRing struct { - CSA map[string]csakey.KeyV2 - Eth map[string]ethkey.KeyV2 - OCR map[string]ocrkey.KeyV2 - OCR2 map[string]ocr2key.KeyBundle - P2P map[string]p2pkey.KeyV2 - Cosmos map[string]cosmoskey.Key - Solana map[string]solkey.Key - StarkNet map[string]starkkey.Key - Sui map[string]suikey.Key - Aptos map[string]aptoskey.Key - Tron map[string]tronkey.Key - TON map[string]tonkey.Key - VRF map[string]vrfkey.KeyV2 - Workflow map[string]workflowkey.Key - DKGRecipient map[string]dkgrecipientkey.Key - LegacyKeys LegacyKeyStorage -} - -func NewKeyRing() *KeyRing { - return &KeyRing{ - CSA: make(map[string]csakey.KeyV2), - Eth: make(map[string]ethkey.KeyV2), - OCR: make(map[string]ocrkey.KeyV2), - OCR2: make(map[string]ocr2key.KeyBundle), - P2P: make(map[string]p2pkey.KeyV2), - Cosmos: make(map[string]cosmoskey.Key), - Solana: make(map[string]solkey.Key), - StarkNet: make(map[string]starkkey.Key), - Sui: make(map[string]suikey.Key), - Aptos: make(map[string]aptoskey.Key), - Tron: make(map[string]tronkey.Key), - TON: make(map[string]tonkey.Key), - VRF: make(map[string]vrfkey.KeyV2), - Workflow: make(map[string]workflowkey.Key), - DKGRecipient: make(map[string]dkgrecipientkey.Key), - } -} - -func (kr *KeyRing) Encrypt(password string, scryptParams keystore.ScryptParams) (ekr EncryptedKeyRing, err error) { - marshalledRawKeyRingJson, err := json.Marshal(kr.raw()) - if err != nil { - return ekr, err - } - - marshalledRawKeyRingJson, err = kr.LegacyKeys.UnloadUnsupported(marshalledRawKeyRingJson) - if err != nil { - return EncryptedKeyRing{}, err - } - - cryptoJSON, err := gethkeystore.EncryptDataV3( - marshalledRawKeyRingJson, - []byte(adulteratedPassword(password)), - scryptParams.N, - scryptParams.P, - ) - if err != nil { - return ekr, errors.Wrapf(err, "could not encrypt key ring") - } - encryptedKeys, err := json.Marshal(&cryptoJSON) - if err != nil { - return ekr, errors.Wrapf(err, "could not encode cryptoJSON") - } - return EncryptedKeyRing{ - EncryptedKeys: encryptedKeys, - }, nil -} - -func (kr *KeyRing) raw() (rawKeys rawKeyRing) { - for _, csaKey := range kr.CSA { - rawKeys.CSA = append(rawKeys.CSA, internal.RawBytes(csaKey)) - } - for _, ethKey := range kr.Eth { - rawKeys.Eth = append(rawKeys.Eth, internal.RawBytes(ethKey)) - } - for _, ocrKey := range kr.OCR { - rawKeys.OCR = append(rawKeys.OCR, internal.RawBytes(ocrKey)) - } - for _, ocr2key := range kr.OCR2 { - rawKeys.OCR2 = append(rawKeys.OCR2, internal.RawBytes(ocr2key)) - } - for _, p2pKey := range kr.P2P { - rawKeys.P2P = append(rawKeys.P2P, internal.RawBytes(p2pKey)) - } - for _, cosmoskey := range kr.Cosmos { - rawKeys.Cosmos = append(rawKeys.Cosmos, internal.RawBytes(cosmoskey)) - } - for _, solkey := range kr.Solana { - rawKeys.Solana = append(rawKeys.Solana, internal.RawBytes(solkey)) - } - for _, starkkey := range kr.StarkNet { - rawKeys.StarkNet = append(rawKeys.StarkNet, internal.RawBytes(starkkey)) - } - for _, aptoskey := range kr.Aptos { - rawKeys.Aptos = append(rawKeys.Aptos, internal.RawBytes(aptoskey)) - } - for _, tronkey := range kr.Tron { - rawKeys.Tron = append(rawKeys.Tron, internal.RawBytes(tronkey)) - } - for _, tonkey := range kr.TON { - rawKeys.TON = append(rawKeys.TON, internal.RawBytes(tonkey)) - } - for _, suikey := range kr.Sui { - rawKeys.Sui = append(rawKeys.Sui, internal.RawBytes(suikey)) - } - for _, vrfKey := range kr.VRF { - rawKeys.VRF = append(rawKeys.VRF, internal.RawBytes(vrfKey)) - } - for _, workflowKey := range kr.Workflow { - rawKeys.Workflow = append(rawKeys.Workflow, internal.RawBytes(workflowKey)) - } - for _, dkgRecipientKey := range kr.DKGRecipient { - rawKeys.DKGRecipient = append(rawKeys.DKGRecipient, internal.RawBytes(dkgRecipientKey)) - } - return rawKeys -} - -// rawKeyRing is an intermediate struct for encrypting / decrypting KeyRing -// it holds only the essential key information to avoid adding unnecessary data -// (like public keys) to the database -type rawKeyRing struct { - Eth [][]byte - CSA [][]byte - OCR [][]byte - OCR2 [][]byte - P2P [][]byte - Cosmos [][]byte - Solana [][]byte - StarkNet [][]byte - Sui [][]byte - Aptos [][]byte - Tron [][]byte - TON [][]byte - VRF [][]byte - Workflow [][]byte - DKGRecipient [][]byte - LegacyKeys LegacyKeyStorage `json:"-"` -} - -func (rawKeys rawKeyRing) keys() (*KeyRing, error) { - keyRing := NewKeyRing() - for _, rawCSAKey := range rawKeys.CSA { - csaKey := csakey.KeyFor(internal.NewRaw(rawCSAKey)) - keyRing.CSA[csaKey.ID()] = csaKey - } - for _, rawETHKey := range rawKeys.Eth { - ethKey := ethkey.KeyFor(internal.NewRaw(rawETHKey)) - keyRing.Eth[ethKey.ID()] = ethKey - } - for _, rawOCRKey := range rawKeys.OCR { - ocrKey := ocrkey.KeyFor(internal.NewRaw(rawOCRKey)) - keyRing.OCR[ocrKey.ID()] = ocrKey - } - for _, rawOCR2Key := range rawKeys.OCR2 { - if ocr2Key := ocr2key.KeyFor(internal.NewRaw(rawOCR2Key)); ocr2Key != nil { - keyRing.OCR2[ocr2Key.ID()] = ocr2Key - } - } - for _, rawP2PKey := range rawKeys.P2P { - p2pKey := p2pkey.KeyFor(internal.NewRaw(rawP2PKey)) - keyRing.P2P[p2pKey.ID()] = p2pKey - } - for _, rawCosmosKey := range rawKeys.Cosmos { - cosmosKey := cosmoskey.KeyFor(internal.NewRaw(rawCosmosKey)) - keyRing.Cosmos[cosmosKey.ID()] = cosmosKey - } - for _, rawSolKey := range rawKeys.Solana { - solKey := solkey.KeyFor(internal.NewRaw(rawSolKey)) - keyRing.Solana[solKey.ID()] = solKey - } - for _, rawStarkNetKey := range rawKeys.StarkNet { - starkKey := starkkey.KeyFor(internal.NewRaw(rawStarkNetKey)) - keyRing.StarkNet[starkKey.ID()] = starkKey - } - for _, rawAptosKey := range rawKeys.Aptos { - aptosKey := aptoskey.KeyFor(internal.NewRaw(rawAptosKey)) - keyRing.Aptos[aptosKey.ID()] = aptosKey - } - for _, rawTronKey := range rawKeys.Tron { - tronKey := tronkey.KeyFor(internal.NewRaw(rawTronKey)) - keyRing.Tron[tronKey.ID()] = tronKey - } - for _, rawTONKey := range rawKeys.TON { - tonKey := tonkey.KeyFor(internal.NewRaw(rawTONKey)) - keyRing.TON[tonKey.ID()] = tonKey - } - for _, rawSuiKey := range rawKeys.Sui { - suiKey := suikey.KeyFor(internal.NewRaw(rawSuiKey)) - keyRing.Sui[suiKey.ID()] = suiKey - } - for _, rawVRFKey := range rawKeys.VRF { - vrfKey := vrfkey.KeyFor(internal.NewRaw(rawVRFKey)) - keyRing.VRF[vrfKey.ID()] = vrfKey - } - for _, rawWorkflowKey := range rawKeys.Workflow { - workflowKey := workflowkey.KeyFor(internal.NewRaw(rawWorkflowKey)) - keyRing.Workflow[workflowKey.ID()] = workflowKey - } - for _, rawDKGRecipientKey := range rawKeys.DKGRecipient { - dkgRecipientKey := dkgrecipientkey.KeyFor(internal.NewRaw(rawDKGRecipientKey)) - keyRing.DKGRecipient[dkgRecipientKey.ID()] = dkgRecipientKey - } - - keyRing.LegacyKeys = rawKeys.LegacyKeys - return keyRing, nil -} - -// adulteration prevents the password from getting used in the wrong place -func adulteratedPassword(password string) string { - return "master-password-" + password -} diff --git a/core/services/keystore/keys/models/models_test.go b/core/services/keystore/keys/models/models_test.go deleted file mode 100644 index 04420562fb3..00000000000 --- a/core/services/keystore/keys/models/models_test.go +++ /dev/null @@ -1,171 +0,0 @@ -package models - -import ( - "crypto/rand" - "encoding/json" - "math/big" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink-common/keystore/corekeys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" -) - -const password = "password" - -func TestKeyRing_Encrypt_Decrypt(t *testing.T) { - csa1, csa2 := csakey.MustNewV2XXXTestingOnly(big.NewInt(1)), csakey.MustNewV2XXXTestingOnly(big.NewInt(2)) - eth1, eth2 := mustNewEthKey(t), mustNewEthKey(t) - ocr := []ocrkey.KeyV2{ - ocrkey.MustNewV2XXXTestingOnly(big.NewInt(1)), - ocrkey.MustNewV2XXXTestingOnly(big.NewInt(2)), - } - var ocr2 []ocr2key.KeyBundle - ocr2Raw := make([][]byte, 0, len(corekeys.SupportedChainTypes)) - for _, chain := range corekeys.SupportedChainTypes { - key := ocr2key.MustNewInsecure(rand.Reader, chain) - ocr2 = append(ocr2, key) - ocr2Raw = append(ocr2Raw, internal.RawBytes(key)) - } - p2p1, p2p2 := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(1)), p2pkey.MustNewV2XXXTestingOnly(big.NewInt(2)) - sol1, sol2 := solkey.MustNewInsecure(rand.Reader), solkey.MustNewInsecure(rand.Reader) - vrf1, vrf2 := vrfkey.MustNewV2XXXTestingOnly(big.NewInt(1)), vrfkey.MustNewV2XXXTestingOnly(big.NewInt(2)) - tk1, tk2 := cosmoskey.MustNewInsecure(rand.Reader), cosmoskey.MustNewInsecure(rand.Reader) - uk1, uk2 := tronkey.MustNewInsecure(rand.Reader), tronkey.MustNewInsecure(rand.Reader) - ton1, ton2 := tonkey.MustNewInsecure(rand.Reader), tonkey.MustNewInsecure(rand.Reader) - originalKeyRingRaw := rawKeyRing{ - CSA: [][]byte{internal.RawBytes(csa1), internal.RawBytes(csa2)}, - Eth: [][]byte{internal.RawBytes(eth1), internal.RawBytes(eth2)}, - OCR: [][]byte{internal.RawBytes(ocr[0]), internal.RawBytes(ocr[1])}, - OCR2: ocr2Raw, - P2P: [][]byte{internal.RawBytes(p2p1), internal.RawBytes(p2p2)}, - Solana: [][]byte{internal.RawBytes(sol1), internal.RawBytes(sol2)}, - VRF: [][]byte{internal.RawBytes(vrf1), internal.RawBytes(vrf2)}, - Cosmos: [][]byte{internal.RawBytes(tk1), internal.RawBytes(tk2)}, - Tron: [][]byte{internal.RawBytes(uk1), internal.RawBytes(uk2)}, - TON: [][]byte{internal.RawBytes(ton1), internal.RawBytes(ton2)}, - } - originalKeyRing, kerr := originalKeyRingRaw.keys() - require.NoError(t, kerr) - - t.Run("test encrypt/decrypt", func(t *testing.T) { - encryptedKr, err := originalKeyRing.Encrypt(password, keystore.FastScryptParams) - require.NoError(t, err) - decryptedKeyRing, err := encryptedKr.Decrypt(password) - require.NoError(t, err) - // compare cosmos keys - require.Len(t, decryptedKeyRing.Cosmos, 2) - require.Equal(t, originalKeyRing.Cosmos[tk1.ID()].PublicKey(), decryptedKeyRing.Cosmos[tk1.ID()].PublicKey()) - require.Equal(t, originalKeyRing.Cosmos[tk2.ID()].PublicKey(), decryptedKeyRing.Cosmos[tk2.ID()].PublicKey()) - // compare tron keys - require.Len(t, decryptedKeyRing.Tron, 2) - require.Equal(t, originalKeyRing.Tron[uk1.ID()].Base58Address(), decryptedKeyRing.Tron[uk1.ID()].Base58Address()) - require.Equal(t, originalKeyRing.Tron[uk2.ID()].Base58Address(), decryptedKeyRing.Tron[uk2.ID()].Base58Address()) - // compare ton keys - require.Len(t, decryptedKeyRing.TON, 2) - require.Equal(t, originalKeyRing.TON[ton1.ID()].AddressBase64(), decryptedKeyRing.TON[ton1.ID()].AddressBase64()) - require.Equal(t, originalKeyRing.TON[ton2.ID()].AddressBase64(), decryptedKeyRing.TON[ton2.ID()].AddressBase64()) - // compare csa keys - require.Len(t, decryptedKeyRing.CSA, 2) - require.Equal(t, originalKeyRing.CSA[csa1.ID()].PublicKey, decryptedKeyRing.CSA[csa1.ID()].PublicKey) - require.Equal(t, originalKeyRing.CSA[csa2.ID()].PublicKey, decryptedKeyRing.CSA[csa2.ID()].PublicKey) - // compare eth keys - require.Len(t, decryptedKeyRing.Eth, 2) - require.Equal(t, originalKeyRing.Eth[eth1.ID()].Address, decryptedKeyRing.Eth[eth1.ID()].Address) - require.Equal(t, originalKeyRing.Eth[eth2.ID()].Address, decryptedKeyRing.Eth[eth2.ID()].Address) - // compare ocr keys - require.Len(t, decryptedKeyRing.OCR, 2) - require.Equal(t, internal.RawBytes(originalKeyRing.OCR[ocr[0].ID()]), internal.RawBytes(decryptedKeyRing.OCR[ocr[0].ID()])) - require.Equal(t, originalKeyRing.OCR[ocr[0].ID()].OffChainEncryption, decryptedKeyRing.OCR[ocr[0].ID()].OffChainEncryption) - require.Equal(t, internal.RawBytes(originalKeyRing.OCR[ocr[1].ID()]), internal.RawBytes(decryptedKeyRing.OCR[ocr[1].ID()])) - require.Equal(t, originalKeyRing.OCR[ocr[1].ID()].OffChainEncryption, decryptedKeyRing.OCR[ocr[1].ID()].OffChainEncryption) - // compare ocr2 keys - require.Len(t, decryptedKeyRing.OCR2, len(corekeys.SupportedChainTypes)) - for i := range ocr2 { - id := ocr2[i].ID() - require.Equal(t, originalKeyRing.OCR2[id].ID(), decryptedKeyRing.OCR2[id].ID()) - require.Equal(t, ocr2[i].OnChainPublicKey(), decryptedKeyRing.OCR2[id].OnChainPublicKey()) - require.Equal(t, originalKeyRing.OCR2[id].ChainType(), decryptedKeyRing.OCR2[id].ChainType()) - } - // compare p2p keys - require.Len(t, decryptedKeyRing.P2P, 2) - require.Equal(t, originalKeyRing.P2P[p2p1.ID()].PublicKeyHex(), decryptedKeyRing.P2P[p2p1.ID()].PublicKeyHex()) - require.Equal(t, originalKeyRing.P2P[p2p1.ID()].PeerID(), decryptedKeyRing.P2P[p2p1.ID()].PeerID()) - require.Equal(t, originalKeyRing.P2P[p2p2.ID()].PublicKeyHex(), decryptedKeyRing.P2P[p2p2.ID()].PublicKeyHex()) - require.Equal(t, originalKeyRing.P2P[p2p2.ID()].PeerID(), decryptedKeyRing.P2P[p2p2.ID()].PeerID()) - // compare solana keys - require.Len(t, decryptedKeyRing.Solana, 2) - require.Equal(t, originalKeyRing.Solana[sol1.ID()].GetPublic(), decryptedKeyRing.Solana[sol1.ID()].GetPublic()) - // compare vrf keys - require.Len(t, decryptedKeyRing.VRF, 2) - require.Equal(t, originalKeyRing.VRF[vrf1.ID()].PublicKey, decryptedKeyRing.VRF[vrf1.ID()].PublicKey) - require.Equal(t, originalKeyRing.VRF[vrf2.ID()].PublicKey, decryptedKeyRing.VRF[vrf2.ID()].PublicKey) - }) - - t.Run("test legacy system", func(t *testing.T) { - // Add unsupported keys to raw json - rawJson, _ := json.Marshal(originalKeyRing.raw()) - var allKeys = map[string][]string{ - "foo": { - "bar", "biz", - }, - } - err := json.Unmarshal(rawJson, &allKeys) - require.NoError(t, err) - // Add more ocr2 keys - newOCR2Key1 := ocrkey.MustNewV2XXXTestingOnly(big.NewInt(5)) - newOCR2Key2 := ocrkey.MustNewV2XXXTestingOnly(big.NewInt(6)) - allKeys["OCR2"] = append(allKeys["OCR2"], newOCR2Key1.Raw().String()) - allKeys["OCR2"] = append(allKeys["OCR2"], newOCR2Key2.Raw().String()) - - // Add more p2p keys - newP2PKey1 := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(5)) - newP2PKey2 := p2pkey.MustNewV2XXXTestingOnly(big.NewInt(7)) - allKeys["P2P"] = append(allKeys["P2P"], newP2PKey1.Raw().String()) - allKeys["P2P"] = append(allKeys["P2P"], newP2PKey2.Raw().String()) - - // Run legacy system - newRawJson, _ := json.Marshal(allKeys) - err = originalKeyRing.LegacyKeys.StoreUnsupported(newRawJson, originalKeyRing) - require.NoError(t, err) - require.Equal(t, 6, originalKeyRing.LegacyKeys.legacyRawKeys.len()) - marshalledRawKeyRingJson, err := json.Marshal(originalKeyRing.raw()) - require.NoError(t, err) - unloadedKeysJson, err := originalKeyRing.LegacyKeys.UnloadUnsupported(marshalledRawKeyRingJson) - require.NoError(t, err) - var shouldHaveAllKeys = map[string][]string{} - err = json.Unmarshal(unloadedKeysJson, &shouldHaveAllKeys) - require.NoError(t, err) - - // Check if keys where added to the raw json - require.Equal(t, []string{"bar", "biz"}, shouldHaveAllKeys["foo"]) - require.Contains(t, shouldHaveAllKeys["OCR2"], newOCR2Key1.Raw().String()) - require.Contains(t, shouldHaveAllKeys["OCR2"], newOCR2Key2.Raw().String()) - require.Contains(t, shouldHaveAllKeys["P2P"], newP2PKey1.Raw().String()) - require.Contains(t, shouldHaveAllKeys["P2P"], newP2PKey2.Raw().String()) - - // Check error - err = originalKeyRing.LegacyKeys.StoreUnsupported(newRawJson, nil) - require.Error(t, err) - _, err = originalKeyRing.LegacyKeys.UnloadUnsupported(nil) - require.Error(t, err) - }) -} - -func mustNewEthKey(t *testing.T) *ethkey.KeyV2 { - key, err := ethkey.NewV2() - require.NoError(t, err) - return &key -} diff --git a/core/services/keystore/keys/ocr2key/cosmos_keyring.go b/core/services/keystore/keys/ocr2key/cosmos_keyring.go deleted file mode 100644 index d9622a14629..00000000000 --- a/core/services/keystore/keys/ocr2key/cosmos_keyring.go +++ /dev/null @@ -1,116 +0,0 @@ -package ocr2key - -import ( - "crypto/ed25519" - "encoding/binary" - "io" - - "github.com/hdevalence/ed25519consensus" - "github.com/pkg/errors" - "golang.org/x/crypto/blake2s" - - "github.com/smartcontractkit/libocr/offchainreporting2/types" - "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -var _ ocrtypes.OnchainKeyring = &cosmosKeyring{} - -type cosmosKeyring struct { - privKey func() ed25519.PrivateKey - pubKey ed25519.PublicKey -} - -func newCosmosKeyring(material io.Reader) (*cosmosKeyring, error) { - pubKey, privKey, err := ed25519.GenerateKey(material) - if err != nil { - return nil, err - } - return &cosmosKeyring{pubKey: pubKey, privKey: func() ed25519.PrivateKey { return privKey }}, nil -} - -func (ckr *cosmosKeyring) PublicKey() ocrtypes.OnchainPublicKey { - return []byte(ckr.pubKey) -} - -func (ckr *cosmosKeyring) reportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - rawReportContext := evmutil.RawReportContext(reportCtx) - h, err := blake2s.New256(nil) - if err != nil { - return nil, err - } - reportLen := make([]byte, 4) - binary.BigEndian.PutUint32(reportLen[0:], uint32(len(report))) - h.Write(reportLen) - h.Write(report) - h.Write(rawReportContext[0][:]) - h.Write(rawReportContext[1][:]) - h.Write(rawReportContext[2][:]) - return h.Sum(nil), nil -} - -func (ckr *cosmosKeyring) Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - sigData, err := ckr.reportToSigData(reportCtx, report) - if err != nil { - return nil, err - } - return ckr.SignBlob(sigData) -} - -func (ckr *cosmosKeyring) Sign3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error) { - return nil, errors.New("not implemented") -} - -func (ckr *cosmosKeyring) SignBlob(b []byte) ([]byte, error) { - signedMsg := ed25519.Sign(ckr.privKey(), b) - // match on-chain parsing (first 32 bytes are for pubkey, remaining are for signature) - return concatBytes(ckr.PublicKey(), signedMsg), nil -} - -func (ckr *cosmosKeyring) Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool { - hash, err := ckr.reportToSigData(reportCtx, report) - if err != nil { - return false - } - return ckr.VerifyBlob(publicKey, hash, signature) -} - -func (ckr *cosmosKeyring) Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool { - return false -} - -func (ckr *cosmosKeyring) VerifyBlob(pubkey ocrtypes.OnchainPublicKey, b, sig []byte) bool { - // Ed25519 signatures are always 64 bytes and the - // public key (always prefixed, see Sign above) is always, - // 32 bytes, so we always require the max signature length. - if len(sig) != ckr.MaxSignatureLength() { - return false - } - if len(pubkey) != ed25519.PublicKeySize { - return false - } - return ed25519consensus.Verify(ed25519.PublicKey(pubkey), b, sig[32:]) -} - -func (ckr *cosmosKeyring) MaxSignatureLength() int { - // Reference: https://pkg.go.dev/crypto/ed25519 - return ed25519.PublicKeySize + ed25519.SignatureSize // 32 + 64 -} - -func (ckr *cosmosKeyring) Marshal() ([]byte, error) { - return ckr.privKey().Seed(), nil -} - -func (ckr *cosmosKeyring) Unmarshal(in []byte) error { - if len(in) != ed25519.SeedSize { - return errors.Errorf("unexpected seed size, got %d want %d", len(in), ed25519.SeedSize) - } - privKey := ed25519.NewKeyFromSeed(in) - ckr.privKey = func() ed25519.PrivateKey { return privKey } - pubKey, ok := privKey.Public().(ed25519.PublicKey) - if !ok { - return errors.New("failed to cast public key to ed25519.PublicKey") - } - ckr.pubKey = pubKey - return nil -} diff --git a/core/services/keystore/keys/ocr2key/cosmos_keyring_test.go b/core/services/keystore/keys/ocr2key/cosmos_keyring_test.go deleted file mode 100644 index 9a220be5db4..00000000000 --- a/core/services/keystore/keys/ocr2key/cosmos_keyring_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package ocr2key - -import ( - "bytes" - cryptorand "crypto/rand" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/stretchr/testify/require" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -func TestCosmosKeyRing_Sign_Verify(t *testing.T) { - kr1, err := newCosmosKeyring(cryptorand.Reader) - require.NoError(t, err) - kr2, err := newCosmosKeyring(cryptorand.Reader) - require.NoError(t, err) - ctx := ocrtypes.ReportContext{} - - t.Run("can verify", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - t.Log(len(sig)) - result := kr2.Verify(kr1.PublicKey(), ctx, report, sig) - require.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - report := ocrtypes.Report{} - result := kr2.Verify(kr1.PublicKey(), ctx, report, []byte{0x01}) - require.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - result := kr2.Verify([]byte{0x01}, ctx, report, sig) - require.False(t, result) - }) -} - -func TestCosmosKeyRing_Marshalling(t *testing.T) { - kr1, err := newCosmosKeyring(cryptorand.Reader) - require.NoError(t, err) - m, err := kr1.Marshal() - require.NoError(t, err) - kr2 := cosmosKeyring{} - err = kr2.Unmarshal(m) - require.NoError(t, err) - assert.True(t, bytes.Equal(kr1.pubKey, kr2.pubKey)) - assert.True(t, bytes.Equal(kr1.privKey(), kr2.privKey())) - - // Invalid seed size should error - require.Error(t, kr2.Unmarshal([]byte{0x01})) -} diff --git a/core/services/keystore/keys/ocr2key/ed25519_keyring.go b/core/services/keystore/keys/ocr2key/ed25519_keyring.go deleted file mode 100644 index b7099b99b42..00000000000 --- a/core/services/keystore/keys/ocr2key/ed25519_keyring.go +++ /dev/null @@ -1,141 +0,0 @@ -package ocr2key - -import ( - "bytes" - "crypto/ed25519" - "io" - - "github.com/hdevalence/ed25519consensus" - "github.com/pkg/errors" - "golang.org/x/crypto/blake2b" - - "github.com/smartcontractkit/libocr/offchainreporting2/types" - "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -var _ ocrtypes.OnchainKeyring = &ed25519Keyring{} - -type ed25519Keyring struct { - privKey func() ed25519.PrivateKey - pubKey ed25519.PublicKey -} - -func newEd25519Keyring(material io.Reader) (*ed25519Keyring, error) { - pubKey, privKey, err := ed25519.GenerateKey(material) - if err != nil { - return nil, err - } - return &ed25519Keyring{pubKey: pubKey, privKey: func() ed25519.PrivateKey { return privKey }}, nil -} - -func (akr *ed25519Keyring) PublicKey() ocrtypes.OnchainPublicKey { - return []byte(akr.pubKey) -} - -func (akr *ed25519Keyring) reportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - rawReportContext := evmutil.RawReportContext(reportCtx) - h, err := blake2b.New256(nil) - if err != nil { - return nil, err - } - // blake2b_256(report_context | report) - h.Write(rawReportContext[0][:]) - h.Write(rawReportContext[1][:]) - h.Write(rawReportContext[2][:]) - h.Write(report) - return h.Sum(nil), nil -} - -func (akr *ed25519Keyring) Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - sigData, err := akr.reportToSigData(reportCtx, report) - if err != nil { - return nil, err - } - return akr.SignBlob(sigData) -} - -func (akr *ed25519Keyring) reportToSigData3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) ([]byte, error) { - rawReportContext := RawReportContext3(digest, seqNr) - h, err := blake2b.New256(nil) - if err != nil { - return nil, err - } - h.Write(r) - h.Write(rawReportContext[0][:]) - h.Write(rawReportContext[1][:]) - return h.Sum(nil), nil -} - -func (akr *ed25519Keyring) Sign3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error) { - sigData, err := akr.reportToSigData3(digest, seqNr, r) - if err != nil { - return nil, err - } - return akr.SignBlob(sigData) -} - -func (akr *ed25519Keyring) SignBlob(b []byte) ([]byte, error) { - signedMsg := ed25519.Sign(akr.privKey(), b) - // match on-chain parsing (first 32 bytes are for pubkey, remaining are for signature) - return concatBytes(akr.PublicKey(), signedMsg), nil -} - -func (akr *ed25519Keyring) Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool { - hash, err := akr.reportToSigData(reportCtx, report) - if err != nil { - return false - } - return akr.VerifyBlob(publicKey, hash, signature) -} - -func (akr *ed25519Keyring) Verify3(publicKey ocrtypes.OnchainPublicKey, digest ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool { - sigData, err := akr.reportToSigData3(digest, seqNr, r) - if err != nil { - return false - } - return akr.VerifyBlob(publicKey, sigData, signature) -} - -func (akr *ed25519Keyring) VerifyBlob(pubkey ocrtypes.OnchainPublicKey, b, sig []byte) bool { - // Ed25519 signatures are always 64 bytes and the - // public key (always prefixed, see Sign above) is always, - // 32 bytes, so we always require the max signature length. - if len(sig) != akr.MaxSignatureLength() { - return false - } - if len(pubkey) != ed25519.PublicKeySize { - return false - } - if !bytes.Equal(pubkey, sig[:ed25519.PublicKeySize]) { - return false - } - return ed25519consensus.Verify(ed25519.PublicKey(pubkey), b, sig[ed25519.PublicKeySize:]) -} - -func (akr *ed25519Keyring) MaxSignatureLength() int { - // Reference: https://pkg.go.dev/crypto/ed25519 - return ed25519.PublicKeySize + ed25519.SignatureSize // 32 + 64 -} - -func (akr *ed25519Keyring) Marshal() ([]byte, error) { - return akr.privKey().Seed(), nil -} - -func (akr *ed25519Keyring) Unmarshal(in []byte) error { - if len(in) != ed25519.SeedSize { - return errors.Errorf("unexpected seed size, got %d want %d", len(in), ed25519.SeedSize) - } - privKey := ed25519.NewKeyFromSeed(in) - akr.privKey = func() ed25519.PrivateKey { return privKey } - pubKey, ok := privKey.Public().(ed25519.PublicKey) - if !ok { - return errors.New("failed to cast public key to ed25519.PublicKey") - } - akr.pubKey = pubKey - return nil -} - -func concatBytes(bufs ...[]byte) []byte { - return bytes.Join(bufs, []byte{}) -} diff --git a/core/services/keystore/keys/ocr2key/ed25519_keyring_test.go b/core/services/keystore/keys/ocr2key/ed25519_keyring_test.go deleted file mode 100644 index 064a45abd19..00000000000 --- a/core/services/keystore/keys/ocr2key/ed25519_keyring_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package ocr2key - -import ( - "bytes" - cryptorand "crypto/rand" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/stretchr/testify/require" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -func TestAptosKeyRing_Sign_Verify(t *testing.T) { - kr1, err := newEd25519Keyring(cryptorand.Reader) - require.NoError(t, err) - kr2, err := newEd25519Keyring(cryptorand.Reader) - require.NoError(t, err) - ctx := ocrtypes.ReportContext{} - - t.Run("can verify", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - t.Log(len(sig)) - result := kr2.Verify(kr1.PublicKey(), ctx, report, sig) - require.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - report := ocrtypes.Report{} - result := kr2.Verify(kr1.PublicKey(), ctx, report, []byte{0x01}) - require.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - result := kr2.Verify([]byte{0x01}, ctx, report, sig) - require.False(t, result) - }) -} - -func TestAptosKeyRing_Marshalling(t *testing.T) { - kr1, err := newEd25519Keyring(cryptorand.Reader) - require.NoError(t, err) - m, err := kr1.Marshal() - require.NoError(t, err) - kr2 := ed25519Keyring{} - err = kr2.Unmarshal(m) - require.NoError(t, err) - assert.True(t, bytes.Equal(kr1.pubKey, kr2.pubKey)) - assert.True(t, bytes.Equal(kr1.privKey(), kr2.privKey())) - - // Invalid seed size should error - require.Error(t, kr2.Unmarshal([]byte{0x01})) -} diff --git a/core/services/keystore/keys/ocr2key/evm_keyring.go b/core/services/keystore/keys/ocr2key/evm_keyring.go deleted file mode 100644 index 4121b8c6201..00000000000 --- a/core/services/keystore/keys/ocr2key/evm_keyring.go +++ /dev/null @@ -1,118 +0,0 @@ -package ocr2key - -import ( - "bytes" - "crypto/ecdsa" - "encoding/binary" - "io" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - - "github.com/smartcontractkit/libocr/offchainreporting2/types" - "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -var _ ocrtypes.OnchainKeyring = &evmKeyring{} - -type evmKeyring struct { - privateKey func() *ecdsa.PrivateKey -} - -func newEVMKeyring(material io.Reader) (*evmKeyring, error) { - ecdsaKey, err := ecdsa.GenerateKey(curve, material) - if err != nil { - return nil, err - } - return &evmKeyring{privateKey: func() *ecdsa.PrivateKey { return ecdsaKey }}, nil -} - -// XXX: PublicKey returns the address of the public key not the public key itself -func (ekr *evmKeyring) PublicKey() ocrtypes.OnchainPublicKey { - address := ekr.signingAddress() - return address[:] -} - -func (ekr *evmKeyring) Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - return ekr.SignBlob(ekr.reportToSigData(reportCtx, report)) -} - -func (ekr *evmKeyring) reportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) []byte { - return ReportToSigData(reportCtx, report) -} - -func ReportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) []byte { - rawReportContext := evmutil.RawReportContext(reportCtx) - sigData := crypto.Keccak256(report) - sigData = append(sigData, rawReportContext[0][:]...) - sigData = append(sigData, rawReportContext[1][:]...) - sigData = append(sigData, rawReportContext[2][:]...) - return crypto.Keccak256(sigData) -} - -func (ekr *evmKeyring) Sign3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error) { - return ekr.SignBlob(ReportToSigData3(digest, seqNr, r)) -} - -func ReportToSigData3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) []byte { - rawReportContext := RawReportContext3(digest, seqNr) - sigData := crypto.Keccak256(r) - sigData = append(sigData, rawReportContext[0][:]...) - sigData = append(sigData, rawReportContext[1][:]...) - return crypto.Keccak256(sigData) -} - -func RawReportContext3(digest types.ConfigDigest, seqNr uint64) [2][32]byte { - seqNrBytes := [32]byte{} - binary.BigEndian.PutUint64(seqNrBytes[24:], seqNr) - return [2][32]byte{ - digest, - seqNrBytes, - } -} - -func (ekr *evmKeyring) SignBlob(b []byte) (sig []byte, err error) { - return crypto.Sign(b, ekr.privateKey()) -} - -func (ekr *evmKeyring) Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool { - hash := ekr.reportToSigData(reportCtx, report) - return ekr.VerifyBlob(publicKey, hash, signature) -} - -func (ekr *evmKeyring) Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool { - hash := ReportToSigData3(cd, seqNr, r) - return ekr.VerifyBlob(publicKey, hash, signature) -} - -func (ekr *evmKeyring) VerifyBlob(pubkey types.OnchainPublicKey, b, sig []byte) bool { - authorPubkey, err := crypto.SigToPub(b, sig) - if err != nil { - return false - } - authorAddress := crypto.PubkeyToAddress(*authorPubkey) - // no need for constant time compare since neither arg is sensitive - return bytes.Equal(pubkey[:], authorAddress[:]) -} - -func (ekr *evmKeyring) MaxSignatureLength() int { - return 65 -} - -func (ekr *evmKeyring) signingAddress() common.Address { - return crypto.PubkeyToAddress(ekr.privateKey().PublicKey) -} - -func (ekr *evmKeyring) Marshal() ([]byte, error) { - return crypto.FromECDSA(ekr.privateKey()), nil -} - -func (ekr *evmKeyring) Unmarshal(in []byte) error { - privateKey, err := crypto.ToECDSA(in) - if err != nil { - return err - } - ekr.privateKey = func() *ecdsa.PrivateKey { return privateKey } - return nil -} diff --git a/core/services/keystore/keys/ocr2key/evm_keyring_test.go b/core/services/keystore/keys/ocr2key/evm_keyring_test.go deleted file mode 100644 index 47f5ebb58fe..00000000000 --- a/core/services/keystore/keys/ocr2key/evm_keyring_test.go +++ /dev/null @@ -1,169 +0,0 @@ -package ocr2key - -import ( - "bytes" - cryptorand "crypto/rand" - "math" - "math/rand" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/libocr/offchainreporting2/types" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -func TestEVMKeyring_SignVerify(t *testing.T) { - kr1, err := newEVMKeyring(cryptorand.Reader) - require.NoError(t, err) - kr2, err := newEVMKeyring(cryptorand.Reader) - require.NoError(t, err) - - ctx := ocrtypes.ReportContext{} - - t.Run("can verify", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - t.Log(len(sig)) - result := kr2.Verify(kr1.PublicKey(), ctx, report, sig) - assert.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - report := ocrtypes.Report{} - result := kr2.Verify(kr1.PublicKey(), ctx, report, []byte{0x01}) - assert.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - result := kr2.Verify([]byte{0x01}, ctx, report, sig) - assert.False(t, result) - }) -} - -func TestEVMKeyring_Sign3Verify3(t *testing.T) { - kr1, err := newEVMKeyring(cryptorand.Reader) - require.NoError(t, err) - kr2, err := newEVMKeyring(cryptorand.Reader) - require.NoError(t, err) - - digest, err := types.BytesToConfigDigest(mustRandBytes(32)) - require.NoError(t, err) - seqNr := rand.Uint64() - r := ocrtypes.Report(mustRandBytes(rand.Intn(1024))) - - t.Run("can verify", func(t *testing.T) { - sig, err := kr1.Sign3(digest, seqNr, r) - require.NoError(t, err) - t.Log(len(sig)) - result := kr2.Verify3(kr1.PublicKey(), digest, seqNr, r, sig) - assert.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - result := kr2.Verify3(kr1.PublicKey(), digest, seqNr, r, []byte{0x01}) - assert.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - sig, err := kr1.Sign3(digest, seqNr, r) - require.NoError(t, err) - result := kr2.Verify3([]byte{0x01}, digest, seqNr, r, sig) - assert.False(t, result) - }) -} - -func TestEVMKeyring_Marshalling(t *testing.T) { - kr1, err := newEVMKeyring(cryptorand.Reader) - require.NoError(t, err) - - m, err := kr1.Marshal() - require.NoError(t, err) - - kr2 := evmKeyring{} - err = kr2.Unmarshal(m) - require.NoError(t, err) - - assert.True(t, bytes.Equal(kr1.PublicKey(), kr2.PublicKey())) - assert.True(t, bytes.Equal(kr1.privateKey().D.Bytes(), kr2.privateKey().D.Bytes())) - - // Invalid seed size should error - assert.Error(t, kr2.Unmarshal([]byte{0x01})) -} - -func TestRawReportContext3(t *testing.T) { - testCases := []struct { - name string - digest [32]byte - seqNr uint64 - expected [2][32]byte - }{ - { - name: "zero values", - digest: [32]byte{}, - seqNr: 0, - expected: [2][32]byte{ - {}, - {}, - }, - }, - { - name: "some digest", - digest: [32]byte{1, 2, 3}, - seqNr: 0, - expected: [2][32]byte{ - {1, 2, 3}, - {}, - }, - }, - { - name: "sequence number set to 1", - digest: [32]byte{}, - seqNr: 1, - expected: [2][32]byte{ - {}, - { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - }, - }, - }, - { - name: "sequence number set to max uint64", - digest: [32]byte{1, 2, 3}, - seqNr: math.MaxUint64, - expected: [2][32]byte{ - {1, 2, 3}, - { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - actual := RawReportContext3(tc.digest, tc.seqNr) - assert.Equal(t, tc.expected, actual, "unexpected result") - }) - } -} - -func mustRandBytes(n int) (b []byte) { - b = make([]byte, n) - _, err := cryptorand.Read(b) - if err != nil { - panic(err) - } - return -} diff --git a/core/services/keystore/keys/ocr2key/export.go b/core/services/keystore/keys/ocr2key/export.go deleted file mode 100644 index f7d182d0048..00000000000 --- a/core/services/keystore/keys/ocr2key/export.go +++ /dev/null @@ -1,90 +0,0 @@ -package ocr2key - -import ( - "encoding/hex" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink-common/keystore/corekeys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" -) - -const keyTypeIdentifier = "OCR2" - -// EncryptedOCRKeyExport represents encrypted OCR key export -type EncryptedOCRKeyExport struct { - KeyType string `json:"keyType"` - ChainType corekeys.ChainType `json:"chainType"` - ID string `json:"id"` - OnchainPublicKey string `json:"onchainPublicKey"` - OffChainPublicKey string `json:"offchainPublicKey"` - ConfigPublicKey string `json:"configPublicKey"` - Crypto keystore.CryptoJSON `json:"crypto"` -} - -func (x EncryptedOCRKeyExport) GetCrypto() keystore.CryptoJSON { - return x.Crypto -} - -// FromEncryptedJSON returns key from encrypted json -func FromEncryptedJSON(keyJSON []byte, password string) (KeyBundle, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(export EncryptedOCRKeyExport, rawPrivKey internal.Raw) (KeyBundle, error) { - var kb KeyBundle - switch export.ChainType { - case corekeys.EVM: - kb = newKeyBundle(new(evmKeyring)) - case corekeys.Cosmos: - kb = newKeyBundle(new(cosmosKeyring)) - case corekeys.Solana: - kb = newKeyBundle(new(solanaKeyring)) - case corekeys.StarkNet: - kb = newKeyBundle(new(starkkey.OCR2Key)) - case corekeys.Aptos: - kb = newKeyBundle(new(ed25519Keyring)) - case corekeys.Tron: - kb = newKeyBundle(new(evmKeyring)) - case corekeys.TON: - kb = newKeyBundle(new(tonKeyring)) - case corekeys.Sui: - kb = newKeyBundle(new(ed25519Keyring)) - default: - return nil, corekeys.NewErrInvalidChainType(export.ChainType) - } - if err := kb.Unmarshal(internal.Bytes(rawPrivKey)); err != nil { - return nil, err - } - return kb, nil - }, - ) -} - -// ToEncryptedJSON returns encrypted JSON representing key -func ToEncryptedJSON(key KeyBundle, password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - func(id string, key KeyBundle, cryptoJSON keystore.CryptoJSON) EncryptedOCRKeyExport { - pubKeyConfig := key.ConfigEncryptionPublicKey() - pubKey := key.OffchainPublicKey() - return EncryptedOCRKeyExport{ - KeyType: id, - ChainType: key.ChainType(), - ID: key.ID(), - OnchainPublicKey: key.OnChainPublicKey(), - OffChainPublicKey: hex.EncodeToString(pubKey[:]), - ConfigPublicKey: hex.EncodeToString(pubKeyConfig[:]), - Crypto: cryptoJSON, - } - }, - ) -} diff --git a/core/services/keystore/keys/ocr2key/export_test.go b/core/services/keystore/keys/ocr2key/export_test.go deleted file mode 100644 index ab95419df61..00000000000 --- a/core/services/keystore/keys/ocr2key/export_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package ocr2key - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink-common/keystore/corekeys" -) - -func TestExport(t *testing.T) { - var tt = []struct { - chain corekeys.ChainType - }{ - {chain: corekeys.EVM}, - {chain: corekeys.Cosmos}, - {chain: corekeys.Solana}, - {chain: corekeys.StarkNet}, - {chain: corekeys.Aptos}, - {chain: corekeys.Tron}, - } - for _, tc := range tt { - t.Run(string(tc.chain), func(t *testing.T) { - kb, err := New(tc.chain) - require.NoError(t, err) - ej, err := ToEncryptedJSON(kb, "blah", commonkeystore.FastScryptParams) - require.NoError(t, err) - kbAfter, err := FromEncryptedJSON(ej, "blah") - require.NoError(t, err) - assert.Equal(t, kbAfter.ID(), kb.ID()) - assert.Equal(t, kbAfter.PublicKey(), kb.PublicKey()) - assert.Equal(t, kbAfter.OffchainPublicKey(), kb.OffchainPublicKey()) - assert.Equal(t, kbAfter.MaxSignatureLength(), kb.MaxSignatureLength()) - assert.Equal(t, kbAfter.Raw(), kb.Raw()) - assert.Equal(t, kbAfter.ConfigEncryptionPublicKey(), kb.ConfigEncryptionPublicKey()) - assert.Equal(t, kbAfter.ChainType(), kb.ChainType()) - }) - } -} diff --git a/core/services/keystore/keys/ocr2key/generic_key_bundle.go b/core/services/keystore/keys/ocr2key/generic_key_bundle.go deleted file mode 100644 index 4d64cb28cce..00000000000 --- a/core/services/keystore/keys/ocr2key/generic_key_bundle.go +++ /dev/null @@ -1,191 +0,0 @@ -package ocr2key - -import ( - "bytes" - cryptorand "crypto/rand" - "crypto/sha256" - "encoding/hex" - "encoding/json" - "io" - - "github.com/pkg/errors" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - - "github.com/smartcontractkit/chainlink-common/keystore/corekeys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -type ( - keyring interface { - ocrtypes.OnchainKeyring - OCR3SignerVerifier - Marshal() ([]byte, error) - Unmarshal(in []byte) error - } - - keyBundle[K keyring] struct { - keyBundleBase - keyring K - } - - keyBundleRawData struct { - ChainType corekeys.ChainType - OffchainKeyring []byte - Keyring []byte - ID keys.Sha256Hash // tracked to preserve bundle ID in case of migrations - - // old chain specific format for migrating - EVMKeyring []byte `json:",omitempty"` - SolanaKeyring []byte `json:",omitempty"` - CosmosKeyring []byte `json:",omitempty"` - } -) - -func newKeyBundle[K keyring](key K) *keyBundle[K] { - return &keyBundle[K]{keyring: key} -} - -func newKeyBundleRand[K keyring](chain corekeys.ChainType, newKeyring func(material io.Reader) (K, error)) (*keyBundle[K], error) { - return newKeyBundleFrom(chain, newKeyring, cryptorand.Reader, cryptorand.Reader, cryptorand.Reader) -} - -func mustNewKeyBundleInsecure[K keyring](chain corekeys.ChainType, newKeyring func(material io.Reader) (K, error), reader io.Reader) *keyBundle[K] { - key, err := newKeyBundleFrom(chain, newKeyring, reader, reader, reader) - if err != nil { - panic(errors.Wrapf(err, "failed to generate new OCR2-%s Key", chain)) - } - return key -} - -func newKeyBundleFrom[K keyring](chain corekeys.ChainType, newKeyring func(material io.Reader) (K, error), onchainSigningKeyMaterial, onchainEncryptionKeyMaterial, offchainKeyMaterial io.Reader) (*keyBundle[K], error) { - offchainKeyring, err := newOffchainKeyring(onchainSigningKeyMaterial, onchainEncryptionKeyMaterial) - if err != nil { - return nil, err - } - kr, err := newKeyring(onchainSigningKeyMaterial) - if err != nil { - return nil, err - } - k := keyBundle[K]{ - keyBundleBase: keyBundleBase{ - chainType: chain, - offchainKeyring: *offchainKeyring, - }, - keyring: kr, - } - marshalledPrivK, err := k.Marshal() - if err != nil { - return nil, err - } - k.id = sha256.Sum256(marshalledPrivK) - return &k, nil -} - -func (kb *keyBundle[K]) MaxSignatureLength() int { - return kb.keyring.MaxSignatureLength() -} - -func (kb *keyBundle[K]) PublicKey() ocrtypes.OnchainPublicKey { - return kb.keyring.PublicKey() -} - -func (kb *keyBundle[K]) Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - return kb.keyring.Sign(reportCtx, report) -} - -func (kb *keyBundle[K]) Sign3(digest ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error) { - return kb.keyring.Sign3(digest, seqNr, r) -} - -func (kb *keyBundle[K]) SignBlob(b []byte) (sig []byte, err error) { - return kb.keyring.SignBlob(b) -} - -func (kb *keyBundle[K]) Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool { - return kb.keyring.Verify(publicKey, reportCtx, report, signature) -} - -func (kb *keyBundle[K]) Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool { - return kb.keyring.Verify3(publicKey, cd, seqNr, r, signature) -} -func (kb *keyBundle[K]) VerifyBlob(pubkey ocrtypes.OnchainPublicKey, b, sig []byte) bool { - return kb.keyring.VerifyBlob(pubkey, b, sig) -} - -// OnChainPublicKey returns public component of the keypair used on chain -func (kb *keyBundle[K]) OnChainPublicKey() string { - return hex.EncodeToString(kb.keyring.PublicKey()) -} - -func (kb *keyBundle[K]) Marshal() ([]byte, error) { - offchainKeyringBytes, err := kb.marshal() - if err != nil { - return nil, err - } - keyringBytes, err := kb.keyring.Marshal() - if err != nil { - return nil, err - } - rawKeyData := keyBundleRawData{ - ChainType: kb.chainType, - OffchainKeyring: offchainKeyringBytes, - Keyring: keyringBytes, - ID: kb.id, // preserve bundle ID - } - return json.Marshal(&rawKeyData) -} - -func (kb *keyBundle[K]) Unmarshal(b []byte) (err error) { - var rawKeyData keyBundleRawData - err = json.Unmarshal(b, &rawKeyData) - if err != nil { - return err - } - if err = rawKeyData.Migrate(b); err != nil { - return err - } - - err = kb.unmarshal(rawKeyData.OffchainKeyring) - if err != nil { - return err - } - - err = kb.keyring.Unmarshal(rawKeyData.Keyring) - if err != nil { - return err - } - kb.chainType = rawKeyData.ChainType - kb.id = rawKeyData.ID - return nil -} - -func (kb *keyBundle[K]) Raw() internal.Raw { - b, err := kb.Marshal() - if err != nil { - panic(err) - } - return internal.NewRaw(b) -} - -// migration code -func (kbraw *keyBundleRawData) Migrate(b []byte) error { - // if key is not stored in Keyring param, use EVM or Solana as Keyring - // for migrating, key will only be marshalled into Keyring - if len(kbraw.Keyring) == 0 { - if len(kbraw.EVMKeyring) != 0 { - kbraw.Keyring = kbraw.EVMKeyring - } else if len(kbraw.SolanaKeyring) != 0 { - kbraw.Keyring = kbraw.SolanaKeyring - } - } - - // if key does not have an ID associated with it (old formats), - // derive the key ID and preserve it - if bytes.Equal(kbraw.ID[:], keys.EmptySha256Hash[:]) { - kbraw.ID = sha256.Sum256(b) - } - - return nil -} diff --git a/core/services/keystore/keys/ocr2key/generic_key_bundle_test.go b/core/services/keystore/keys/ocr2key/generic_key_bundle_test.go deleted file mode 100644 index 21720f33d5b..00000000000 --- a/core/services/keystore/keys/ocr2key/generic_key_bundle_test.go +++ /dev/null @@ -1,154 +0,0 @@ -package ocr2key - -import ( - cryptorand "crypto/rand" - "encoding/json" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-common/keystore/corekeys" -) - -type ( - XXXOldEVMKeyBundleRawData struct { - ChainType corekeys.ChainType - OffchainKeyring []byte - EVMKeyring []byte - } - XXXOldSolanaKeyBundleRawData struct { - ChainType corekeys.ChainType - OffchainKeyring []byte - SolanaKeyring []byte - } - XXXOldV1GenericKeyBundleRawData struct { - ChainType corekeys.ChainType - OffchainKeyring []byte - Keyring []byte - // missing ID - } -) - -func TestGenericKeyBundle_Migrate_UnmarshalMarshal(t *testing.T) { - // offchain key - offKey, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) - require.NoError(t, err) - offBytes, err := offKey.marshal() - require.NoError(t, err) - - t.Run("EVM", func(t *testing.T) { - // onchain key - onKey, err := newEVMKeyring(cryptorand.Reader) - require.NoError(t, err) - onBytes, err := onKey.Marshal() - require.NoError(t, err) - - // marshal old key format - oldKey := XXXOldEVMKeyBundleRawData{ - ChainType: corekeys.EVM, - OffchainKeyring: offBytes, - EVMKeyring: onBytes, - } - bundleBytes, err := json.Marshal(oldKey) - require.NoError(t, err) - - // test Unmarshal with old raw bundle - bundle := newKeyBundle(&evmKeyring{}) - require.NoError(t, bundle.Unmarshal(bundleBytes)) - newBundleBytes, err := bundle.Marshal() // marshalling migrates to a generic struct - require.NoError(t, err) - - // new bundle == old bundle (only difference is Keyring == Keyring) - var newRawBundle keyBundleRawData - require.NoError(t, json.Unmarshal(newBundleBytes, &newRawBundle)) - assert.Equal(t, oldKey.ChainType, newRawBundle.ChainType) - assert.Equal(t, oldKey.OffchainKeyring, newRawBundle.OffchainKeyring) - assert.Equal(t, oldKey.EVMKeyring, newRawBundle.Keyring) - - // test unmarshalling again to ensure ID has not changed - // the underlying bytes have changed, but ID should be preserved - newBundle := newKeyBundle(&evmKeyring{}) - require.NoError(t, newBundle.Unmarshal(newBundleBytes)) - assert.Equal(t, bundle.ID(), newBundle.ID()) - }) - - t.Run("Solana", func(t *testing.T) { - // onchain key - onKey, err := newSolanaKeyring(cryptorand.Reader) - require.NoError(t, err) - onBytes, err := onKey.Marshal() - require.NoError(t, err) - - // marshal old key format - oldKey := XXXOldSolanaKeyBundleRawData{ - ChainType: corekeys.Solana, - OffchainKeyring: offBytes, - SolanaKeyring: onBytes, - } - bundleBytes, err := json.Marshal(oldKey) - require.NoError(t, err) - - // test Unmarshal with old raw bundle - bundle := newKeyBundle(&solanaKeyring{}) - require.NoError(t, bundle.Unmarshal(bundleBytes)) - newBundleBytes, err := bundle.Marshal() - require.NoError(t, err) - - // new bundle == old bundle (only difference is Keyring == Keyring) - var newRawBundle keyBundleRawData - require.NoError(t, json.Unmarshal(newBundleBytes, &newRawBundle)) - assert.Equal(t, oldKey.ChainType, newRawBundle.ChainType) - assert.Equal(t, oldKey.OffchainKeyring, newRawBundle.OffchainKeyring) - assert.Equal(t, oldKey.SolanaKeyring, newRawBundle.Keyring) - - // test unmarshalling again to ensure ID has not changed - // the underlying bytes have changed, but ID should be preserved - newBundle := newKeyBundle(&solanaKeyring{}) - require.NoError(t, newBundle.Unmarshal(newBundleBytes)) - assert.Equal(t, bundle.ID(), newBundle.ID()) - }) - - t.Run("Cosmos", func(t *testing.T) { - // onchain key - bundle, err := newKeyBundleRand(corekeys.Cosmos, newCosmosKeyring) - require.NoError(t, err) - bundleBytes, err := bundle.Marshal() - require.NoError(t, err) - - // test unmarshalling again to ensure ID has not changed - // the underlying bytes have changed, but ID should be preserved - otherBundle := newKeyBundle(&cosmosKeyring{}) - require.NoError(t, otherBundle.Unmarshal(bundleBytes)) - assert.Equal(t, bundle.ID(), otherBundle.ID()) - }) - - t.Run("MissingID", func(t *testing.T) { - // onchain key - onKey, err := newEVMKeyring(cryptorand.Reader) - require.NoError(t, err) - onBytes, err := onKey.Marshal() - require.NoError(t, err) - - // build key without ID parameter - oldKey := XXXOldV1GenericKeyBundleRawData{ - ChainType: corekeys.EVM, - OffchainKeyring: offBytes, - Keyring: onBytes, - } - bundleBytes, err := json.Marshal(oldKey) - require.NoError(t, err) - - // unmarshal first time to generate ID - bundle := newKeyBundle(&evmKeyring{}) - require.NoError(t, bundle.Unmarshal(bundleBytes)) - - // marshal and unmarshal again - // different bytes generated, ID should not change - newBundleBytes, err := bundle.Marshal() - require.NoError(t, err) - newBundle := newKeyBundle(&evmKeyring{}) - require.NoError(t, newBundle.Unmarshal(newBundleBytes)) - assert.Equal(t, bundle.ID(), newBundle.ID()) - }) -} diff --git a/core/services/keystore/keys/ocr2key/key_bundle.go b/core/services/keystore/keys/ocr2key/key_bundle.go deleted file mode 100644 index 1284103db0e..00000000000 --- a/core/services/keystore/keys/ocr2key/key_bundle.go +++ /dev/null @@ -1,152 +0,0 @@ -package ocr2key - -import ( - "encoding/hex" - "encoding/json" - "io" - - "github.com/ethereum/go-ethereum/crypto/secp256k1" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - - "github.com/smartcontractkit/chainlink-common/keystore/corekeys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" -) - -type OCR3SignerVerifier interface { - SignBlob(b []byte) (sig []byte, err error) - VerifyBlob(publicKey ocrtypes.OnchainPublicKey, b []byte, sig []byte) bool - Sign3(digest ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error) - Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool -} - -type KeyBundle interface { - // OnchainKeyring is used for signing reports (groups of observations, verified onchain) - ocrtypes.OnchainKeyring - // offchainKeyring is used for signing observations - ocrtypes.OffchainKeyring - - OCR3SignerVerifier - - ID() string - ChainType() corekeys.ChainType - Marshal() ([]byte, error) - Unmarshal(b []byte) (err error) - Raw() internal.Raw - OnChainPublicKey() string - // Decrypts ciphertext using the encryptionKey from an OCR2 offchainKeyring - NaclBoxOpenAnonymous(ciphertext []byte) (plaintext []byte, err error) -} - -// check generic keybundle for each chain conforms to KeyBundle interface -var _ KeyBundle = &keyBundle[*evmKeyring]{} -var _ KeyBundle = &keyBundle[*cosmosKeyring]{} -var _ KeyBundle = &keyBundle[*solanaKeyring]{} -var _ KeyBundle = &keyBundle[*starkkey.OCR2Key]{} -var _ KeyBundle = &keyBundle[*ed25519Keyring]{} -var _ KeyBundle = &keyBundle[*tonKeyring]{} -var _ KeyBundle = &keyBundle[*ed25519Keyring]{} - -var curve = secp256k1.S256() - -// New returns key bundle based on the chain type -func New(chainType corekeys.ChainType) (KeyBundle, error) { - switch chainType { - case corekeys.EVM: - return newKeyBundleRand(corekeys.EVM, newEVMKeyring) - case corekeys.Cosmos: - return newKeyBundleRand(corekeys.Cosmos, newCosmosKeyring) - case corekeys.Solana: - return newKeyBundleRand(corekeys.Solana, newSolanaKeyring) - case corekeys.StarkNet: - return newKeyBundleRand(corekeys.StarkNet, starkkey.NewOCR2Key) - case corekeys.Aptos: - return newKeyBundleRand(corekeys.Aptos, newEd25519Keyring) - case corekeys.Tron: - return newKeyBundleRand(corekeys.Tron, newEVMKeyring) - case corekeys.TON: - return newKeyBundleRand(corekeys.TON, newTONKeyring) - case corekeys.Sui: - return newKeyBundleRand(corekeys.Sui, newEd25519Keyring) - } - return nil, corekeys.NewErrInvalidChainType(chainType) -} - -// MustNewInsecure returns key bundle based on the chain type or panics -func MustNewInsecure(reader io.Reader, chainType corekeys.ChainType) KeyBundle { - switch chainType { - case corekeys.EVM: - return mustNewKeyBundleInsecure(corekeys.EVM, newEVMKeyring, reader) - case corekeys.Cosmos: - return mustNewKeyBundleInsecure(corekeys.Cosmos, newCosmosKeyring, reader) - case corekeys.Solana: - return mustNewKeyBundleInsecure(corekeys.Solana, newSolanaKeyring, reader) - case corekeys.StarkNet: - return mustNewKeyBundleInsecure(corekeys.StarkNet, starkkey.NewOCR2Key, reader) - case corekeys.Aptos: - return mustNewKeyBundleInsecure(corekeys.Aptos, newEd25519Keyring, reader) - case corekeys.Tron: - return mustNewKeyBundleInsecure(corekeys.Tron, newEVMKeyring, reader) - case corekeys.TON: - return mustNewKeyBundleInsecure(corekeys.TON, newTONKeyring, reader) - case corekeys.Sui: - return mustNewKeyBundleInsecure(corekeys.Sui, newEd25519Keyring, reader) - } - panic(corekeys.NewErrInvalidChainType(chainType)) -} - -type keyBundleBase struct { - offchainKeyring - id keys.Sha256Hash - chainType corekeys.ChainType -} - -func (kb keyBundleBase) ID() string { - return hex.EncodeToString(kb.id[:]) -} - -// ChainType gets the chain type from the key bundle -func (kb keyBundleBase) ChainType() corekeys.ChainType { - return kb.chainType -} - -func KeyFor(raw internal.Raw) (kb KeyBundle) { - var temp struct{ ChainType corekeys.ChainType } - err := json.Unmarshal(internal.Bytes(raw), &temp) - if err != nil { - panic(err) - } - switch temp.ChainType { - case corekeys.EVM: - kb = newKeyBundle(new(evmKeyring)) - case corekeys.Cosmos: - kb = newKeyBundle(new(cosmosKeyring)) - case corekeys.Solana: - kb = newKeyBundle(new(solanaKeyring)) - case corekeys.StarkNet: - kb = newKeyBundle(new(starkkey.OCR2Key)) - case corekeys.Aptos: - kb = newKeyBundle(new(ed25519Keyring)) - case corekeys.Tron: - kb = newKeyBundle(new(evmKeyring)) - case corekeys.TON: - kb = newKeyBundle(new(tonKeyring)) - case corekeys.Sui: - kb = newKeyBundle(new(ed25519Keyring)) - default: - return nil - } - if err := kb.Unmarshal(internal.Bytes(raw)); err != nil { - panic(err) - } - return -} - -// type is added to the beginning of the passwords for OCR key bundles, -// so that the keys can't accidentally be mis-used in the wrong place -func adulteratedPassword(auth string) string { - s := "ocr2key" + auth - return s -} diff --git a/core/services/keystore/keys/ocr2key/key_bundle_test.go b/core/services/keystore/keys/ocr2key/key_bundle_test.go deleted file mode 100644 index 09ea9dc82e4..00000000000 --- a/core/services/keystore/keys/ocr2key/key_bundle_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package ocr2key_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink-common/keystore/corekeys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" -) - -func assertKeyBundlesNotEqual(t *testing.T, pk1 ocr2key.KeyBundle, pk2 ocr2key.KeyBundle) { - assert.NotEqual(t, pk1.ID(), pk2.ID()) - assert.NotEqual(t, pk1.OffchainPublicKey(), pk2.OffchainPublicKey()) - assert.NotEqual(t, pk1.OnChainPublicKey(), pk2.OnChainPublicKey()) -} - -func TestOCR2Keys_New(t *testing.T) { - t.Parallel() - var keys []ocr2key.KeyBundle - - // create two keys for each chain type - for _, chain := range corekeys.SupportedChainTypes { - pk0, err := ocr2key.New(chain) - require.NoError(t, err) - pk1, err := ocr2key.New(chain) - require.NoError(t, err) - - keys = append(keys, pk0) - keys = append(keys, pk1) - } - - // validate keys are unique - for i := 0; i < len(keys); i++ { - for j := i + 1; j < len(keys); j++ { - assertKeyBundlesNotEqual(t, keys[i], keys[j]) - } - } - - // validate chain types - for i := 0; i < len(keys); i += 2 { - // check key for same chain - require.Equal(t, keys[i].ChainType(), keys[i+1].ChainType()) - - // check 1 key for each chain - for j := i + 2; j < len(keys); j += 2 { - require.NotEqual(t, keys[i].ChainType(), keys[j].ChainType()) - } - } -} - -func TestOCR2KeyBundle_BundleBase(t *testing.T) { - t.Parallel() - - for _, chain := range corekeys.SupportedChainTypes { - kb, err := ocr2key.New(chain) - require.NoError(t, err) - - assert.NotNil(t, kb.ID()) - assert.Equal(t, chain, kb.ChainType()) - } -} diff --git a/core/services/keystore/keys/ocr2key/offchain_keyring.go b/core/services/keystore/keys/ocr2key/offchain_keyring.go deleted file mode 100644 index 546dd4991f8..00000000000 --- a/core/services/keystore/keys/ocr2key/offchain_keyring.go +++ /dev/null @@ -1,138 +0,0 @@ -package ocr2key - -import ( - "bytes" - "crypto/ed25519" - "encoding/binary" - "errors" - "io" - - "golang.org/x/crypto/nacl/box" - - "golang.org/x/crypto/curve25519" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -var _ ocrtypes.OffchainKeyring = &offchainKeyring{} - -// offchainKeyring contains the secret keys needed for the OCR nodes to share secrets -// and perform aggregation. -// -// This is currently an ed25519 signing key and a separate encryption key. -// -// All its functions should be thread-safe. -type offchainKeyring struct { - signingKey func() ed25519.PrivateKey - encryptionKey func() *[curve25519.ScalarSize]byte -} - -func newOffchainKeyring(encryptionMaterial, signingMaterial io.Reader) (*offchainKeyring, error) { - _, signingKey, err := ed25519.GenerateKey(signingMaterial) - if err != nil { - return nil, err - } - - encryptionKey := [curve25519.ScalarSize]byte{} - _, err = encryptionMaterial.Read(encryptionKey[:]) - if err != nil { - return nil, err - } - - ok := &offchainKeyring{ - signingKey: func() ed25519.PrivateKey { return signingKey }, - encryptionKey: func() *[32]byte { return &encryptionKey }, - } - _, err = ok.configEncryptionPublicKey() - if err != nil { - return nil, err - } - return ok, nil -} - -// NaclBoxOpenAnonymous decrypts a message that was encrypted using the OCR2 Offchain public key -func (ok *offchainKeyring) NaclBoxOpenAnonymous(ciphertext []byte) (plaintext []byte, err error) { - if len(ciphertext) < box.Overhead { - return nil, errors.New("ciphertext too short") - } - - publicKey := [curve25519.PointSize]byte(ok.ConfigEncryptionPublicKey()) - - decrypted, success := box.OpenAnonymous(nil, ciphertext, &publicKey, ok.encryptionKey()) - if !success { - return nil, errors.New("decryption failed") - } - - return decrypted, nil -} - -// OffchainSign signs message using private key -func (ok *offchainKeyring) OffchainSign(msg []byte) (signature []byte, err error) { - return ed25519.Sign(ok.signingKey(), msg), nil -} - -// ConfigDiffieHellman returns the shared point obtained by multiplying someone's -// public key by a secret scalar ( in this case, the offchain key ring's encryption key.) -func (ok *offchainKeyring) ConfigDiffieHellman(point [curve25519.PointSize]byte) ([curve25519.PointSize]byte, error) { - p, err := curve25519.X25519(ok.encryptionKey()[:], point[:]) - if err != nil { - return [curve25519.PointSize]byte{}, err - } - sharedPoint := [ed25519.PublicKeySize]byte{} - copy(sharedPoint[:], p) - return sharedPoint, nil -} - -// OffchainPublicKey returns the public component of this offchain keyring. -func (ok *offchainKeyring) OffchainPublicKey() ocrtypes.OffchainPublicKey { - var offchainPubKey [ed25519.PublicKeySize]byte - copy(offchainPubKey[:], ok.signingKey().Public().(ed25519.PublicKey)[:]) - return offchainPubKey -} - -// ConfigEncryptionPublicKey returns config public key -func (ok *offchainKeyring) ConfigEncryptionPublicKey() ocrtypes.ConfigEncryptionPublicKey { - cpk, _ := ok.configEncryptionPublicKey() - return cpk -} - -func (ok *offchainKeyring) configEncryptionPublicKey() (ocrtypes.ConfigEncryptionPublicKey, error) { - rv, err := curve25519.X25519(ok.encryptionKey()[:], curve25519.Basepoint) - if err != nil { - return [curve25519.PointSize]byte{}, err - } - var rvFixed [curve25519.PointSize]byte - copy(rvFixed[:], rv) - return rvFixed, nil -} - -func (ok *offchainKeyring) marshal() ([]byte, error) { - buffer := new(bytes.Buffer) - err := binary.Write(buffer, binary.LittleEndian, ok.signingKey()) - if err != nil { - return nil, err - } - err = binary.Write(buffer, binary.LittleEndian, ok.encryptionKey()) - if err != nil { - return nil, err - } - return buffer.Bytes(), nil -} - -func (ok *offchainKeyring) unmarshal(in []byte) error { - buffer := bytes.NewReader(in) - signingKey := make(ed25519.PrivateKey, ed25519.PrivateKeySize) - err := binary.Read(buffer, binary.LittleEndian, &signingKey) - if err != nil { - return err - } - ok.signingKey = func() ed25519.PrivateKey { return signingKey } - encryptionKey := [curve25519.ScalarSize]byte{} - err = binary.Read(buffer, binary.LittleEndian, &encryptionKey) - if err != nil { - return err - } - ok.encryptionKey = func() *[32]byte { return &encryptionKey } - _, err = ok.configEncryptionPublicKey() - return err -} diff --git a/core/services/keystore/keys/ocr2key/offchain_keyring_test.go b/core/services/keystore/keys/ocr2key/offchain_keyring_test.go deleted file mode 100644 index a19050548af..00000000000 --- a/core/services/keystore/keys/ocr2key/offchain_keyring_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package ocr2key - -import ( - "bytes" - "crypto/ed25519" - cryptorand "crypto/rand" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/curve25519" - "golang.org/x/crypto/nacl/box" -) - -func TestOffchainKeyring(t *testing.T) { - kr, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) - require.NoError(t, err) - pubKey := kr.OffchainPublicKey() - assert.True(t, bytes.Equal(kr.signingKey().Public().(ed25519.PublicKey), pubKey[:])) -} - -func TestOffchainKeyring_NaclBoxSealAnonymous(t *testing.T) { - kr, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) - require.NoError(t, err) - - originalMessage := []byte("test") - - encryptedMessage := naclBoxSealAnonymous(t, kr.ConfigEncryptionPublicKey(), originalMessage) - - decryptedMessage, err := kr.NaclBoxOpenAnonymous(encryptedMessage) - if err != nil { - t.Fatal(err) - } - - assert.Equal(t, originalMessage, decryptedMessage) -} - -func TestOffchainKeyring_NaclBoxSealAnonymous_ShortCiphertext(t *testing.T) { - kr, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) - require.NoError(t, err) - - shortMessage := []byte("short") - - _, err = kr.NaclBoxOpenAnonymous(shortMessage) - assert.Equal(t, "ciphertext too short", err.Error()) -} - -func TestOffchainKeyring_NaclBoxSealAnonymous_FailedDecryption(t *testing.T) { - kr, err := newOffchainKeyring(cryptorand.Reader, cryptorand.Reader) - require.NoError(t, err) - - invalid := []byte("invalidEncryptedMessage") - - _, err = kr.NaclBoxOpenAnonymous(invalid) - assert.Equal(t, "decryption failed", err.Error()) -} - -func naclBoxSealAnonymous(t *testing.T, peerPublicKey [curve25519.PointSize]byte, plaintext []byte) []byte { - t.Helper() - - ciphertext, err := box.SealAnonymous(nil, plaintext, &peerPublicKey, cryptorand.Reader) - if err != nil { - t.Fatalf("encryption failed") - return nil - } - - return ciphertext -} diff --git a/core/services/keystore/keys/ocr2key/solana_keyring.go b/core/services/keystore/keys/ocr2key/solana_keyring.go deleted file mode 100644 index be83dc0ecc1..00000000000 --- a/core/services/keystore/keys/ocr2key/solana_keyring.go +++ /dev/null @@ -1,111 +0,0 @@ -package ocr2key - -import ( - "bytes" - "crypto/ecdsa" - "crypto/sha256" - "encoding/binary" - "io" - - "github.com/ethereum/go-ethereum/crypto" - "golang.org/x/crypto/sha3" - - "github.com/smartcontractkit/libocr/offchainreporting2/types" - "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -var _ ocrtypes.OnchainKeyring = &solanaKeyring{} - -type solanaKeyring struct { - privateKey func() *ecdsa.PrivateKey -} - -func newSolanaKeyring(material io.Reader) (*solanaKeyring, error) { - ecdsaKey, err := ecdsa.GenerateKey(curve, material) - if err != nil { - return nil, err - } - return &solanaKeyring{privateKey: func() *ecdsa.PrivateKey { return ecdsaKey }}, nil -} - -// XXX: PublicKey returns the evm-style address of the public key not the public key itself -func (skr *solanaKeyring) PublicKey() ocrtypes.OnchainPublicKey { - address := crypto.PubkeyToAddress(skr.privateKey().PublicKey) - return address[:] -} - -func (skr *solanaKeyring) reportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) []byte { - rawReportContext := evmutil.RawReportContext(reportCtx) - h := sha256.New() - h.Write([]byte{uint8(len(report))}) - h.Write(report) - h.Write(rawReportContext[0][:]) - h.Write(rawReportContext[1][:]) - h.Write(rawReportContext[2][:]) - return h.Sum(nil) -} - -func (skr *solanaKeyring) Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - return skr.SignBlob(skr.reportToSigData(reportCtx, report)) -} - -func (skr *solanaKeyring) Sign3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) (signature []byte, err error) { - bytes, err := skr.reportToSigData3(digest, seqNr, r) - if err != nil { - return nil, err - } - return skr.SignBlob(bytes) -} - -func (skr *solanaKeyring) reportToSigData3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) ([]byte, error) { - rawReportContext := RawReportContext3(digest, seqNr) - h := sha3.NewLegacyKeccak256() - reportLen := uint16(len(r)) //nolint:gosec // max U16 larger than solana transaction size - err := binary.Write(h, binary.LittleEndian, reportLen) - h.Write(r) - h.Write(rawReportContext[0][:]) - h.Write(rawReportContext[1][:]) - return h.Sum(nil), err -} - -func (skr *solanaKeyring) SignBlob(b []byte) (sig []byte, err error) { - return crypto.Sign(b, skr.privateKey()) -} - -func (skr *solanaKeyring) Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool { - hash := skr.reportToSigData(reportCtx, report) - return skr.VerifyBlob(publicKey, hash, signature) -} - -func (skr *solanaKeyring) Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool { - hash, err := skr.reportToSigData3(cd, seqNr, r) - if err != nil { - return false - } - return skr.VerifyBlob(publicKey, hash, signature) -} - -func (skr *solanaKeyring) VerifyBlob(pubkey types.OnchainPublicKey, b, sig []byte) bool { - authorPubkey, err := crypto.SigToPub(b, sig) - if err != nil { - return false - } - authorAddress := crypto.PubkeyToAddress(*authorPubkey) - // no need for constant time compare since neither arg is sensitive - return bytes.Equal(pubkey[:], authorAddress[:]) -} - -func (skr *solanaKeyring) MaxSignatureLength() int { - return 65 -} - -func (skr *solanaKeyring) Marshal() ([]byte, error) { - return crypto.FromECDSA(skr.privateKey()), nil -} - -func (skr *solanaKeyring) Unmarshal(in []byte) error { - privateKey, err := crypto.ToECDSA(in) - skr.privateKey = func() *ecdsa.PrivateKey { return privateKey } - return err -} diff --git a/core/services/keystore/keys/ocr2key/solana_keyring_test.go b/core/services/keystore/keys/ocr2key/solana_keyring_test.go deleted file mode 100644 index e391848a4b9..00000000000 --- a/core/services/keystore/keys/ocr2key/solana_keyring_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package ocr2key - -import ( - "bytes" - cryptorand "crypto/rand" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -func TestSolanaKeyring_Sign_Verify(t *testing.T) { - kr1, err := newSolanaKeyring(cryptorand.Reader) - require.NoError(t, err) - kr2, err := newSolanaKeyring(cryptorand.Reader) - require.NoError(t, err) - ctx := ocrtypes.ReportContext{} - - t.Run("can verify", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - t.Log(len(sig)) - result := kr2.Verify(kr1.PublicKey(), ctx, report, sig) - assert.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - report := ocrtypes.Report{} - result := kr2.Verify(kr1.PublicKey(), ctx, report, []byte{0x01}) - assert.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - result := kr2.Verify([]byte{0x01}, ctx, report, sig) - assert.False(t, result) - }) -} - -func TestSolanaKeyring_Marshalling(t *testing.T) { - kr1, err := newSolanaKeyring(cryptorand.Reader) - require.NoError(t, err) - m, err := kr1.Marshal() - require.NoError(t, err) - kr2 := solanaKeyring{} - err = kr2.Unmarshal(m) - require.NoError(t, err) - assert.True(t, bytes.Equal(kr1.PublicKey(), kr2.PublicKey())) - assert.True(t, bytes.Equal(kr1.privateKey().D.Bytes(), kr2.privateKey().D.Bytes())) -} diff --git a/core/services/keystore/keys/ocr2key/ton_keyring.go b/core/services/keystore/keys/ocr2key/ton_keyring.go deleted file mode 100644 index 69fbec0d8f2..00000000000 --- a/core/services/keystore/keys/ocr2key/ton_keyring.go +++ /dev/null @@ -1,118 +0,0 @@ -package ocr2key - -import ( - "crypto/ed25519" - "crypto/sha256" - "io" - - "github.com/hdevalence/ed25519consensus" - "github.com/pkg/errors" - "github.com/xssnick/tonutils-go/tvm/cell" - - "github.com/smartcontractkit/libocr/offchainreporting2/types" - "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -var _ ocrtypes.OnchainKeyring = &tonKeyring{} - -type tonKeyring struct { - privKey func() ed25519.PrivateKey - pubKey ed25519.PublicKey -} - -func newTONKeyring(material io.Reader) (*tonKeyring, error) { - pubKey, privKey, err := ed25519.GenerateKey(material) - if err != nil { - return nil, err - } - return &tonKeyring{pubKey: pubKey, privKey: func() ed25519.PrivateKey { return privKey }}, nil -} - -func (tkr *tonKeyring) PublicKey() ocrtypes.OnchainPublicKey { - return []byte(tkr.pubKey) -} - -func (tkr *tonKeyring) reportToSigData(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) []byte { - rawReportContext := evmutil.RawReportContext(reportCtx) - h := sha256.New() - h.Write([]byte{uint8(len(report))}) //nolint:gosec // assumes len(report) < 256 - h.Write(report) - h.Write(rawReportContext[0][:]) - h.Write(rawReportContext[1][:]) - h.Write(rawReportContext[2][:]) - return h.Sum(nil) -} - -func (tkr *tonKeyring) Sign(reportCtx ocrtypes.ReportContext, report ocrtypes.Report) ([]byte, error) { - sigData := tkr.reportToSigData(reportCtx, report) - return tkr.SignBlob(sigData) -} - -func (tkr *tonKeyring) Sign3(digest types.ConfigDigest, seqNr uint64, r ocrtypes.Report) ([]byte, error) { - bytes := tkr.reportToSigData3(digest, seqNr, r) - return tkr.SignBlob(bytes) -} - -func (tkr *tonKeyring) reportToSigData3(digest types.ConfigDigest, seqNr uint64, report ocrtypes.Report) []byte { - rawReportContext := RawReportContext3(digest, seqNr) - - reportCell, err := cell.FromBOC(report) - if err != nil { - panic(err) - } - - return cell.BeginCell(). - MustStoreRef(reportCell). - MustStoreSlice(rawReportContext[0][:], 256). - MustStoreSlice(rawReportContext[1][:], 256). - EndCell(). - Hash() -} - -func (tkr *tonKeyring) SignBlob(b []byte) ([]byte, error) { - sig := ed25519.Sign(tkr.privKey(), b) - return concatBytes(tkr.PublicKey(), sig), nil -} - -func (tkr *tonKeyring) Verify(publicKey ocrtypes.OnchainPublicKey, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signature []byte) bool { - hash := tkr.reportToSigData(reportCtx, report) - return tkr.VerifyBlob(publicKey, hash, signature) -} - -func (tkr *tonKeyring) Verify3(publicKey ocrtypes.OnchainPublicKey, cd ocrtypes.ConfigDigest, seqNr uint64, r ocrtypes.Report, signature []byte) bool { - hash := tkr.reportToSigData3(cd, seqNr, r) - return tkr.VerifyBlob(publicKey, hash, signature) -} - -func (tkr *tonKeyring) VerifyBlob(pubkey ocrtypes.OnchainPublicKey, b, sig []byte) bool { - if len(sig) != tkr.MaxSignatureLength() { - return false - } - if len(pubkey) != ed25519.PublicKeySize { - return false - } - return ed25519consensus.Verify(ed25519.PublicKey(pubkey), b, sig[32:]) -} - -func (tkr *tonKeyring) MaxSignatureLength() int { - return ed25519.PublicKeySize + ed25519.SignatureSize // 32 + 64 -} - -func (tkr *tonKeyring) Marshal() ([]byte, error) { - return tkr.privKey().Seed(), nil -} - -func (tkr *tonKeyring) Unmarshal(in []byte) error { - if len(in) != ed25519.SeedSize { - return errors.Errorf("unexpected seed size, got %d want %d", len(in), ed25519.SeedSize) - } - privKey := ed25519.NewKeyFromSeed(in) - tkr.privKey = func() ed25519.PrivateKey { return privKey } - pubKey, ok := privKey.Public().(ed25519.PublicKey) - if !ok { - return errors.New("failed to cast public key to ed25519.PublicKey") - } - tkr.pubKey = pubKey - return nil -} diff --git a/core/services/keystore/keys/ocr2key/ton_keyring_test.go b/core/services/keystore/keys/ocr2key/ton_keyring_test.go deleted file mode 100644 index 32890a979f6..00000000000 --- a/core/services/keystore/keys/ocr2key/ton_keyring_test.go +++ /dev/null @@ -1,95 +0,0 @@ -package ocr2key - -import ( - "bytes" - cryptorand "crypto/rand" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xssnick/tonutils-go/tvm/cell" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" -) - -func TestTONKeyring_Sign_Verify(t *testing.T) { - kr1, err := newTONKeyring(cryptorand.Reader) - require.NoError(t, err) - kr2, err := newTONKeyring(cryptorand.Reader) - require.NoError(t, err) - ctx := ocrtypes.ReportContext{} - - t.Run("can verify", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - t.Log(len(sig)) - result := kr2.Verify(kr1.PublicKey(), ctx, report, sig) - assert.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - report := ocrtypes.Report{} - result := kr2.Verify(kr1.PublicKey(), ctx, report, []byte{0x01}) - assert.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - report := ocrtypes.Report{} - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - result := kr2.Verify([]byte{0x01}, ctx, report, sig) - assert.False(t, result) - }) -} - -func TestTONKeyring_Sign3_Verify3(t *testing.T) { - kr1, err := newTONKeyring(cryptorand.Reader) - require.NoError(t, err) - kr2, err := newTONKeyring(cryptorand.Reader) - require.NoError(t, err) - digest := ocrtypes.ConfigDigest{} - - t.Run("can verify", func(t *testing.T) { - report := cell.BeginCell().EndCell().ToBOC() - seqNr := uint64(1) - sig, err := kr1.Sign3(digest, 1, report) - require.NoError(t, err) - t.Log(len(sig)) - - result := kr2.Verify3(kr1.PublicKey(), digest, seqNr, report, sig) - assert.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - report := cell.BeginCell().EndCell().ToBOC() - seqNr := uint64(1) - result := kr2.Verify3(kr1.PublicKey(), digest, seqNr, report, []byte{0x01}) - assert.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - report := cell.BeginCell().EndCell().ToBOC() - seqNr := uint64(1) - sig, err := kr1.Sign3(digest, 1, report) - require.NoError(t, err) - - result := kr2.Verify3([]byte{0x01}, digest, seqNr, report, sig) - assert.False(t, result) - }) -} - -func TestTONKeyring_Marshalling(t *testing.T) { - kr1, err := newEd25519Keyring(cryptorand.Reader) - require.NoError(t, err) - m, err := kr1.Marshal() - require.NoError(t, err) - kr2 := ed25519Keyring{} - err = kr2.Unmarshal(m) - require.NoError(t, err) - assert.True(t, bytes.Equal(kr1.pubKey, kr2.pubKey)) - assert.True(t, bytes.Equal(kr1.privKey(), kr2.privKey())) - - // Invalid seed size should error - require.Error(t, kr2.Unmarshal([]byte{0x01})) -} diff --git a/core/services/keystore/keys/ocrkey/config_public_key.go b/core/services/keystore/keys/ocrkey/config_public_key.go deleted file mode 100644 index 13e85b77937..00000000000 --- a/core/services/keystore/keys/ocrkey/config_public_key.go +++ /dev/null @@ -1,72 +0,0 @@ -package ocrkey - -import ( - "database/sql/driver" - "encoding/hex" - "encoding/json" - "fmt" - "strings" - - "github.com/pkg/errors" - "golang.org/x/crypto/curve25519" -) - -const configPublicKeyPrefix = "ocrcfg_" - -// ConfigPublicKey represents the public key for the config decryption keypair -type ConfigPublicKey [curve25519.PointSize]byte - -func (cpk ConfigPublicKey) String() string { - return fmt.Sprintf("%s%s", configPublicKeyPrefix, cpk.Raw()) -} - -func (cpk ConfigPublicKey) Raw() string { - return hex.EncodeToString(cpk[:]) -} - -func (cpk ConfigPublicKey) MarshalJSON() ([]byte, error) { - return json.Marshal(cpk.String()) -} - -func (cpk *ConfigPublicKey) UnmarshalJSON(input []byte) error { - var hexString string - if err := json.Unmarshal(input, &hexString); err != nil { - return err - } - - return cpk.UnmarshalText([]byte(hexString)) -} - -// Scan reads the database value and returns an instance. -func (cpk *ConfigPublicKey) Scan(value any) error { - b, ok := value.([]byte) - if !ok { - return errors.Errorf("unable to convert %v of type %T to ConfigPublicKey", value, value) - } - if len(b) != curve25519.PointSize { - return errors.Errorf("unable to convert blob 0x%x of length %v to ConfigPublicKey", b, len(b)) - } - copy(cpk[:], b) - return nil -} - -// Value returns this instance serialized for database storage. -func (cpk ConfigPublicKey) Value() (driver.Value, error) { - return cpk[:], nil -} - -func (cpk *ConfigPublicKey) UnmarshalText(bs []byte) error { - input := string(bs) - if strings.HasPrefix(input, configPublicKeyPrefix) { - input = string(bs[len(configPublicKeyPrefix):]) - } - - decodedString, err := hex.DecodeString(input) - if err != nil { - return err - } - var result [curve25519.PointSize]byte - copy(result[:], decodedString[:curve25519.PointSize]) - *cpk = result - return nil -} diff --git a/core/services/keystore/keys/ocrkey/config_public_key_test.go b/core/services/keystore/keys/ocrkey/config_public_key_test.go deleted file mode 100644 index f3d257bd1fc..00000000000 --- a/core/services/keystore/keys/ocrkey/config_public_key_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package ocrkey - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestOCRKey_ConfigPublicKey(t *testing.T) { - k := MustNewV2XXXTestingOnly(big.NewInt(1)) - - t.Run("fails to unmarshal invalid JSON", func(t *testing.T) { - pk := ConfigPublicKey(k.PublicKeyConfig()) - - err := pk.UnmarshalJSON([]byte("")) - - assert.Error(t, err) - }) - - t.Run("returns serialized instance value", func(t *testing.T) { - pk := ConfigPublicKey(k.PublicKeyConfig()) - - v, err := pk.Value() - require.NoError(t, err) - - assert.NotEmpty(t, v) - }) - - t.Run("updates current instance by scanning another instance", func(t *testing.T) { - pk := ConfigPublicKey(k.PublicKeyConfig()) - - k2 := MustNewV2XXXTestingOnly(big.NewInt(1)) - pk2 := ConfigPublicKey(k2.PublicKeyConfig()) - - err := pk.Scan(pk2[:]) - require.NoError(t, err) - - assert.Equal(t, pk2.Raw(), pk.Raw()) - }) -} diff --git a/core/services/keystore/keys/ocrkey/export.go b/core/services/keystore/keys/ocrkey/export.go deleted file mode 100644 index 9ec262e2585..00000000000 --- a/core/services/keystore/keys/ocrkey/export.go +++ /dev/null @@ -1,59 +0,0 @@ -package ocrkey - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "OCR" - -func FromEncryptedJSON(keyJSON []byte, password string) (KeyV2, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ EncryptedOCRKeyExport, rawPrivKey internal.Raw) (KeyV2, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -type EncryptedOCRKeyExport struct { - KeyType string `json:"keyType"` - ID string `json:"id"` - OnChainSigningAddress OnChainSigningAddress `json:"onChainSigningAddress"` - OffChainPublicKey OffChainPublicKey `json:"offChainPublicKey"` - ConfigPublicKey ConfigPublicKey `json:"configPublicKey"` - Crypto keystore.CryptoJSON `json:"crypto"` -} - -func (x EncryptedOCRKeyExport) GetCrypto() keystore.CryptoJSON { - return x.Crypto -} - -func (key KeyV2) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - func(id string, key KeyV2, cryptoJSON keystore.CryptoJSON) EncryptedOCRKeyExport { - return EncryptedOCRKeyExport{ - KeyType: id, - ID: key.ID(), - OnChainSigningAddress: key.OnChainSigning.Address(), - OffChainPublicKey: key.OffChainSigning.PublicKey(), - ConfigPublicKey: key.PublicKeyConfig(), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "ocrkey" + password -} diff --git a/core/services/keystore/keys/ocrkey/export_test.go b/core/services/keystore/keys/ocrkey/export_test.go deleted file mode 100644 index 347babb31cc..00000000000 --- a/core/services/keystore/keys/ocrkey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package ocrkey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestOCRKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return NewV2() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/ocrkey/helpers_test.go b/core/services/keystore/keys/ocrkey/helpers_test.go deleted file mode 100644 index 9634d72177c..00000000000 --- a/core/services/keystore/keys/ocrkey/helpers_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package ocrkey - -func (kb *KeyV2) ExportedOnChainSigning() *onChainPrivateKey { - return kb.OnChainSigning -} - -func (kb *KeyV2) ExportedOffChainSigning() *offChainPrivateKey { - return kb.OffChainSigning -} - -func (kb *KeyV2) ExportedOffChainEncryption() *[32]byte { - return kb.OffChainEncryption -} diff --git a/core/services/keystore/keys/ocrkey/key_v2.go b/core/services/keystore/keys/ocrkey/key_v2.go deleted file mode 100644 index 438b9e5da26..00000000000 --- a/core/services/keystore/keys/ocrkey/key_v2.go +++ /dev/null @@ -1,190 +0,0 @@ -package ocrkey - -import ( - "crypto/ecdsa" - "crypto/ed25519" - "crypto/rand" - "crypto/sha256" - "encoding/hex" - "encoding/json" - "log" - "math/big" - - "github.com/ethereum/go-ethereum/crypto/secp256k1" - "github.com/pkg/errors" - "golang.org/x/crypto/curve25519" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -var ( - ErrScalarTooBig = errors.Errorf("can't handle scalars greater than %d", curve25519.PointSize) - curve = secp256k1.S256() -) - -type keyBundleRawData struct { - EcdsaD big.Int - Ed25519PrivKey []byte - OffChainEncryption [curve25519.ScalarSize]byte -} - -func KeyFor(raw internal.Raw) KeyV2 { - var key KeyV2 - err := json.Unmarshal(internal.Bytes(raw), &key) - if err != nil { - panic(errors.Wrap(err, "while unmarshalling OCR key")) - } - key.raw = raw - return key -} - -type KeyV2 struct { - raw internal.Raw - OnChainSigning *onChainPrivateKey - OffChainSigning *offChainPrivateKey - OffChainEncryption *[curve25519.ScalarSize]byte -} - -func NewV2() (KeyV2, error) { - ecdsaKey, err := ecdsa.GenerateKey(curve, rand.Reader) - if err != nil { - return KeyV2{}, err - } - - _, offChainPriv, err := ed25519.GenerateKey(rand.Reader) - if err != nil { - return KeyV2{}, err - } - var encryptionPriv [curve25519.ScalarSize]byte - _, err = rand.Reader.Read(encryptionPriv[:]) - if err != nil { - return KeyV2{}, err - } - k := KeyV2{ - OnChainSigning: &onChainPrivateKey{func() *ecdsa.PrivateKey { return ecdsaKey }}, - OffChainSigning: &offChainPrivateKey{func() ed25519.PrivateKey { return offChainPriv }}, - OffChainEncryption: &encryptionPriv, - } - return k, k.initRaw() -} - -func MustNewV2XXXTestingOnly(k *big.Int) KeyV2 { - ecdsaKey := new(ecdsa.PrivateKey) - ecdsaKey.Curve = curve - ecdsaKey.D = k - ecdsaKey.X, ecdsaKey.Y = curve.ScalarBaseMult(k.Bytes()) - var seed [32]byte - copy(seed[:], k.Bytes()) - offChainPriv := ed25519.NewKeyFromSeed(seed[:]) - key := KeyV2{ - OnChainSigning: &onChainPrivateKey{func() *ecdsa.PrivateKey { return ecdsaKey }}, - OffChainSigning: &offChainPrivateKey{func() ed25519.PrivateKey { return offChainPriv }}, - OffChainEncryption: &seed, - } - if err := key.initRaw(); err != nil { - panic(err) - } - return key -} - -func (key KeyV2) ID() string { - sha := sha256.Sum256(internal.Bytes(key.raw)) - return hex.EncodeToString(sha[:]) -} - -func (key KeyV2) Raw() internal.Raw { return key.raw } - -func (key *KeyV2) initRaw() error { - marshalledPrivK, err := json.Marshal(key) - if err != nil { - return err - } - key.raw = internal.NewRaw(marshalledPrivK) - return nil -} - -// SignOnChain returns an ethereum-style ECDSA secp256k1 signature on msg. -func (key KeyV2) SignOnChain(msg []byte) (signature []byte, err error) { - return key.OnChainSigning.Sign(msg) -} - -// SignOffChain returns an EdDSA-Ed25519 signature on msg. -func (key KeyV2) SignOffChain(msg []byte) (signature []byte, err error) { - return key.OffChainSigning.Sign(msg) -} - -// ConfigDiffieHellman returns the shared point obtained by multiplying someone's -// public key by a secret scalar ( in this case, the OffChainEncryption key.) -func (key KeyV2) ConfigDiffieHellman(base *[curve25519.PointSize]byte) ( - sharedPoint *[curve25519.PointSize]byte, err error, -) { - p, err := curve25519.X25519(key.OffChainEncryption[:], base[:]) - if err != nil { - return nil, err - } - sharedPoint = new([ed25519.PublicKeySize]byte) - copy(sharedPoint[:], p) - return sharedPoint, nil -} - -// PublicKeyAddressOnChain returns public component of the keypair used in -// SignOnChain -func (key KeyV2) PublicKeyAddressOnChain() ocrtypes.OnChainSigningAddress { - return ocrtypes.OnChainSigningAddress(key.OnChainSigning.Address()) -} - -// PublicKeyOffChain returns the public component of the keypair used in SignOffChain -func (key KeyV2) PublicKeyOffChain() ocrtypes.OffchainPublicKey { - return ocrtypes.OffchainPublicKey(key.OffChainSigning.PublicKey()) -} - -// PublicKeyConfig returns the public component of the keypair used in ConfigKeyShare -func (key KeyV2) PublicKeyConfig() [curve25519.PointSize]byte { - rv, err := curve25519.X25519(key.OffChainEncryption[:], curve25519.Basepoint) - if err != nil { - log.Println("failure while computing public key: " + err.Error()) - } - var rvFixed [curve25519.PointSize]byte - copy(rvFixed[:], rv) - return rvFixed -} - -func (key KeyV2) GetID() string { - return key.ID() -} - -// MarshalJSON marshals the private keys into json -func (key KeyV2) MarshalJSON() ([]byte, error) { - rawKeyData := keyBundleRawData{ - EcdsaD: *key.OnChainSigning.pk().D, - Ed25519PrivKey: []byte(key.OffChainSigning.pk()), - OffChainEncryption: *key.OffChainEncryption, - } - return json.Marshal(&rawKeyData) -} - -func (key *KeyV2) UnmarshalJSON(b []byte) (err error) { - var rawKeyData keyBundleRawData - err = json.Unmarshal(b, &rawKeyData) - if err != nil { - return err - } - ecdsaDSize := len(rawKeyData.EcdsaD.Bytes()) - if ecdsaDSize > curve25519.PointSize { - return errors.Wrapf(ErrScalarTooBig, "got %d byte ecdsa scalar", ecdsaDSize) - } - - publicKey := ecdsa.PublicKey{Curve: curve} - publicKey.X, publicKey.Y = curve.ScalarBaseMult(rawKeyData.EcdsaD.Bytes()) - privateKey := ecdsa.PrivateKey{ - PublicKey: publicKey, - D: &rawKeyData.EcdsaD, - } - - key.OnChainSigning = &onChainPrivateKey{func() *ecdsa.PrivateKey { return &privateKey }} - key.OffChainSigning = &offChainPrivateKey{func() ed25519.PrivateKey { return rawKeyData.Ed25519PrivKey }} - key.OffChainEncryption = &rawKeyData.OffChainEncryption - return nil -} diff --git a/core/services/keystore/keys/ocrkey/key_v2_test.go b/core/services/keystore/keys/ocrkey/key_v2_test.go deleted file mode 100644 index c7cda7e7bd8..00000000000 --- a/core/services/keystore/keys/ocrkey/key_v2_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package ocrkey_test - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" -) - -func assertKeyBundlesNotEqual(t *testing.T, pk1 ocrkey.KeyV2, pk2 ocrkey.KeyV2) { - assert.NotEqual(t, pk1.ID(), pk2.ID()) - assert.NotEqual(t, internal.RawBytes(pk1), internal.RawBytes(pk2)) - assert.NotEqual(t, pk1.ExportedOffChainSigning().PublicKey(), pk2.ExportedOffChainSigning().PublicKey()) - assert.NotEqual(t, pk1.ExportedOffChainEncryption(), pk2.ExportedOffChainEncryption()) -} - -func TestOCRKeys_New(t *testing.T) { - t.Parallel() - pk1, err := ocrkey.NewV2() - require.NoError(t, err) - pk2, err := ocrkey.NewV2() - require.NoError(t, err) - pk3, err := ocrkey.NewV2() - require.NoError(t, err) - assertKeyBundlesNotEqual(t, pk1, pk2) - assertKeyBundlesNotEqual(t, pk1, pk3) - assertKeyBundlesNotEqual(t, pk2, pk3) -} -func TestOCRKeys_Raw_Key(t *testing.T) { - t.Parallel() - key := ocrkey.MustNewV2XXXTestingOnly(big.NewInt(1)) - require.Equal(t, key.ID(), ocrkey.KeyFor(key.Raw()).ID()) -} diff --git a/core/services/keystore/keys/ocrkey/off_chain_private_key.go b/core/services/keystore/keys/ocrkey/off_chain_private_key.go deleted file mode 100644 index 413ad13e3f9..00000000000 --- a/core/services/keystore/keys/ocrkey/off_chain_private_key.go +++ /dev/null @@ -1,24 +0,0 @@ -package ocrkey - -import ( - "crypto/ed25519" - - "github.com/pkg/errors" -) - -type offChainPrivateKey struct { - pk func() ed25519.PrivateKey -} - -// Sign returns the signature on msgHash with k -func (k *offChainPrivateKey) Sign(msg []byte) ([]byte, error) { - if k == nil { - return nil, errors.Errorf("attempt to sign with nil key") - } - return ed25519.Sign(k.pk(), msg), nil -} - -// PublicKey returns the public key which commits to k -func (k *offChainPrivateKey) PublicKey() OffChainPublicKey { - return OffChainPublicKey(k.pk().Public().(ed25519.PublicKey)) -} diff --git a/core/services/keystore/keys/ocrkey/off_chain_private_key_test.go b/core/services/keystore/keys/ocrkey/off_chain_private_key_test.go deleted file mode 100644 index a7eadc72860..00000000000 --- a/core/services/keystore/keys/ocrkey/off_chain_private_key_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package ocrkey - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestOCRKeys_OffChainPrivateKey(t *testing.T) { - t.Parallel() - - k, err := NewV2() - require.NoError(t, err) - - sig, err := k.OffChainSigning.Sign([]byte("hello world")) - - assert.NoError(t, err) - assert.NotEmpty(t, sig) -} diff --git a/core/services/keystore/keys/ocrkey/off_chain_public_key.go b/core/services/keystore/keys/ocrkey/off_chain_public_key.go deleted file mode 100644 index de190f68f78..00000000000 --- a/core/services/keystore/keys/ocrkey/off_chain_public_key.go +++ /dev/null @@ -1,67 +0,0 @@ -package ocrkey - -import ( - "crypto/ed25519" - "database/sql/driver" - "encoding/hex" - "encoding/json" - "fmt" - "strings" - - "github.com/pkg/errors" - - "github.com/ethereum/go-ethereum/common" -) - -const offChainPublicKeyPrefix = "ocroff_" - -type OffChainPublicKey ed25519.PublicKey - -func (ocpk OffChainPublicKey) String() string { - return fmt.Sprintf("%s%s", offChainPublicKeyPrefix, ocpk.Raw()) -} - -func (ocpk OffChainPublicKey) Raw() string { - return hex.EncodeToString(ocpk) -} - -func (ocpk OffChainPublicKey) MarshalJSON() ([]byte, error) { - return json.Marshal(ocpk.String()) -} - -func (ocpk *OffChainPublicKey) UnmarshalJSON(input []byte) error { - var hexString string - if err := json.Unmarshal(input, &hexString); err != nil { - return err - } - return ocpk.UnmarshalText([]byte(hexString)) -} - -func (ocpk *OffChainPublicKey) UnmarshalText(bs []byte) error { - input := string(bs) - if strings.HasPrefix(input, offChainPublicKeyPrefix) { - input = string(bs[len(offChainPublicKeyPrefix):]) - } - - result, err := hex.DecodeString(input) - if err != nil { - return err - } - copy(result, result[:common.AddressLength]) - *ocpk = result - return nil -} - -func (ocpk *OffChainPublicKey) Scan(value any) error { - switch v := value.(type) { - case []byte: - *ocpk = v - return nil - default: - return errors.Errorf("invalid public key bytes got %T wanted []byte", v) - } -} - -func (ocpk OffChainPublicKey) Value() (driver.Value, error) { - return []byte(ocpk), nil -} diff --git a/core/services/keystore/keys/ocrkey/off_chain_public_key_test.go b/core/services/keystore/keys/ocrkey/off_chain_public_key_test.go deleted file mode 100644 index 372ca8b273b..00000000000 --- a/core/services/keystore/keys/ocrkey/off_chain_public_key_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package ocrkey_test - -import ( - "encoding/json" - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" -) - -func TestOCR_OffchainPublicKey_MarshalJSON(t *testing.T) { - t.Parallel() - rawBytes := make([]byte, 32) - rawBytes[31] = 1 - pubKey := ocrkey.OffChainPublicKey(rawBytes) - - pubKeyString := "ocroff_0000000000000000000000000000000000000000000000000000000000000001" - pubKeyJSON := fmt.Sprintf(`"%s"`, pubKeyString) - - result, err := json.Marshal(pubKey) - assert.NoError(t, err) - assert.JSONEq(t, pubKeyJSON, string(result)) -} - -func TestOCR_OffchainPublicKey_UnmarshalJSON_Happy(t *testing.T) { - t.Parallel() - - pubKeyString := "918a65a518c005d6367309bec4b26805f8afabef72cbf9940d9a0fd04ec80b38" - pubKeyJSON := fmt.Sprintf(`"%s"`, pubKeyString) - pubKey := ocrkey.OffChainPublicKey{} - - err := json.Unmarshal([]byte(pubKeyJSON), &pubKey) - assert.NoError(t, err) - assert.Equal(t, pubKeyString, pubKey.Raw()) -} - -func TestOCR_OffchainPublicKey_UnmarshalJSON_Error(t *testing.T) { - t.Parallel() - - pubKeyString := "hello world" - pubKeyJSON := fmt.Sprintf(`"%s"`, pubKeyString) - pubKey := ocrkey.OffChainPublicKey{} - - err := json.Unmarshal([]byte(pubKeyJSON), &pubKey) - assert.Error(t, err) -} diff --git a/core/services/keystore/keys/ocrkey/on_chain_private_key.go b/core/services/keystore/keys/ocrkey/on_chain_private_key.go deleted file mode 100644 index a87b0842d1b..00000000000 --- a/core/services/keystore/keys/ocrkey/on_chain_private_key.go +++ /dev/null @@ -1,25 +0,0 @@ -package ocrkey - -import ( - "crypto/ecdsa" - - "github.com/ethereum/go-ethereum/crypto" -) - -type onChainPrivateKey struct { - pk func() *ecdsa.PrivateKey -} - -// Sign returns the signature on msgHash with k -func (k *onChainPrivateKey) Sign(msg []byte) (signature []byte, err error) { - sig, err := crypto.Sign(onChainHash(msg), k.pk()) - return sig, err -} - -func (k onChainPrivateKey) Address() OnChainSigningAddress { - return OnChainSigningAddress(crypto.PubkeyToAddress(k.pk().PublicKey)) -} - -func onChainHash(msg []byte) []byte { - return crypto.Keccak256(msg) -} diff --git a/core/services/keystore/keys/ocrkey/on_chain_private_key_test.go b/core/services/keystore/keys/ocrkey/on_chain_private_key_test.go deleted file mode 100644 index 8613eb1d405..00000000000 --- a/core/services/keystore/keys/ocrkey/on_chain_private_key_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package ocrkey - -import ( - "crypto/ecdsa" - "crypto/rand" - "testing" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestOCRKeys_OnChainPrivateKey(t *testing.T) { - t.Parallel() - - pk, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) - require.NoError(t, err) - - k := onChainPrivateKey{func() *ecdsa.PrivateKey { return pk }} - - sig, err := k.Sign([]byte("hello world")) - - assert.NoError(t, err) - assert.NotEmpty(t, sig) -} diff --git a/core/services/keystore/keys/ocrkey/on_chain_public_key.go b/core/services/keystore/keys/ocrkey/on_chain_public_key.go deleted file mode 100644 index 90f54e39cda..00000000000 --- a/core/services/keystore/keys/ocrkey/on_chain_public_key.go +++ /dev/null @@ -1,13 +0,0 @@ -package ocrkey - -import ( - "crypto/ecdsa" - - "github.com/ethereum/go-ethereum/crypto" -) - -type OnChainPublicKey ecdsa.PublicKey - -func (k OnChainPublicKey) Address() OnChainSigningAddress { - return OnChainSigningAddress(crypto.PubkeyToAddress(ecdsa.PublicKey(k))) -} diff --git a/core/services/keystore/keys/ocrkey/on_chain_public_key_test.go b/core/services/keystore/keys/ocrkey/on_chain_public_key_test.go deleted file mode 100644 index 2828fd74db3..00000000000 --- a/core/services/keystore/keys/ocrkey/on_chain_public_key_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package ocrkey - -import ( - "crypto/ecdsa" - "crypto/rand" - "testing" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestOCRKeys_OnChainPublicKey(t *testing.T) { - t.Parallel() - - pk, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) - require.NoError(t, err) - - publicKey := OnChainPublicKey(pk.PublicKey) - - assert.NotEmpty(t, publicKey.Address()) -} diff --git a/core/services/keystore/keys/ocrkey/on_chain_signing_address.go b/core/services/keystore/keys/ocrkey/on_chain_signing_address.go deleted file mode 100644 index 871469c93dd..00000000000 --- a/core/services/keystore/keys/ocrkey/on_chain_signing_address.go +++ /dev/null @@ -1,69 +0,0 @@ -package ocrkey - -import ( - "database/sql/driver" - "encoding/json" - "fmt" - "strings" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/pkg/errors" - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting/types" -) - -const onChainSigningAddressPrefix = "ocrsad_" - -type OnChainSigningAddress ocrtypes.OnChainSigningAddress - -func (ocsa OnChainSigningAddress) String() string { - address := common.BytesToAddress(ocsa[:]) - return fmt.Sprintf("%s%s", onChainSigningAddressPrefix, address) -} - -func (ocsa OnChainSigningAddress) MarshalJSON() ([]byte, error) { - return json.Marshal(ocsa.String()) -} - -func (ocsa *OnChainSigningAddress) UnmarshalJSON(input []byte) error { - var hexString string - if err := json.Unmarshal(input, &hexString); err != nil { - return err - } - return ocsa.UnmarshalText([]byte(hexString)) -} - -func (ocsa *OnChainSigningAddress) UnmarshalText(bs []byte) error { - input := string(bs) - if strings.HasPrefix(input, onChainSigningAddressPrefix) { - input = string(bs[len(onChainSigningAddressPrefix):]) - } - - result, err := hexutil.Decode(input) - if err != nil { - return err - } - - var onChainSigningAddress common.Address - copy(onChainSigningAddress[:], result[:common.AddressLength]) - *ocsa = OnChainSigningAddress(onChainSigningAddress) - return nil -} - -func (ocsa OnChainSigningAddress) Value() (driver.Value, error) { - byteArray := [common.AddressLength]byte(ocsa) - return byteArray[:], nil -} - -func (ocsa *OnChainSigningAddress) Scan(value any) error { - switch typed := value.(type) { - case []byte: - if len(typed) != common.AddressLength { - return errors.New("wrong number of bytes to scan into address") - } - copy(ocsa[:], typed) - return nil - default: - return errors.Errorf(`unable to convert %v of %T to OnChainSigningAddress`, value, value) - } -} diff --git a/core/services/keystore/keys/ocrkey/on_chain_signing_address_test.go b/core/services/keystore/keys/ocrkey/on_chain_signing_address_test.go deleted file mode 100644 index e45da17f03a..00000000000 --- a/core/services/keystore/keys/ocrkey/on_chain_signing_address_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package ocrkey_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" -) - -func TestOCR_OnChainSigningAddress_String(t *testing.T) { - t.Parallel() - - // should contain EIP55CapitalizedAddress - const ocrSigningKey = "ocrsad_0x30762A700F7d836528dfB14DD60Ec2A3aEaA7694" - var address ocrkey.OnChainSigningAddress - - err := address.UnmarshalText([]byte(ocrSigningKey)) - require.NoError(t, err) - _, err = address.Value() - - assert.NoError(t, err) - assert.Equal(t, ocrSigningKey, address.String()) -} diff --git a/core/services/keystore/keys/p2pkey/export.go b/core/services/keystore/keys/p2pkey/export.go deleted file mode 100644 index 25385a028fc..00000000000 --- a/core/services/keystore/keys/p2pkey/export.go +++ /dev/null @@ -1,55 +0,0 @@ -package p2pkey - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "P2P" - -func FromEncryptedJSON(keyJSON []byte, password string) (KeyV2, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ EncryptedP2PKeyExport, rawPrivKey internal.Raw) (KeyV2, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -type EncryptedP2PKeyExport struct { - KeyType string `json:"keyType"` - PublicKey string `json:"publicKey"` - PeerID PeerID `json:"peerID"` - Crypto keystore.CryptoJSON `json:"crypto"` -} - -func (x EncryptedP2PKeyExport) GetCrypto() keystore.CryptoJSON { - return x.Crypto -} - -func (key KeyV2) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - func(id string, key KeyV2, cryptoJSON keystore.CryptoJSON) EncryptedP2PKeyExport { - return EncryptedP2PKeyExport{ - KeyType: id, - PublicKey: key.PublicKeyHex(), - PeerID: key.PeerID(), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "p2pkey" + password -} diff --git a/core/services/keystore/keys/p2pkey/export_test.go b/core/services/keystore/keys/p2pkey/export_test.go deleted file mode 100644 index cd9ceb9064c..00000000000 --- a/core/services/keystore/keys/p2pkey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package p2pkey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestP2PKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return NewV2() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/p2pkey/key_v2.go b/core/services/keystore/keys/p2pkey/key_v2.go deleted file mode 100644 index d7dc889ae73..00000000000 --- a/core/services/keystore/keys/p2pkey/key_v2.go +++ /dev/null @@ -1,117 +0,0 @@ -package p2pkey - -import ( - "bytes" - "crypto" - "crypto/ed25519" - "crypto/rand" - "encoding/hex" - "errors" - "io" - "math/big" - - "github.com/smartcontractkit/libocr/ragep2p/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -var libp2pPBPrefix = []byte{0x08, 0x01, 0x12, 0x40} - -func KeyFor(raw internal.Raw) KeyV2 { - privKey, err := unmarshalPrivateKey(raw) - if err != nil { - panic(err) - } - key, err := fromPrivkey(privKey) - if err != nil { - panic(err) - } - key.raw = raw - return key -} - -func unmarshalPrivateKey(raw internal.Raw) (ed25519.PrivateKey, error) { - b := internal.Bytes((raw)) - if !bytes.HasPrefix(b, libp2pPBPrefix) { - return nil, errors.New("invalid key: missing libp2p protobuf prefix") - } - return b[len(libp2pPBPrefix):], nil -} - -func marshalPrivateKey(key ed25519.PrivateKey) ([]byte, error) { - return bytes.Join([][]byte{libp2pPBPrefix, key}, nil), nil -} - -type KeyV2 struct { - raw internal.Raw - signer crypto.Signer - - peerID PeerID -} - -func fromPrivkey(privKey ed25519.PrivateKey) (KeyV2, error) { - peerID, err := types.PeerIDFromPrivateKey(privKey) - if err != nil { - return KeyV2{}, err - } - return KeyV2{ - signer: privKey, - peerID: PeerID(peerID), - }, nil -} - -func NewV2() (KeyV2, error) { - _, privKey, err := ed25519.GenerateKey(rand.Reader) - if err != nil { - return KeyV2{}, err - } - key, err := fromPrivkey(privKey) - if err != nil { - return KeyV2{}, err - } - marshalledPrivK, err := marshalPrivateKey(privKey) - if err != nil { - return KeyV2{}, err - } - key.raw = internal.NewRaw(marshalledPrivK) - return key, nil -} - -func MustNewV2XXXTestingOnly(k *big.Int) KeyV2 { - seed := make([]byte, ed25519.SeedSize) - copy(seed, k.Bytes()) - pk := ed25519.NewKeyFromSeed(seed) - key, err := fromPrivkey(pk) - if err != nil { - panic(err) - } - marshalledPrivK, err := marshalPrivateKey(pk) - if err != nil { - panic(err) - } - key.raw = internal.NewRaw(marshalledPrivK) - return key -} - -func (key KeyV2) ID() string { - return types.PeerID(key.peerID).String() -} - -func (key KeyV2) Raw() internal.Raw { - return key.raw -} - -func (key KeyV2) PeerID() PeerID { - return key.peerID -} - -func (key KeyV2) PublicKeyHex() string { - pubKeyBytes := key.signer.Public().(ed25519.PublicKey) - return hex.EncodeToString(pubKeyBytes) -} - -func (key KeyV2) Public() crypto.PublicKey { return key.signer.Public() } - -func (key KeyV2) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) { - return key.signer.Sign(rand, message, opts) -} diff --git a/core/services/keystore/keys/p2pkey/key_v2_test.go b/core/services/keystore/keys/p2pkey/key_v2_test.go deleted file mode 100644 index 8aedb5674d9..00000000000 --- a/core/services/keystore/keys/p2pkey/key_v2_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package p2pkey - -import ( - "crypto/ed25519" - "encoding/hex" - "testing" - - ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestP2PKeys_KeyV2(t *testing.T) { - kv2, err := NewV2() - require.NoError(t, err) - - pkv2 := kv2.Public().(ed25519.PublicKey) - - assert.Equal(t, ragep2ptypes.PeerID(kv2.PeerID()).String(), kv2.ID()) - assert.Equal(t, hex.EncodeToString(pkv2), kv2.PublicKeyHex()) -} diff --git a/core/services/keystore/keys/p2pkey/peer_id.go b/core/services/keystore/keys/p2pkey/peer_id.go deleted file mode 100644 index 68e919dbbe8..00000000000 --- a/core/services/keystore/keys/p2pkey/peer_id.go +++ /dev/null @@ -1,96 +0,0 @@ -package p2pkey - -import ( - "database/sql/driver" - "encoding/json" - "fmt" - "strings" - - "github.com/pkg/errors" - - "github.com/smartcontractkit/libocr/ragep2p/types" -) - -const peerIDPrefix = "p2p_" - -type PeerID types.PeerID - -func MakePeerID(s string) (PeerID, error) { - var peerID PeerID - return peerID, peerID.UnmarshalString(s) -} - -func (p PeerID) String() string { - // Handle a zero peerID more gracefully, i.e. print it as empty string rather - // than `p2p_` - if p == (PeerID{}) { - return "" - } - return fmt.Sprintf("%s%s", peerIDPrefix, p.Raw()) -} - -func (p PeerID) Raw() string { - return types.PeerID(p).String() -} - -func (p *PeerID) UnmarshalString(s string) error { - return p.UnmarshalText([]byte(s)) -} - -func (p *PeerID) MarshalText() ([]byte, error) { - if *p == (PeerID{}) { - return nil, nil - } - return []byte(p.Raw()), nil -} - -func (p *PeerID) UnmarshalText(bs []byte) error { - input := string(bs) - if strings.HasPrefix(input, peerIDPrefix) { - input = string(bs[len(peerIDPrefix):]) - } - - if input == "" { - return nil - } - - var peerID types.PeerID - err := peerID.UnmarshalText([]byte(input)) - if err != nil { - return errors.Wrapf(err, `PeerID#UnmarshalText("%v")`, input) - } - *p = PeerID(peerID) - return nil -} - -func (p *PeerID) Scan(value any) error { - *p = PeerID{} - switch s := value.(type) { - case string: - if s != "" { - return p.UnmarshalText([]byte(s)) - } - case nil: - default: - return errors.Errorf("PeerID#Scan got %T, expected string", value) - } - return nil -} - -func (p PeerID) Value() (driver.Value, error) { - b, err := types.PeerID(p).MarshalText() - return string(b), err -} - -func (p PeerID) MarshalJSON() ([]byte, error) { - return json.Marshal(p.String()) -} - -func (p *PeerID) UnmarshalJSON(input []byte) error { - var result string - if err := json.Unmarshal(input, &result); err != nil { - return err - } - - return p.UnmarshalText([]byte(result)) -} diff --git a/core/services/keystore/keys/p2pkey/peer_id_test.go b/core/services/keystore/keys/p2pkey/peer_id_test.go deleted file mode 100644 index 3d4ad05d5f2..00000000000 --- a/core/services/keystore/keys/p2pkey/peer_id_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package p2pkey - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestP2PKeys_PeerID(t *testing.T) { - t.Run("make peer ID", func(t *testing.T) { - id, err := MakePeerID("12D3KooWM1111111111111111111111111111111111111111111") - require.NoError(t, err) - _, err = MakePeerID("invalid") - assert.Error(t, err) - - assert.Equal(t, "p2p_12D3KooWM1111111111111111111111111111111111111111111", id.String()) - }) - - t.Run("unmarshals new ID", func(t *testing.T) { - id, err := MakePeerID("12D3KooWM1111111111111111111111111111111111111111111") - require.NoError(t, err) - fakeKey := MustNewV2XXXTestingOnly(big.NewInt(1)) - - err = id.UnmarshalString(fakeKey.ID()) - require.NoError(t, err) - - assert.Equal(t, "p2p_"+fakeKey.ID(), id.String()) - }) - - t.Run("scans new ID", func(t *testing.T) { - id, err := MakePeerID("12D3KooWM1111111111111111111111111111111111111111111") - require.NoError(t, err) - fakeKey := MustNewV2XXXTestingOnly(big.NewInt(1)) - - err = id.Scan(fakeKey.ID()) - require.NoError(t, err) - - assert.Equal(t, "p2p_"+fakeKey.ID(), id.String()) - - err = id.Scan(12) - assert.Error(t, err) - assert.Empty(t, id.String()) - }) -} - -func TestPeerID_marshal(t *testing.T) { - id, err := MakePeerID("p2p_12D3KooWMoejJznyDuEk5aX6GvbjaG12UzeornPCBNzMRqdwrFJw") - require.NoError(t, err) - t.Run("json", func(t *testing.T) { - b, err := id.MarshalJSON() - require.NoError(t, err) - var got PeerID - require.NoError(t, got.UnmarshalJSON(b)) - require.Equal(t, id, got) - }) - t.Run("db", func(t *testing.T) { - v, err := id.Value() - require.NoError(t, err) - var got PeerID - require.NoError(t, got.Scan(v)) - require.Equal(t, id, got) - }) - t.Run("text", func(t *testing.T) { - s, err := id.MarshalText() - require.NoError(t, err) - var got PeerID - require.NoError(t, got.UnmarshalText(s)) - require.Equal(t, id, got) - }) -} diff --git a/core/services/keystore/keys/sha256.go b/core/services/keystore/keys/sha256.go deleted file mode 100644 index d555ba42f3a..00000000000 --- a/core/services/keystore/keys/sha256.go +++ /dev/null @@ -1,85 +0,0 @@ -package keys - -import ( - "database/sql/driver" - "encoding/hex" - "encoding/json" - "fmt" -) - -// Explicit type indicating a 32-byte sha256 hash -type Sha256Hash [32]byte - -var EmptySha256Hash = new(Sha256Hash) - -// MarshalJSON converts a Sha256Hash to a JSON byte slice. -func (s Sha256Hash) MarshalJSON() ([]byte, error) { - return json.Marshal(s.String()) -} - -// UnmarshalJSON converts a bytes slice of JSON to a TaskType. -func (s *Sha256Hash) UnmarshalJSON(input []byte) error { - var shaHash string - if err := json.Unmarshal(input, &shaHash); err != nil { - return err - } - - sha, err := Sha256HashFromHex(shaHash) - if err != nil { - return err - } - - *s = sha - return nil -} - -func Sha256HashFromHex(x string) (Sha256Hash, error) { - bs, err := hex.DecodeString(x) - if err != nil { - return Sha256Hash{}, err - } - var hash Sha256Hash - copy(hash[:], bs) - return hash, nil -} - -func MustSha256HashFromHex(x string) Sha256Hash { - bs, err := hex.DecodeString(x) - if err != nil { - panic(err) - } - var hash Sha256Hash - copy(hash[:], bs) - return hash -} - -func (s Sha256Hash) String() string { - return hex.EncodeToString(s[:]) -} - -func (s *Sha256Hash) MarshalText() ([]byte, error) { - return []byte(s.String()), nil -} - -func (s *Sha256Hash) UnmarshalText(bs []byte) (err error) { - *s, err = Sha256HashFromHex(string(bs)) - return -} - -func (s *Sha256Hash) Scan(value any) error { - bytes, ok := value.([]byte) - if !ok { - return fmt.Errorf("failed to unmarshal Sha256Hash value: %v", value) - } - if s == nil { - *s = Sha256Hash{} - } - copy((*s)[:], bytes) - return nil -} - -func (s Sha256Hash) Value() (driver.Value, error) { - b := make([]byte, 32) - copy(b, s[:]) - return b, nil -} diff --git a/core/services/keystore/keys/sha256_test.go b/core/services/keystore/keys/sha256_test.go deleted file mode 100644 index 0ce6dabe20a..00000000000 --- a/core/services/keystore/keys/sha256_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package keys_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestSha256Hash_MarshalJSON_UnmarshalJSON(t *testing.T) { - t.Parallel() - - hash := keys.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") - json, err := hash.MarshalJSON() - require.NoError(t, err) - require.NotEmpty(t, json) - - var newHash keys.Sha256Hash - err = newHash.UnmarshalJSON(json) - require.NoError(t, err) - - require.Equal(t, hash, newHash) -} - -func TestSha256Hash_Sha256HashFromHex(t *testing.T) { - t.Parallel() - - _, err := keys.Sha256HashFromHex("abczzz") - require.Error(t, err) - - _, err = keys.Sha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") - require.NoError(t, err) - - _, err = keys.Sha256HashFromHex("f5bf259689b26f1374e6") - require.NoError(t, err) -} - -func TestSha256Hash_String(t *testing.T) { - t.Parallel() - - hash := keys.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") - assert.Equal(t, "f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5", hash.String()) -} - -func TestSha256Hash_Scan_Value(t *testing.T) { - t.Parallel() - - hash := keys.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") - val, err := hash.Value() - require.NoError(t, err) - - var newHash keys.Sha256Hash - err = newHash.Scan(val) - require.NoError(t, err) - - require.Equal(t, hash, newHash) -} diff --git a/core/services/keystore/keys/solkey/export.go b/core/services/keystore/keys/solkey/export.go deleted file mode 100644 index e2a0f35b5a4..00000000000 --- a/core/services/keystore/keys/solkey/export.go +++ /dev/null @@ -1,47 +0,0 @@ -package solkey - -import ( - "encoding/hex" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "Solana" - -// FromEncryptedJSON gets key from json and password -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -// ToEncryptedJSON returns encrypted JSON representing key -func (key Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: hex.EncodeToString(key.pubKey), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "solkey" + password -} diff --git a/core/services/keystore/keys/solkey/export_test.go b/core/services/keystore/keys/solkey/export_test.go deleted file mode 100644 index aeae61da475..00000000000 --- a/core/services/keystore/keys/solkey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package solkey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestSolanaKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return New() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/solkey/key.go b/core/services/keystore/keys/solkey/key.go deleted file mode 100644 index ef464322801..00000000000 --- a/core/services/keystore/keys/solkey/key.go +++ /dev/null @@ -1,84 +0,0 @@ -package solkey - -import ( - "crypto" - "crypto/ed25519" - crypto_rand "crypto/rand" - "io" - - "github.com/gagliardetto/solana-go" - "github.com/mr-tron/base58" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func KeyFor(raw internal.Raw) Key { - privKey := ed25519.NewKeyFromSeed(internal.Bytes(raw)) - return Key{ - raw: raw, - signFn: privKey.Sign, - pubKey: privKey.Public().(ed25519.PublicKey), - } -} - -// Key represents Solana key -type Key struct { - raw internal.Raw - signFn func(io.Reader, []byte, crypto.SignerOpts) ([]byte, error) - pubKey ed25519.PublicKey -} - -// New creates new Key -func New() (Key, error) { - return newFrom(crypto_rand.Reader) -} - -// MustNewInsecure return Key if no error -func MustNewInsecure(reader io.Reader) Key { - key, err := newFrom(reader) - if err != nil { - panic(err) - } - return key -} - -func newFrom(reader io.Reader) (Key, error) { - pub, priv, err := ed25519.GenerateKey(reader) - if err != nil { - return Key{}, err - } - return Key{ - raw: internal.NewRaw(priv.Seed()), - signFn: priv.Sign, - pubKey: pub, - }, nil -} - -// ID gets Key ID -func (key Key) ID() string { - return key.PublicKeyStr() -} - -// GetPublic get Key's public key -func (key Key) GetPublic() ed25519.PublicKey { - return key.pubKey -} - -// PublicKeyStr return base58 encoded public key -func (key Key) PublicKeyStr() string { - return base58.Encode(key.pubKey) -} - -// Raw from private key -func (key Key) Raw() internal.Raw { return key.raw } - -// Sign is used to sign a message -func (key Key) Sign(msg []byte) ([]byte, error) { - return key.signFn(crypto_rand.Reader, msg, crypto.Hash(0)) -} - -// PublicKey copies public key slice -func (key Key) PublicKey() (pubKey solana.PublicKey) { - copy(pubKey[:], key.pubKey) - return -} diff --git a/core/services/keystore/keys/starkkey/export.go b/core/services/keystore/keys/starkkey/export.go deleted file mode 100644 index 5a107a09ef5..00000000000 --- a/core/services/keystore/keys/starkkey/export.go +++ /dev/null @@ -1,45 +0,0 @@ -package starkkey - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "StarkNet" - -// FromEncryptedJSON gets key from json and password -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -// ToEncryptedJSON returns encrypted JSON representing key -func ToEncryptedJSON(key Key, password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: key.StarkKeyStr(), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "starkkey" + password -} diff --git a/core/services/keystore/keys/starkkey/export_test.go b/core/services/keystore/keys/starkkey/export_test.go deleted file mode 100644 index a4b9d078ea7..00000000000 --- a/core/services/keystore/keys/starkkey/export_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package starkkey - -import ( - "testing" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestStarkNetKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - key, err := New() - return TestWrapped{key}, err -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - key, err := FromEncryptedJSON(keyJSON, password) - return TestWrapped{key}, err -} - -// wrap key to conform to desired test interface -type TestWrapped struct { - Key -} - -func (w TestWrapped) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) ([]byte, error) { - return ToEncryptedJSON(w.Key, password, scryptParams) -} diff --git a/core/services/keystore/keys/starkkey/key.go b/core/services/keystore/keys/starkkey/key.go deleted file mode 100644 index 9100b6642ca..00000000000 --- a/core/services/keystore/keys/starkkey/key.go +++ /dev/null @@ -1,91 +0,0 @@ -package starkkey - -import ( - crypto_rand "crypto/rand" - "fmt" - "io" - "math/big" - - "github.com/NethermindEth/juno/core/felt" - "github.com/NethermindEth/starknet.go/curve" - - adapters "github.com/smartcontractkit/chainlink-common/pkg/loop/adapters/starknet" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func KeyFor(raw internal.Raw) Key { - k := Key{raw: raw} - var err error - - priv := new(big.Int).SetBytes(internal.Bytes(raw)) - k.signFn = func(hash *big.Int) (x, y *big.Int, err error) { - return curve.Curve.Sign(hash, priv) - } - k.pub.X, k.pub.Y, err = curve.Curve.PrivateToPoint(priv) - if err != nil { - panic(err) // key not generated - } - return k -} - -type PublicKey struct { - X, Y *big.Int -} - -// Key represents Starknet key -type Key struct { - raw internal.Raw - signFn func(*big.Int) (x, y *big.Int, err error) - pub PublicKey -} - -// New creates new Key -func New() (Key, error) { - return newFrom(crypto_rand.Reader) -} - -// MustNewInsecure return Key if no error -func MustNewInsecure(reader io.Reader) Key { - key, err := newFrom(reader) - if err != nil { - panic(err) - } - return key -} - -func newFrom(reader io.Reader) (Key, error) { - return GenerateKey(reader) -} - -// ID gets Key ID -func (key Key) ID() string { - return key.StarkKeyStr() -} - -// StarkKeyStr is the starknet public key associated to the private key -// it is the X component of the ECDSA pubkey and used in the deployment of the account contract -// this func is used in exporting it via CLI and API -func (key Key) StarkKeyStr() string { - return new(felt.Felt).SetBytes(key.pub.X.Bytes()).String() -} - -// Raw from private key -func (key Key) Raw() internal.Raw { return key.raw } - -func (key Key) Sign(hash []byte) ([]byte, error) { - starkHash := new(big.Int).SetBytes(hash) - x, y, err := key.signFn(starkHash) - if err != nil { - return nil, fmt.Errorf("error signing data with curve: %w", err) - } - sig, err := adapters.SignatureFromBigInts(x, y) - if err != nil { - return nil, err - } - return sig.Bytes() -} - -// PublicKey copies public key object -func (key Key) PublicKey() PublicKey { - return key.pub -} diff --git a/core/services/keystore/keys/starkkey/ocr2key.go b/core/services/keystore/keys/starkkey/ocr2key.go deleted file mode 100644 index c7613fd628c..00000000000 --- a/core/services/keystore/keys/starkkey/ocr2key.go +++ /dev/null @@ -1,188 +0,0 @@ -package starkkey - -import ( - "bytes" - "io" - "math/big" - - "github.com/pkg/errors" - - "github.com/NethermindEth/juno/core/felt" - "github.com/NethermindEth/starknet.go/curve" - - "github.com/smartcontractkit/libocr/offchainreporting2plus/chains/evmutil" - "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -var _ types.OnchainKeyring = &OCR2Key{} - -type OCR2Key struct { - Key -} - -func NewOCR2Key(material io.Reader) (*OCR2Key, error) { - k, err := GenerateKey(material) - - return &OCR2Key{k}, err -} - -func (sk *OCR2Key) PublicKey() types.OnchainPublicKey { - ans := new(felt.Felt).SetBytes(sk.pub.X.Bytes()).Bytes() - return ans[:] -} - -func ReportToSigData(reportCtx types.ReportContext, report types.Report) (*big.Int, error) { - var dataArray []*big.Int - - rawReportContext := rawReportContext(reportCtx) - dataArray = append(dataArray, new(big.Int).SetBytes(rawReportContext[0][:])) - dataArray = append(dataArray, new(big.Int).SetBytes(rawReportContext[1][:])) - dataArray = append(dataArray, new(big.Int).SetBytes(rawReportContext[2][:])) - - // split report into separate felts for hashing - splitReport, err := splitReport(report) - if err != nil { - return &big.Int{}, err - } - for i := range splitReport { - dataArray = append(dataArray, new(big.Int).SetBytes(splitReport[i])) - } - - return curve.ComputeHashOnElements(dataArray), nil -} - -func (sk *OCR2Key) Sign(reportCtx types.ReportContext, report types.Report) ([]byte, error) { - hash, err := ReportToSigData(reportCtx, report) - if err != nil { - return []byte{}, err - } - r, s, err := sk.signFn(hash) - if err != nil { - return []byte{}, err - } - - // enforce s <= N/2 to prevent signature malleability - if s.Cmp(new(big.Int).Rsh(curve.Curve.N, 1)) > 0 { - s.Sub(curve.Curve.N, s) - } - - // encoding: public key (32 bytes) + r (32 bytes) + s (32 bytes) - buff := bytes.NewBuffer([]byte(sk.PublicKey())) - if _, err := buff.Write(padBytes(r.Bytes())); err != nil { - return []byte{}, err - } - if _, err := buff.Write(padBytes(s.Bytes())); err != nil { - return []byte{}, err - } - - out := buff.Bytes() - if len(out) != sk.MaxSignatureLength() { - return []byte{}, errors.Errorf("unexpected signature size, got %d want %d", len(out), sk.MaxSignatureLength()) - } - return out, nil -} - -func (sk *OCR2Key) Sign3(digest types.ConfigDigest, seqNr uint64, r types.Report) (signature []byte, err error) { - return nil, errors.New("not implemented") -} - -func (sk *OCR2Key) SignBlob(b []byte) ([]byte, error) { - return nil, errors.New("not implemented") -} - -func (sk *OCR2Key) Verify(publicKey types.OnchainPublicKey, reportCtx types.ReportContext, report types.Report, signature []byte) bool { - // check valid signature length - if len(signature) != sk.MaxSignatureLength() { - return false - } - - // convert OnchainPublicKey (starkkey) into ecdsa public keys (prepend 2 or 3 to indicate +/- Y coord) - var keys [2]PublicKey - keys[0].X = new(big.Int).SetBytes(publicKey) - keys[0].Y = curve.Curve.GetYCoordinate(keys[0].X) - - // When there is no point with the provided x-coordinate, the GetYCoordinate function returns the nil value. - if keys[0].Y == nil { - return false - } - - keys[1].X = keys[0].X - keys[1].Y = new(big.Int).Mul(keys[0].Y, big.NewInt(-1)) - - hash, err := ReportToSigData(reportCtx, report) - if err != nil { - return false - } - - r := new(big.Int).SetBytes(signature[32:64]) - s := new(big.Int).SetBytes(signature[64:]) - - // Only allow canonical signatures to avoid signature malleability. Verify s <= N/2 - if s.Cmp(new(big.Int).Rsh(curve.Curve.N, 1)) == 1 { - return false - } - - return curve.Curve.Verify(hash, r, s, keys[0].X, keys[0].Y) || curve.Curve.Verify(hash, r, s, keys[1].X, keys[1].Y) -} - -func (sk *OCR2Key) Verify3(publicKey types.OnchainPublicKey, cd types.ConfigDigest, seqNr uint64, r types.Report, signature []byte) bool { - return false -} - -func (sk *OCR2Key) VerifyBlob(pubkey types.OnchainPublicKey, b, sig []byte) bool { - return false -} - -func (sk *OCR2Key) MaxSignatureLength() int { - return 32 + 32 + 32 // publickey + r + s -} - -func (sk *OCR2Key) Marshal() ([]byte, error) { - return padBytes(internal.Bytes(sk.raw)), nil -} - -// https://github.com/NethermindEth/juno/blob/3e71279632d82689e5af03e26693ca5c58a2376e/pkg/crypto/weierstrass/weierstrass.go#L377 -const privateKeyLen = 32 - -func (sk *OCR2Key) Unmarshal(in []byte) error { - // enforce byte length - if len(in) != privateKeyLen { - return errors.Errorf("unexpected seed size, got %d want %d", len(in), privateKeyLen) - } - - sk.Key = KeyFor(internal.NewRaw(in)) - return nil -} - -func splitReport(report types.Report) ([][]byte, error) { - chunkSize := 32 - if len(report)%chunkSize != 0 { - return [][]byte{}, errors.New("invalid report length") - } - - // order is guaranteed by buildReport: - // observation_timestamp - // observers - // observations_len - // observations - // juels_per_fee_coin - // gas_price - slices := [][]byte{} - for i := 0; i < len(report)/chunkSize; i++ { - idx := i * chunkSize - slices = append(slices, report[idx:(idx+chunkSize)]) - } - - return slices, nil -} - -// NOTE: this should sit in the ocr2 package but that causes import cycles -func rawReportContext(repctx types.ReportContext) [3][32]byte { - rawReportContext := evmutil.RawReportContext(repctx) - // NOTE: Ensure extra_hash is 31 bytes with first byte blanked out - // libocr generates a 32 byte extraHash but we need to fit it into a felt - rawReportContext[2][0] = 0 - return rawReportContext -} diff --git a/core/services/keystore/keys/starkkey/ocr2key_test.go b/core/services/keystore/keys/starkkey/ocr2key_test.go deleted file mode 100644 index 02b1d9d4896..00000000000 --- a/core/services/keystore/keys/starkkey/ocr2key_test.go +++ /dev/null @@ -1,202 +0,0 @@ -package starkkey - -import ( - cryptorand "crypto/rand" - "encoding/hex" - "io" - "math/big" - mathrand "math/rand" - "testing" - - "github.com/NethermindEth/juno/core/felt" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -// msg to hash -// [ -// '0x4acf99cb25a4803916f086440c661295b105a485efdc649ac4de9536da25b', // digest -// 1, // epoch_and_round -// 1, // extra_hash -// 1, // timestamp -// '0x00010203000000000000000000000000000000000000000000000000000000', // observers -// 4, // len -// 99, // reports -// 99, -// 99, -// 99, -// 1 juels_per_fee_coin -// ] -// hash 0x1332a8dabaabef63b03438ca50760cb9f5c0292cbf015b2395e50e6157df4e3 -// --> privKey 2137244795266879235401249500471353867704187908407744160927664772020405449078 r 2898571078985034687500959842265381508927681132188252715370774777831313601543 s 1930849708769648077928186998643944706551011476358007177069185543644456022504 pubKey 1118148281956858477519852250235501663092798578871088714409528077622994994907 -// privKey 3571531812827697194985986636869245829152430835021673171507607525908246940354 r 3242770073040892094735101607173275538752888766491356946211654602282309624331 s 2150742645846855766116236144967953798077492822890095121354692808525999221887 pubKey 2445157821578193538289426656074203099996547227497157254541771705133209838679 - -func TestStarknetKeyring_TestVector(t *testing.T) { - var kr1 OCR2Key - bigKey, _ := new(big.Int).SetString("2137244795266879235401249500471353867704187908407744160927664772020405449078", 10) - feltKey, err := new(felt.Felt).SetString(bigKey.String()) - require.NoError(t, err) - bytesKey := feltKey.Bytes() - err = kr1.Unmarshal(bytesKey[:]) - require.NoError(t, err) - // kr2, err := NewOCR2Key(cryptorand.Reader) - // require.NoError(t, err) - - bytes, err := hex.DecodeString("0004acf99cb25a4803916f086440c661295b105a485efdc649ac4de9536da25b") - require.NoError(t, err) - configDigest, err := ocrtypes.BytesToConfigDigest(bytes) - require.NoError(t, err) - - ctx := ocrtypes.ReportContext{ - ReportTimestamp: ocrtypes.ReportTimestamp{ - ConfigDigest: configDigest, - Epoch: 0, - Round: 1, - }, - ExtraHash: [32]byte{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - }, - } - - var report []byte - b1 := new(felt.Felt).SetUint64(1).Bytes() - report = append(report, b1[:]...) - b2Bytes, err := hex.DecodeString("00010203000000000000000000000000000000000000000000000000000000") - require.NoError(t, err) - b2 := new(felt.Felt).SetBytes(b2Bytes).Bytes() - report = append(report, b2[:]...) - b3 := new(felt.Felt).SetUint64(4).Bytes() - report = append(report, b3[:]...) - b4 := new(felt.Felt).SetUint64(99).Bytes() - report = append(report, b4[:]...) - report = append(report, b4[:]...) - report = append(report, b4[:]...) - report = append(report, b4[:]...) - report = append(report, b1[:]...) - - // check that report hash matches expected - msg, err := ReportToSigData(ctx, report) - require.NoError(t, err) - - expected, err := new(felt.Felt).SetString("0x1332a8dabaabef63b03438ca50760cb9f5c0292cbf015b2395e50e6157df4e3") - expectedBytes := expected.Bytes() - require.NoError(t, err) - assert.Equal(t, expectedBytes[:], msg.Bytes()) - - // check that signature matches expected - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - - pub := new(felt.Felt).SetBytes(sig[0:32]) - r := new(felt.Felt).SetBytes(sig[32:64]) - s := new(felt.Felt).SetBytes(sig[64:]) - - bigPubExpected, _ := new(big.Int).SetString("1118148281956858477519852250235501663092798578871088714409528077622994994907", 10) - feltPubExpected := new(felt.Felt).SetBytes(bigPubExpected.Bytes()) - assert.Equal(t, feltPubExpected, pub) - - bigRExpected, _ := new(big.Int).SetString("2898571078985034687500959842265381508927681132188252715370774777831313601543", 10) - feltRExpected := new(felt.Felt).SetBytes(bigRExpected.Bytes()) - assert.Equal(t, feltRExpected, r) - - // test for malleability - otherS, _ := new(big.Int).SetString("1930849708769648077928186998643944706551011476358007177069185543644456022504", 10) - bigSExpected, _ := new(big.Int).SetString("1687653079896483135769135784451125398975732275358080312084893914240056843079", 10) - - feltSExpected := new(felt.Felt).SetBytes(bigSExpected.Bytes()) - assert.NotEqual(t, otherS, s, "signature not in canonical form") - assert.Equal(t, feltSExpected, s) -} - -func TestStarknetKeyring_Sign_Verify(t *testing.T) { - kr1, err := NewOCR2Key(cryptorand.Reader) - require.NoError(t, err) - kr2, err := NewOCR2Key(cryptorand.Reader) - require.NoError(t, err) - - digest := "00044e5d4f35325e464c87374b13c512f60e09d1236dd902f4bef4c9aedd7300" - bytes, err := hex.DecodeString(digest) - require.NoError(t, err) - configDigest, err := ocrtypes.BytesToConfigDigest(bytes) - require.NoError(t, err) - - ctx := ocrtypes.ReportContext{ - ReportTimestamp: ocrtypes.ReportTimestamp{ - ConfigDigest: configDigest, - Epoch: 1, - Round: 1, - }, - ExtraHash: [32]byte{ - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - }, - } - report := ocrtypes.Report{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 91, 43, 83, // observations_timestamp - 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // observers - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, // len - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 150, 2, 210, // observation 1 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 150, 2, 211, // observation 2 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 224, 182, 179, 167, 100, 0, 0, // juels per fee coin (1 with 18 decimal places) - } - - t.Run("can verify", func(t *testing.T) { - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - result := kr2.Verify(kr1.PublicKey(), ctx, report, sig) - require.True(t, result) - }) - - t.Run("invalid sig", func(t *testing.T) { - result := kr2.Verify(kr1.PublicKey(), ctx, report, []byte{0x01}) - require.False(t, result) - - longSig := [100]byte{} - result = kr2.Verify(kr1.PublicKey(), ctx, report, longSig[:]) - require.False(t, result) - }) - - t.Run("invalid pubkey", func(t *testing.T) { - sig, err := kr1.Sign(ctx, report) - require.NoError(t, err) - - pk := []byte{0x01} - result := kr2.Verify(pk, ctx, report, sig) - require.False(t, result) - - pk = big.NewInt(int64(31337)).Bytes() - result = kr2.Verify(pk, ctx, report, sig) - require.False(t, result) - }) -} - -func TestStarknetKeyring_Marshal(t *testing.T) { - testStarknetKeyringMarshal(t, cryptorand.Reader) -} - -func testStarknetKeyringMarshal(t *testing.T, r io.Reader) { - kr1, err := NewOCR2Key(r) - require.NoError(t, err) - m, err := kr1.Marshal() - require.NoError(t, err) - kr2 := OCR2Key{} - err = kr2.Unmarshal(m) - require.NoError(t, err) - assert.Equal(t, internal.Bytes(kr1.raw), internal.Bytes(kr2.raw)) - - // Invalid seed size should error - require.Error(t, kr2.Unmarshal([]byte{0x01})) -} - -func FuzzStarknetKeyring_Marshal(f *testing.F) { - f.Fuzz(func(t *testing.T, seed int64) { - r := mathrand.New(mathrand.NewSource(seed)) - testStarknetKeyringMarshal(t, r) - }) -} diff --git a/core/services/keystore/keys/starkkey/utils.go b/core/services/keystore/keys/starkkey/utils.go deleted file mode 100644 index 46fd516d67d..00000000000 --- a/core/services/keystore/keys/starkkey/utils.go +++ /dev/null @@ -1,51 +0,0 @@ -package starkkey - -import ( - "crypto/rand" - "errors" - "io" - "math/big" - - "github.com/NethermindEth/starknet.go/curve" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -// reimplements parts of -// https://github.com/NethermindEth/starknet.go/blob/0bdaab716ce24a521304744a8fbd8e01800c241d/curve/curve.go#L702 -// generate the PK as a pseudo-random number in the interval [1, CurveOrder - 1] -// using io.Reader, and Key struct -func GenerateKey(material io.Reader) (k Key, err error) { - max := new(big.Int).Sub(curve.Curve.N, big.NewInt(1)) - - priv, err := rand.Int(material, max) - if err != nil { - return k, err - } - k.signFn = func(hash *big.Int) (x, y *big.Int, err error) { - return curve.Curve.Sign(hash, priv) - } - - k.pub.X, k.pub.Y, err = curve.Curve.PrivateToPoint(priv) - if err != nil { - return k, err - } - - if !curve.Curve.IsOnCurve(k.pub.X, k.pub.Y) { - return k, errors.New("key gen is not on stark curve") - } - k.raw = internal.NewRaw(padBytes(priv.Bytes())) - - return k, nil -} - -// pad bytes to privateKeyLen -func padBytes(a []byte) []byte { - if len(a) < privateKeyLen { - pad := make([]byte, privateKeyLen-len(a)) - return append(pad, a...) - } - - // return original if length is >= to specified length - return a -} diff --git a/core/services/keystore/keys/suikey/export.go b/core/services/keystore/keys/suikey/export.go deleted file mode 100644 index a67beb7881f..00000000000 --- a/core/services/keystore/keys/suikey/export.go +++ /dev/null @@ -1,47 +0,0 @@ -package suikey - -import ( - "encoding/hex" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "Sui" - -// FromEncryptedJSON gets key from json and password -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -// ToEncryptedJSON returns encrypted JSON representing key -func (s Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - s, - password, - scryptParams, - adulteratedPassword, - func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: hex.EncodeToString(key.pubKey), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "suikey" + password -} diff --git a/core/services/keystore/keys/suikey/export_test.go b/core/services/keystore/keys/suikey/export_test.go deleted file mode 100644 index 993629d0e57..00000000000 --- a/core/services/keystore/keys/suikey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package suikey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestSuiKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return New() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/suikey/key.go b/core/services/keystore/keys/suikey/key.go deleted file mode 100644 index 5d9ba5ac018..00000000000 --- a/core/services/keystore/keys/suikey/key.go +++ /dev/null @@ -1,107 +0,0 @@ -package suikey - -import ( - "crypto" - "crypto/ed25519" - cryptorand "crypto/rand" - "encoding/hex" - "fmt" - "io" - - "golang.org/x/crypto/blake2b" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -// Ed25519Scheme Ed25519 signature scheme flag -// https://docs.sui.io/concepts/cryptography/transaction-auth/keys-addresses#address-format -const Ed25519Scheme byte = 0x00 - -// Key represents a Sui account -type Key struct { - raw internal.Raw - signFn func(io.Reader, []byte, crypto.SignerOpts) ([]byte, error) - pubKey ed25519.PublicKey -} - -// KeyFor creates an Account from a raw key -func KeyFor(raw internal.Raw) Key { - privKey := ed25519.NewKeyFromSeed(internal.Bytes(raw)) - pubKey := privKey.Public().(ed25519.PublicKey) - return Key{ - raw: raw, - signFn: privKey.Sign, - pubKey: pubKey, - } -} - -// New creates new Key -func New() (Key, error) { - return newFrom(cryptorand.Reader) -} - -// MustNewInsecure returns an Account if no error -func MustNewInsecure(reader io.Reader) Key { - key, err := newFrom(reader) - if err != nil { - panic(err) - } - return key -} - -// newFrom creates a new Account from a provided random reader -func newFrom(reader io.Reader) (Key, error) { - pub, priv, err := ed25519.GenerateKey(reader) - if err != nil { - return Key{}, err - } - return Key{ - raw: internal.NewRaw(priv.Seed()), - signFn: priv.Sign, - pubKey: pub, - }, nil -} - -// ID gets Account ID -func (s Key) ID() string { - return s.PublicKeyStr() -} - -// Address returns the Sui address -// https://docs.sui.io/concepts/cryptography/transaction-auth/keys-addresses#address-format -func (s Key) Address() string { - // Prepend the Ed25519 scheme flag to the public key - flaggedPubKey := make([]byte, 1+len(s.pubKey)) - flaggedPubKey[0] = Ed25519Scheme - copy(flaggedPubKey[1:], s.pubKey) - - // Hash the flagged public key with Blake2b-256 - addressBytes := blake2b.Sum256(flaggedPubKey) - - // Return the full 32-byte address with 0x prefix - return hex.EncodeToString(addressBytes[:]) -} - -// Account is an alias for Address -func (s Key) Account() string { - return s.Address() -} - -// GetPublic gets Account's public key -func (s Key) GetPublic() ed25519.PublicKey { - return s.pubKey -} - -// PublicKeyStr returns hex encoded public key -func (s Key) PublicKeyStr() string { - return fmt.Sprintf("%064x", s.pubKey) -} - -// Raw returns the seed from private key -func (s Key) Raw() internal.Raw { return s.raw } - -// Sign is used to sign a message -func (s Key) Sign(msg []byte) ([]byte, error) { - var noHash crypto.Hash - return s.signFn(cryptorand.Reader, msg, noHash) // no specific hash function used -} diff --git a/core/services/keystore/keys/suikey/key_test.go b/core/services/keystore/keys/suikey/key_test.go deleted file mode 100644 index 4f43b0563be..00000000000 --- a/core/services/keystore/keys/suikey/key_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package suikey - -import ( - "encoding/hex" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func TestSuiKey(t *testing.T) { - bytes, err := hex.DecodeString("f0d07ab448018b2754475f9a3b580218b0675a1456aad96ad607c7bbd7d9237b") - require.NoError(t, err) - k := KeyFor(internal.NewRaw(bytes)) - assert.Equal(t, "2acd605efc181e2af8a0b8c0686a5e12578efa1253d15a235fa5e5ad970c4b29", k.PublicKeyStr()) - assert.Equal(t, "28ebc047741ac19f2ff459d4ddb8f0c688415650edb103a22e4c66350dbcaff9", k.Account()) -} diff --git a/core/services/keystore/keys/tonkey/export.go b/core/services/keystore/keys/tonkey/export.go deleted file mode 100644 index 11eca35a77f..00000000000 --- a/core/services/keystore/keys/tonkey/export.go +++ /dev/null @@ -1,49 +0,0 @@ -package tonkey - -import ( - "encoding/hex" - - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "TON" - -// FromEncryptedJSON gets key from json and password -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - builder := func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - } - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - builder, - ) -} - -// ToEncryptedJSON returns encrypted JSON representing key -func (key Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) ([]byte, error) { - exporter := func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: hex.EncodeToString(key.pubKey), - Crypto: cryptoJSON, - } - } - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - exporter, - ) -} - -func adulteratedPassword(password string) string { - return "tonkey" + password -} diff --git a/core/services/keystore/keys/tonkey/export_test.go b/core/services/keystore/keys/tonkey/export_test.go deleted file mode 100644 index 384ccc30af3..00000000000 --- a/core/services/keystore/keys/tonkey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package tonkey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestTONKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return New() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/tonkey/key.go b/core/services/keystore/keys/tonkey/key.go deleted file mode 100644 index 962b123a971..00000000000 --- a/core/services/keystore/keys/tonkey/key.go +++ /dev/null @@ -1,141 +0,0 @@ -package tonkey - -import ( - "context" - "crypto" - "crypto/ed25519" - crypto_rand "crypto/rand" - "encoding/hex" - "fmt" - "io" - "time" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - - "github.com/xssnick/tonutils-go/address" - "github.com/xssnick/tonutils-go/ton/wallet" -) - -var ( - // defaultWalletVersion is the default wallet configuration used for Highload V3 wallet addresses. - defaultWalletVersion = wallet.ConfigHighloadV3{ - MessageTTL: 120, // 2 minutes TTL - MessageBuilder: func(ctx context.Context, subWalletId uint32) (id uint32, createdAt int64, err error) { - tm := time.Now().Unix() - 30 - return uint32(10000 + tm%(1<<23)), tm, nil - }, - } - - // defaultWorkchain is the default workchain ID for generating wallet addresses. - // revive:disable:var-declaration // explicit 0 for readiness purposes - defaultWorkchain int8 = 0 -) - -// Key represents a TON ed25519 key -type Key struct { - raw internal.Raw - signFn func(io.Reader, []byte, crypto.SignerOpts) ([]byte, error) - pubKey ed25519.PublicKey -} - -// KeyFor loads a Key from a raw seed -func KeyFor(raw internal.Raw) Key { - seed := internal.Bytes(raw) - privKey := ed25519.NewKeyFromSeed(seed) - pubKey := privKey.Public().(ed25519.PublicKey) - - return Key{ - raw: raw, - signFn: privKey.Sign, - pubKey: pubKey, - } -} - -// New creates a new Key using secure randomness -func New() (Key, error) { - reader := crypto_rand.Reader - return newFrom(reader) -} - -// newFrom creates a new Key from a reader -func newFrom(reader io.Reader) (Key, error) { - pub, priv, err := ed25519.GenerateKey(reader) - if err != nil { - return Key{}, err - } - rawSeed := priv.Seed() - return Key{ - raw: internal.NewRaw(rawSeed), - signFn: priv.Sign, - pubKey: pub, - }, nil -} - -// MustNewInsecure creates a Key or panics if an error occurs -func MustNewInsecure(reader io.Reader) Key { - key, err := newFrom(reader) - if err != nil { - panic(err) - } - return key -} - -// ID returns the hex-encoded public key (same as PublicKeyStr) -func (key Key) ID() string { - return key.PublicKeyStr() -} - -// PublicKeyStr returns the hex-encoded public key -func (key Key) PublicKeyStr() string { - return hex.EncodeToString(key.pubKey) -} - -// GetPublic returns the raw ed25519 public key bytes -func (key Key) GetPublic() ed25519.PublicKey { - return key.pubKey -} - -// Raw returns the private key seed -func (key Key) Raw() internal.Raw { - return key.raw -} - -// Sign signs a message using ed25519 -func (key Key) Sign(msg []byte) ([]byte, error) { - rng := crypto_rand.Reader - hash := crypto.Hash(0) - return key.signFn(rng, msg, hash) -} - -// PubkeyToAddressWith returns the TON wallet address for the given wallet version and workchain -func (key Key) PubkeyToAddressWith(version wallet.VersionConfig, workchain int8) (*address.Address, error) { - privKey := ed25519.NewKeyFromSeed(internal.Bytes(key.raw)) - w, err := wallet.FromPrivateKeyWithOptions(nil, privKey, version, wallet.WithWorkchain(workchain)) - if err != nil { - return nil, fmt.Errorf("failed to create wallet: %w", err) - } - return w.WalletAddress(), nil -} - -// PubkeyToAddress returns the wallet v3 address for workchain 0 -func (key Key) PubkeyToAddress() *address.Address { - addr, err := key.PubkeyToAddressWith(defaultWalletVersion, defaultWorkchain) - if err != nil { - panic(fmt.Errorf("failed to get address: %w", err)) - } - return addr -} - -// AddressBase64 returns the user-friendly version of the TON address -// https://docs.ton.org/v3/concepts/dive-into-ton/ton-blockchain/smart-contract-addresses#user-friendly-address -func (key Key) AddressBase64() string { - address := key.PubkeyToAddress() - return address.String() -} - -// RawAddress returns the raw version of the TON address, which includes the workchain -// https://docs.ton.org/v3/concepts/dive-into-ton/ton-blockchain/smart-contract-addresses#raw-address -func (key Key) RawAddress() string { - address := key.PubkeyToAddress() - return address.StringRaw() -} diff --git a/core/services/keystore/keys/tonkey/key_test.go b/core/services/keystore/keys/tonkey/key_test.go deleted file mode 100644 index e8e9ab20ec7..00000000000 --- a/core/services/keystore/keys/tonkey/key_test.go +++ /dev/null @@ -1,142 +0,0 @@ -package tonkey - -import ( - "crypto/ed25519" - "encoding/base64" - "encoding/hex" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/xssnick/tonutils-go/address" - "github.com/xssnick/tonutils-go/ton/wallet" -) - -func TestTONKey(t *testing.T) { - t.Run("Generate new key and verify its components", func(t *testing.T) { - // Generate a new key - key, err := New() - require.NoError(t, err, "Failed to generate new TONKey") - - // Verify key components - assert.NotNil(t, key.pubKey, "Public key should not be nil") - assert.NotNil(t, key.raw, "Private key should not be nil") - - addressBase64 := key.AddressBase64() - - assert.Len(t, addressBase64, 48, "Address in base64 should be 48 chars") - - decodedAddress, err := base64.RawURLEncoding.DecodeString(addressBase64) - if err != nil { - require.NoError(t, err, "Failed to decode addressBase64") - } - - assert.Len(t, decodedAddress, 36, "Decoded address should be 36 bytes") - }) - - t.Run("Generate new key and verify its components", func(t *testing.T) { - // Generate a new key - key, err := New() - require.NoError(t, err, "Failed to generate new TONKey") - - // Verify key components - assert.NotNil(t, key.pubKey, "Public key should not be nil") - assert.NotNil(t, key.raw, "Private key should not be nil") - }) - - t.Run("Signature is valid and verifiable", func(t *testing.T) { - key, err := New() - require.NoError(t, err) - - msg := []byte("test message") - sig, err := key.Sign(msg) - require.NoError(t, err) - - valid := ed25519.Verify(key.GetPublic(), msg, sig) - assert.True(t, valid, "Signature should be valid") - }) - - t.Run("Public key string encoding is consistent", func(t *testing.T) { - key, err := New() - require.NoError(t, err) - - pubKeyStr := key.PublicKeyStr() - decoded, err := hex.DecodeString(pubKeyStr) - require.NoError(t, err) - - assert.Equal(t, []byte(key.GetPublic()), decoded, "Decoded public key should match original") - }) - - t.Run("MustNewInsecure should not panic on valid reader", func(t *testing.T) { - assert.NotPanics(t, func() { - MustNewInsecure(strings.NewReader("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345")) // 64 bytes - }) - }) - - t.Run("Custom wallet version and workchain gives valid address", func(t *testing.T) { - key, err := New() - require.NoError(t, err) - - addr, err := key.PubkeyToAddressWith(wallet.V4R1, -1) - require.NoError(t, err) - assert.NotNil(t, addr) - - // Check that the base64 address is decodable and has expected length - decoded, err := base64.RawURLEncoding.DecodeString(addr.String()) - require.NoError(t, err, "base64 address should be valid base64") - assert.Len(t, decoded, 36, "Decoded address should be 36 bytes") - }) - - t.Run("Same key produces different addresses for different wallet versions and workchains", func(t *testing.T) { - key, err := New() - require.NoError(t, err) - - addrV3WC0, err := key.PubkeyToAddressWith(wallet.V3, 0) - require.NoError(t, err) - - addrV4WC0, err := key.PubkeyToAddressWith(wallet.V4R1, 0) - require.NoError(t, err) - - addrV3WC1, err := key.PubkeyToAddressWith(wallet.V3, 1) - require.NoError(t, err) - - addrV3WCMinus1, err := key.PubkeyToAddressWith(wallet.V3, -1) - require.NoError(t, err) - - // Assert addresses are all different - assert.NotEqual(t, addrV3WC0.String(), addrV4WC0.String(), "V3 and V4 addresses should differ") - assert.NotEqual(t, addrV3WC0.String(), addrV3WC1.String(), "Workchain 0 and 1 addresses should differ") - assert.NotEqual(t, addrV3WC0.String(), addrV3WCMinus1.String(), "Workchain 0 and -1 addresses should differ") - }) - - t.Run("RawAddress returns correct non-base64 address", func(t *testing.T) { - key, err := New() - require.NoError(t, err) - - rawAddress := key.RawAddress() - addressBase64 := key.AddressBase64() - - assert.NotEmpty(t, rawAddress, "Raw address should not be empty") - assert.NotEqual(t, addressBase64, rawAddress, "Raw and base64 addresses should differ") - - // Parse raw address and validate - parsed, err := address.ParseRawAddr(rawAddress) - require.NoError(t, err, "Raw address should be parseable") - assert.Equal(t, rawAddress, parsed.StringRaw(), "Parsed raw address should match original") - - // Default workchain is 0 - assert.True(t, strings.HasPrefix(rawAddress, "0:"), "Expected raw address to start with '0:' for default workchain") - }) - - t.Run("KeyFor and Raw produce consistent keys", func(t *testing.T) { - key1, err := New() - require.NoError(t, err) - - raw := key1.Raw() - key2 := KeyFor(raw) - - assert.Equal(t, key1.PublicKeyStr(), key2.PublicKeyStr(), "Restored key should have same public key") - assert.Equal(t, key1.AddressBase64(), key2.AddressBase64(), "Restored key should have same address") - }) -} diff --git a/core/services/keystore/keys/tronkey/account.go b/core/services/keystore/keys/tronkey/account.go deleted file mode 100644 index 9c90422d2a7..00000000000 --- a/core/services/keystore/keys/tronkey/account.go +++ /dev/null @@ -1,178 +0,0 @@ -package tronkey - -import ( - "crypto/ecdsa" - "crypto/sha256" - "encoding/hex" - "errors" - "fmt" - "math/big" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/mr-tron/base58" -) - -// Extracted from go-tron sdk: https://github.com/fbsobreira/gotron-sdk - -const ( - // HashLength is the expected length of the hash - HashLength = 32 - // AddressLengthBase58 is the expected length of the address in base58format - AddressLengthBase58 = 34 - // Tron Address Prefix - prefixMainnet = 0x41 - // TronBytePrefix is the hex prefix to address - TronBytePrefix = byte(prefixMainnet) - // Tron address should have 21 bytes (20 bytes + 1 byte prefix) - AddressLength = 21 -) - -// Address represents the 21 byte address of an Tron account. -type Address [AddressLength]byte - -// Bytes get bytes from address -func (a Address) Bytes() []byte { - return a[:] -} - -// Hex get bytes from address in string -func (a Address) Hex() string { - return BytesToHexString(a[:]) -} - -// HexToAddress returns Address with byte values of s. -func HexToAddress(s string) (Address, error) { - addr, err := FromHex(s) - if err != nil { - return Address{}, err - } - // Check if the address starts with '41' and is 21 characters long - if len(addr) != AddressLength || addr[0] != prefixMainnet { - return Address{}, errors.New("invalid Tron address") - } - return Address(addr), nil -} - -// Base58ToAddress returns Address with byte values of s. -func Base58ToAddress(s string) (Address, error) { - addr, err := DecodeCheck(s) - if err != nil { - return Address{}, err - } - return Address(addr), nil -} - -// String implements fmt.Stringer. -// Returns the address as a base58 encoded string. -func (a Address) String() string { - if len(a) == 0 { - return "" - } - - if a[0] == 0 { - return new(big.Int).SetBytes(a.Bytes()).String() - } - return EncodeCheck(a.Bytes()) -} - -// PubkeyToAddress returns address from ecdsa public key -func PubkeyToAddress(p ecdsa.PublicKey) Address { - address := crypto.PubkeyToAddress(p) - - addressTron := make([]byte, 0) - addressTron = append(addressTron, TronBytePrefix) - addressTron = append(addressTron, address.Bytes()...) - return Address(addressTron) -} - -// BytesToHexString encodes bytes as a hex string. -func BytesToHexString(bytes []byte) string { - encode := make([]byte, len(bytes)*2) - hex.Encode(encode, bytes) - return "0x" + string(encode) -} - -// FromHex returns the bytes represented by the hexadecimal string s. -// s may be prefixed with "0x". -func FromHex(s string) ([]byte, error) { - if Has0xPrefix(s) { - s = s[2:] - } - if len(s)%2 == 1 { - s = "0" + s - } - return HexToBytes(s) -} - -// Has0xPrefix validates str begins with '0x' or '0X'. -func Has0xPrefix(str string) bool { - return len(str) >= 2 && str[0] == '0' && (str[1] == 'x' || str[1] == 'X') -} - -// HexToBytes returns the bytes represented by the hexadecimal string str. -func HexToBytes(str string) ([]byte, error) { - return hex.DecodeString(str) -} - -func Encode(input []byte) string { - return base58.Encode(input) -} - -func EncodeCheck(input []byte) string { - h256h0 := sha256.New() - h256h0.Write(input) - h0 := h256h0.Sum(nil) - - h256h1 := sha256.New() - h256h1.Write(h0) - h1 := h256h1.Sum(nil) - - inputCheck := input - inputCheck = append(inputCheck, h1[:4]...) - - return Encode(inputCheck) -} - -func DecodeCheck(input string) ([]byte, error) { - decodeCheck, err := Decode(input) - if err != nil { - return nil, err - } - - if len(decodeCheck) < 4 { - return nil, errors.New("base58 check error") - } - - // tron address should should have 21 bytes (including prefix) + 4 checksum - if len(decodeCheck) != AddressLength+4 { - return nil, fmt.Errorf("invalid address length: %d", len(decodeCheck)) - } - - // check prefix - if decodeCheck[0] != prefixMainnet { - return nil, errors.New("invalid prefix") - } - - decodeData := decodeCheck[:len(decodeCheck)-4] - - h256h0 := sha256.New() - h256h0.Write(decodeData) - h0 := h256h0.Sum(nil) - - h256h1 := sha256.New() - h256h1.Write(h0) - h1 := h256h1.Sum(nil) - - if h1[0] == decodeCheck[len(decodeData)] && - h1[1] == decodeCheck[len(decodeData)+1] && - h1[2] == decodeCheck[len(decodeData)+2] && - h1[3] == decodeCheck[len(decodeData)+3] { - return decodeData, nil - } - - return nil, errors.New("base58 check error") -} - -func Decode(input string) ([]byte, error) { - return base58.Decode(input) -} diff --git a/core/services/keystore/keys/tronkey/account_test.go b/core/services/keystore/keys/tronkey/account_test.go deleted file mode 100644 index 9a92801bb13..00000000000 --- a/core/services/keystore/keys/tronkey/account_test.go +++ /dev/null @@ -1,177 +0,0 @@ -package tronkey - -import ( - "bytes" - "regexp" - "strings" - "testing" - - "github.com/stretchr/testify/require" -) - -func Test_DecodeBase58(t *testing.T) { - invalidAddresses := []string{ - "TronEnergyioE1Z3ukeRv38sYkv5Jn55bL", - "TronEnergyioNijNo8g3LF2ABKUAae6D2Z", - "TronEnergyio3ZMcXA5hSjrTxaioKGgqyr", - } - - validAddresses := []string{ - "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", - "TVj7RNVHy6thbM7BWdSe9G6gXwKhjhdNZS", - "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC", - } - - for _, addr := range invalidAddresses { - _, err := DecodeCheck(addr) - require.Error(t, err) - } - - for _, addr := range validAddresses { - _, err := DecodeCheck(addr) - require.NoError(t, err) - } -} - -func TestAddress(t *testing.T) { - t.Run("Valid Addresses", func(t *testing.T) { - validAddresses := []string{ - "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", - "TVj7RNVHy6thbM7BWdSe9G6gXwKhjhdNZS", - "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC", - } - - for _, addrStr := range validAddresses { - t.Run(addrStr, func(t *testing.T) { - addr, err := Base58ToAddress(addrStr) - require.NoError(t, err) - require.Equal(t, addrStr, addr.String()) - - decoded, err := DecodeCheck(addrStr) - require.NoError(t, err) - require.True(t, bytes.Equal(decoded, addr.Bytes())) - }) - } - }) - - t.Run("Invalid Addresses", func(t *testing.T) { - invalidAddresses := []string{ - "TronEnergyioE1Z3ukeRv38sYkv5Jn55bL", - "TronEnergyioNijNo8g3LF2ABKUAae6D2Z", - "TronEnergyio3ZMcXA5hSjrTxaioKGgqyr", - } - - for _, addrStr := range invalidAddresses { - t.Run(addrStr, func(t *testing.T) { - _, err := Base58ToAddress(addrStr) - require.Error(t, err) - - _, err = DecodeCheck(addrStr) - require.Error(t, err) - }) - } - }) - - t.Run("Address Conversion", func(t *testing.T) { - addrStr := "TSvT6Bg3siokv3dbdtt9o4oM1CTXmymGn1" - addr, err := Base58ToAddress(addrStr) - require.NoError(t, err) - - t.Run("To Bytes", func(t *testing.T) { - bytes := addr.Bytes() - require.Len(t, bytes, 21) - }) - - t.Run("To Hex", func(t *testing.T) { - hex := addr.Hex() - require.Equal(t, "0x", hex[:2]) - require.Len(t, hex, 44) - }) - }) - - t.Run("Address Validity", func(t *testing.T) { - t.Run("Valid Address", func(t *testing.T) { - addr, err := Base58ToAddress("TSvT6Bg3siokv3dbdtt9o4oM1CTXmymGn1") - require.NoError(t, err) - require.True(t, isValid(addr)) - }) - - t.Run("Zero Address", func(t *testing.T) { - addr := Address{} - require.False(t, isValid(addr)) - }) - }) -} - -func TestHexToAddress(t *testing.T) { - t.Run("Valid Hex Addresses", func(t *testing.T) { - validHexAddresses := []string{ - "41a614f803b6fd780986a42c78ec9c7f77e6ded13c", - "41b2a2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2", - "41c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", - } - - for _, hexStr := range validHexAddresses { - t.Run(hexStr, func(t *testing.T) { - addr, err := HexToAddress(hexStr) - require.NoError(t, err) - require.Equal(t, "0x"+hexStr, addr.Hex()) - }) - } - }) - - t.Run("Invalid Hex Addresses", func(t *testing.T) { - invalidHexAddresses := []string{ - "41a614f803b6fd780986a42c78ec9c7f77e6ded13", // Too short - "41b2a2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2e1b2", // Too long - "41g3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", // Invalid character 'g' - "c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3", // Missing prefix '41' - } - - for _, hexStr := range invalidHexAddresses { - t.Run(hexStr, func(t *testing.T) { - _, err := HexToAddress(hexStr) - require.Error(t, err) - }) - } - }) -} - -// Helper Functions for testing - -// isValid checks if the address is a valid TRON address -func isValid(a Address) bool { - // Check if it's a valid Base58 address - base58Str := a.String() - if isValidBase58Address(base58Str) { - return true - } - - // Check if it's a valid hex address - hexStr := a.Hex() - return isValidHexAddress(strings.TrimPrefix(hexStr, "0x")) -} - -// isValidBase58Address check if a string is a valid Base58 TRON address -func isValidBase58Address(address string) bool { - // Check if the address starts with 'T' and is 34 characters long - if len(address) != 34 || address[0] != 'T' { - return false - } - - // Check if the address contains only valid Base58 characters - validChars := regexp.MustCompile("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$") - return validChars.MatchString(address) -} - -// isValidHexAddressto check if a string is a valid hex TRON address -func isValidHexAddress(address string) bool { - // Check if the address starts with '41' and is 42 characters long - if len(address) != 42 || address[:2] != "41" { - return false - } - - // Check if the address contains only valid hexadecimal characters - validChars := regexp.MustCompile("^[0-9A-Fa-f]+$") - return validChars.MatchString(address[2:]) // Check the part after '41' -} diff --git a/core/services/keystore/keys/tronkey/export.go b/core/services/keystore/keys/tronkey/export.go deleted file mode 100644 index 70bc86087fc..00000000000 --- a/core/services/keystore/keys/tronkey/export.go +++ /dev/null @@ -1,45 +0,0 @@ -package tronkey - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "Tron" - -// FromEncryptedJSON gets key from json and password -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -// ToEncryptedJSON returns encrypted JSON representing key -func (key Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - key, - password, - scryptParams, - adulteratedPassword, - func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: key.PublicKeyStr(), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "tronkey" + password -} diff --git a/core/services/keystore/keys/tronkey/export_test.go b/core/services/keystore/keys/tronkey/export_test.go deleted file mode 100644 index 5e3e605ed34..00000000000 --- a/core/services/keystore/keys/tronkey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package tronkey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestTronKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return New() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/tronkey/key.go b/core/services/keystore/keys/tronkey/key.go deleted file mode 100644 index 6100fc57656..00000000000 --- a/core/services/keystore/keys/tronkey/key.go +++ /dev/null @@ -1,84 +0,0 @@ -package tronkey - -import ( - "crypto/ecdsa" - "crypto/rand" - "encoding/hex" - "io" - "math/big" - - "github.com/ethereum/go-ethereum/crypto" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -// Tron uses the same elliptic curve cryptography as Ethereum (ECDSA with secp256k1) -var curve = crypto.S256() - -// Key generates a public-private key pair from the raw private key -func KeyFor(raw internal.Raw) Key { - var privKey ecdsa.PrivateKey - d := big.NewInt(0).SetBytes(internal.Bytes(raw)) - privKey.Curve = curve - privKey.D = d - privKey.X, privKey.Y = curve.ScalarBaseMult(d.Bytes()) - return Key{ - raw: raw, - signFn: func(bytes []byte) ([]byte, error) { return crypto.Sign(bytes, &privKey) }, - pubKey: &privKey.PublicKey, - } -} - -type Key struct { - raw internal.Raw - signFn func([]byte) ([]byte, error) - - pubKey *ecdsa.PublicKey -} - -func New() (Key, error) { - return newFrom(rand.Reader) -} - -// MustNewInsecure return Key if no error -// This insecure function is used for testing purposes only -func MustNewInsecure(reader io.Reader) Key { - key, err := newFrom(reader) - if err != nil { - panic(err) - } - return key -} - -func newFrom(reader io.Reader) (Key, error) { - privKeyECDSA, err := ecdsa.GenerateKey(curve, reader) - if err != nil { - return Key{}, err - } - return Key{ - raw: internal.NewRaw(privKeyECDSA.D.Bytes()), - signFn: func(bytes []byte) ([]byte, error) { return crypto.Sign(bytes, privKeyECDSA) }, - pubKey: &privKeyECDSA.PublicKey, - }, nil -} - -func (key Key) ID() string { - return key.Base58Address() -} - -func (key Key) Raw() internal.Raw { return key.raw } - -// Sign is used to sign a message -func (key Key) Sign(msg []byte) ([]byte, error) { return key.signFn(msg) } - -// PublicKeyStr returns the public key as a hexadecimal string -func (key Key) PublicKeyStr() string { - pubKeyBytes := crypto.FromECDSAPub(key.pubKey) - return hex.EncodeToString(pubKeyBytes) -} - -// Base58Address returns the Tron address in Base58 format with checksum -func (key Key) Base58Address() string { - address := PubkeyToAddress(*key.pubKey) - return address.String() -} diff --git a/core/services/keystore/keys/tronkey/key_test.go b/core/services/keystore/keys/tronkey/key_test.go deleted file mode 100644 index 9ec74946f90..00000000000 --- a/core/services/keystore/keys/tronkey/key_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package tronkey - -import ( - "encoding/hex" - "testing" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestTronKeyNewKeyGeneration(t *testing.T) { - t.Run("Generate new key and verify its components", func(t *testing.T) { - // Generate a new key - key, err := New() - require.NoError(t, err, "Failed to generate new TronKey") - - // Verify key components - assert.NotNil(t, key.pubKey, "Public key should not be nil") - assert.NotNil(t, key.raw, "Private key should not be nil") - }) - - t.Run("Multiple key generations produce unique keys", func(t *testing.T) { - key1, err := New() - require.NoError(t, err, "Failed to generate first key") - - key2, err := New() - require.NoError(t, err, "Failed to generate second key") - - assert.NotEqual(t, key1.raw, key2.raw, "Generated private keys should be unique") - assert.NotEqual(t, key1.pubKey, key2.pubKey, "Generated public keys should be unique") - }) -} - -func TestKeyAddress(t *testing.T) { - t.Run("Known private key and expected address", func(t *testing.T) { - // Tests cases from https://developers.tron.network/docs/account - privateKeyHex := "b406adb115b43e103c7b1dc8b5931f63279a5b6b2cf7328638814c43171a2908" - expectedAddress := "TDdcf5iMDkB61oGM27TNak55eVX214thBG" - - privateKeyBytes, err := hex.DecodeString(privateKeyHex) - require.NoError(t, err, "Failed to decode private key hex") - - privateKey, err := crypto.ToECDSA(privateKeyBytes) - require.NoError(t, err, "Failed to convert private key to ECDSA") - - key := Key{pubKey: &privateKey.PublicKey} - - address := key.Base58Address() - require.Equal(t, expectedAddress, address, "Generated address does not match expected address") - }) - - t.Run("Generate new key and check address format", func(t *testing.T) { - newKey, err := New() - if err != nil { - t.Fatalf("Failed to generate new key: %v", err) - } - - newAddress := newKey.Base58Address() - isValid := isValidBase58Address(newAddress) - require.True(t, isValid, "Generated address is not valid") - }) -} diff --git a/core/services/keystore/keys/vrfkey/benchmark_vrf_validation_test.go b/core/services/keystore/keys/vrfkey/benchmark_vrf_validation_test.go deleted file mode 100644 index 6a699bb28d6..00000000000 --- a/core/services/keystore/keys/vrfkey/benchmark_vrf_validation_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package vrfkey - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/require" -) - -// Run with `go test -bench BenchmarkProofValidation` -func BenchmarkProofValidation(b *testing.B) { - key, err := NewV2() - require.NoError(b, err) - var proofs []Proof - for i := 0; b.Loop(); i++ { - p, err := key.GenerateProof(big.NewInt(int64(i))) - require.NoError(b, err, "failed to generate proof number %d", i) - proofs = append(proofs, p) - } - b.ResetTimer() - for i, p := range proofs { - isValid, err := p.VerifyVRFProof() - require.NoError(b, err, "failed to check proof number %d", i) - require.True(b, isValid, "proof number %d is invalid", i) - } -} diff --git a/core/services/keystore/keys/vrfkey/crypto.go b/core/services/keystore/keys/vrfkey/crypto.go deleted file mode 100644 index 29607dfc039..00000000000 --- a/core/services/keystore/keys/vrfkey/crypto.go +++ /dev/null @@ -1,187 +0,0 @@ -package vrfkey - -import ( - "errors" - "fmt" - "math/big" - - "github.com/ethereum/go-ethereum/common" - "go.dedis.ch/kyber/v3" - - bm "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" - "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" -) - -// This file contains golang re-implementations of functions on the VRF solidity -// contract. They are used to verify correct operation of those functions, and -// also to efficiently compute zInv off-chain, which makes computing the linear -// combination of c*gamma+s*hash onchain much more efficient. - -var ( - // FieldSize is number of elements in secp256k1's base field, i.e. GF(FieldSize) - FieldSize = mustParseBig( - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", - ) - Secp256k1Curve = &secp256k1.Secp256k1{} - Generator = Secp256k1Curve.Point().Base() - eulersCriterionPower = bm.Div(bm.Sub(FieldSize, bm.One), bm.Two) - sqrtPower = bm.Div(bm.Add(FieldSize, bm.One), bm.Four) - ErrCGammaEqualsSHash = errors.New("pick a different nonce; c*gamma = s*hash, with this one") - // hashToCurveHashPrefix is domain-separation tag for initial HashToCurve hash. - // Corresponds to HASH_TO_CURVE_HASH_PREFIX in VRF.sol. - hashToCurveHashPrefix = common.BigToHash(bm.One).Bytes() - // scalarFromCurveHashPrefix is a domain-separation tag for the hash taken in - // ScalarFromCurve. Corresponds to SCALAR_FROM_CURVE_POINTS_HASH_PREFIX in - // VRF.sol. - scalarFromCurveHashPrefix = common.BigToHash(bm.Two).Bytes() - // RandomOutputHashPrefix is a domain-separation tag for the hash used to - // compute the final VRF random output - RandomOutputHashPrefix = common.BigToHash(bm.Three).Bytes() -) - -type fieldElt = *big.Int - -// neg(f) is the negation of f in the base field -func neg(f fieldElt) fieldElt { return bm.Sub(FieldSize, f) } - -// projectiveSub(x1, z1, x2, z2) is the projective coordinates of x1/z1 - x2/z2 -func projectiveSub(x1, z1, x2, z2 fieldElt) (fieldElt, fieldElt) { - num1 := bm.Mul(z2, x1) - num2 := neg(bm.Mul(z1, x2)) - return bm.Mod(bm.Add(num1, num2), FieldSize), bm.Mod(bm.Mul(z1, z2), FieldSize) -} - -// projectiveMul(x1, z1, x2, z2) is projective coordinates of (x1/z1)×(x2/z2) -func projectiveMul(x1, z1, x2, z2 fieldElt) (fieldElt, fieldElt) { - return bm.Mul(x1, x2), bm.Mul(z1, z2) -} - -// ProjectiveECAdd(px, py, qx, qy) duplicates the calculation in projective -// coordinates of VRF.sol#projectiveECAdd, so we can reliably get the -// denominator (i.e, z) -func ProjectiveECAdd(p, q kyber.Point) (x, y, z fieldElt) { - px, py := secp256k1.Coordinates(p) - qx, qy := secp256k1.Coordinates(q) - pz, qz := bm.One, bm.One - lx := bm.Sub(qy, py) - lz := bm.Sub(qx, px) - - sx, dx := projectiveMul(lx, lz, lx, lz) - sx, dx = projectiveSub(sx, dx, px, pz) - sx, dx = projectiveSub(sx, dx, qx, qz) - - sy, dy := projectiveSub(px, pz, sx, dx) - sy, dy = projectiveMul(sy, dy, lx, lz) - sy, dy = projectiveSub(sy, dy, py, pz) - - var sz fieldElt - if dx != dy { - sx = bm.Mul(sx, dy) - sy = bm.Mul(sy, dx) - sz = bm.Mul(dx, dy) - } else { - sz = dx - } - return bm.Mod(sx, FieldSize), bm.Mod(sy, FieldSize), bm.Mod(sz, FieldSize) -} - -// IsSquare returns true iff x = y^2 for some y in GF(p) -func IsSquare(x *big.Int) bool { - return bm.Equal(bm.One, bm.Exp(x, eulersCriterionPower, FieldSize)) -} - -// SquareRoot returns a s.t. a^2=x, as long as x is a square -func SquareRoot(x *big.Int) *big.Int { - return bm.Exp(x, sqrtPower, FieldSize) -} - -// YSquared returns x^3+7 mod fieldSize, the right-hand side of the secp256k1 -// curve equation. -func YSquared(x *big.Int) *big.Int { - return bm.Mod(bm.Add(bm.Exp(x, bm.Three, FieldSize), bm.Seven), FieldSize) -} - -// IsCurveXOrdinate returns true iff there is y s.t. y^2=x^3+7 -func IsCurveXOrdinate(x *big.Int) bool { - return IsSquare(YSquared(x)) -} - -// FieldHash hashes xs uniformly into {0, ..., fieldSize-1}. msg is assumed to -// already be a 256-bit hash -func FieldHash(msg []byte) *big.Int { - rv := utils.MustHash(string(msg)).Big() - // Hash recursively until rv < q. P(success per iteration) >= 0.5, so - // number of extra hashes is geometrically distributed, with mean < 1. - for rv.Cmp(FieldSize) >= 0 { - rv = utils.MustHash(string(common.BigToHash(rv).Bytes())).Big() - } - return rv -} - -// linearCombination returns c*p1+s*p2 -func linearCombination(c *big.Int, p1 kyber.Point, - s *big.Int, p2 kyber.Point) kyber.Point { - return Secp256k1Curve.Point().Add( - Secp256k1Curve.Point().Mul(secp256k1.IntToScalar(c), p1), - Secp256k1Curve.Point().Mul(secp256k1.IntToScalar(s), p2)) -} - -// checkCGammaNotEqualToSHash checks c*gamma ≠ s*hash, as required by solidity -// verifier -func checkCGammaNotEqualToSHash(c *big.Int, gamma kyber.Point, s *big.Int, - hash kyber.Point) error { - cGamma := Secp256k1Curve.Point().Mul(secp256k1.IntToScalar(c), gamma) - sHash := Secp256k1Curve.Point().Mul(secp256k1.IntToScalar(s), hash) - if cGamma.Equal(sHash) { - return ErrCGammaEqualsSHash - } - return nil -} - -// HashToCurve is a cryptographic hash function which outputs a secp256k1 point, -// or an error. It passes each candidate x ordinate to ordinates function. -func HashToCurve(p kyber.Point, input *big.Int, ordinates func(x *big.Int), -) (kyber.Point, error) { - if !secp256k1.ValidPublicKey(p) || input.BitLen() > 256 || input.Cmp(bm.Zero) < 0 { - return nil, errors.New("bad input to vrf.HashToCurve") - } - x := FieldHash(append(hashToCurveHashPrefix, append(secp256k1.LongMarshal(p), - utils.Uint256ToBytes32(input)...)...)) - ordinates(x) - for !IsCurveXOrdinate(x) { // Hash recursively until x^3+7 is a square - x.Set(FieldHash(common.BigToHash(x).Bytes())) - ordinates(x) - } - y := SquareRoot(YSquared(x)) - rv := secp256k1.SetCoordinates(x, y) - if bm.Equal(bm.I().Mod(y, bm.Two), bm.One) { // Negate response if y odd - rv = rv.Neg(rv) - } - return rv, nil -} - -// ScalarFromCurve returns a hash for the curve points. Corresponds to the -// hash computed in VRF.sol#ScalarFromCurvePoints -func ScalarFromCurvePoints( - hash, pk, gamma kyber.Point, uWitness [20]byte, v kyber.Point) *big.Int { - if !secp256k1.ValidPublicKey(hash) || !secp256k1.ValidPublicKey(pk) || !secp256k1.ValidPublicKey(gamma) || !secp256k1.ValidPublicKey(v) { - panic("bad arguments to vrf.ScalarFromCurvePoints") - } - // msg will contain abi.encodePacked(hash, pk, gamma, v, uWitness) - msg := scalarFromCurveHashPrefix - for _, p := range []kyber.Point{hash, pk, gamma, v} { - msg = append(msg, secp256k1.LongMarshal(p)...) - } - msg = append(msg, uWitness[:]...) - return bm.I().SetBytes(utils.MustHash(string(msg)).Bytes()) -} - -func mustParseBig(hx string) *big.Int { - n, err := hex.ParseBig(hx) - if err != nil { - panic(fmt.Errorf(`failed to convert "%s" as hex to big.Int`, hx)) - } - return n -} diff --git a/core/services/keystore/keys/vrfkey/crypto_test.go b/core/services/keystore/keys/vrfkey/crypto_test.go deleted file mode 100644 index 2cf7092b03c..00000000000 --- a/core/services/keystore/keys/vrfkey/crypto_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package vrfkey - -import ( - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - - bm "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" -) - -func TestVRF_IsSquare(t *testing.T) { - assert.True(t, IsSquare(bm.Four)) - minusOneModP := bm.I().Sub(FieldSize, bm.One) - assert.False(t, IsSquare(minusOneModP)) -} - -func TestVRF_SquareRoot(t *testing.T) { - assert.Equal(t, bm.Two, SquareRoot(bm.Four)) -} - -func TestVRF_YSquared(t *testing.T) { - assert.Equal(t, bm.Add(bm.Mul(bm.Two, bm.Mul(bm.Two, bm.Two)), bm.Seven), YSquared(bm.Two)) // 2³+7 -} - -func TestVRF_IsCurveXOrdinate(t *testing.T) { - assert.True(t, IsCurveXOrdinate(big.NewInt(1))) - assert.False(t, IsCurveXOrdinate(big.NewInt(5))) -} diff --git a/core/services/keystore/keys/vrfkey/export.go b/core/services/keystore/keys/vrfkey/export.go deleted file mode 100644 index 4ed9d601b4c..00000000000 --- a/core/services/keystore/keys/vrfkey/export.go +++ /dev/null @@ -1,86 +0,0 @@ -package vrfkey - -import ( - "crypto/ecdsa" - "encoding/json" - - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/google/uuid" - "github.com/pkg/errors" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" -) - -func FromEncryptedJSON(keyJSON []byte, password string) (KeyV2, error) { - var export EncryptedVRFKeyExport - if err := json.Unmarshal(keyJSON, &export); err != nil { - return KeyV2{}, err - } - - // NOTE: We do this shuffle to an anonymous struct - // solely to add a throwaway UUID, so we can leverage - // the keystore.DecryptKey from the geth which requires it - // as of 1.10.0. - keyJSON, err := json.Marshal(struct { - Address string `json:"address"` - Crypto keystore.CryptoJSON `json:"crypto"` - Version int `json:"version"` - Id string `json:"id"` - }{ - Address: export.VRFKey.Address, - Crypto: export.VRFKey.Crypto, - Version: export.VRFKey.Version, - Id: uuid.New().String(), - }) - if err != nil { - return KeyV2{}, errors.Wrapf(err, "while marshaling key for decryption") - } - - gethKey, err := keystore.DecryptKey(keyJSON, adulteratedPassword(password)) - if err != nil { - return KeyV2{}, errors.Wrapf(err, "could not decrypt VRF key %s", export.PublicKey.String()) - } - - key := KeyFor(internal.NewRaw(gethKey.PrivateKey.D.Bytes())) - return key, nil -} - -type EncryptedVRFKeyExport struct { - PublicKey secp256k1.PublicKey `json:"PublicKey"` - VRFKey gethKeyStruct `json:"vrf_key"` -} - -func (key KeyV2) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - cryptoJSON, err := keystore.EncryptKey(key.toGethKey(), adulteratedPassword(password), scryptParams.N, scryptParams.P) - if err != nil { - return nil, errors.Wrapf(err, "failed to encrypt key %s", key.ID()) - } - var gethKey gethKeyStruct - err = json.Unmarshal(cryptoJSON, &gethKey) - if err != nil { - return nil, errors.Wrapf(err, "failed to unmarshal key %s", key.ID()) - } - encryptedOCRKExport := EncryptedVRFKeyExport{ - PublicKey: key.PublicKey, - VRFKey: gethKey, - } - return json.Marshal(encryptedOCRKExport) -} - -func (key KeyV2) toGethKey() *keystore.Key { - return &keystore.Key{ - Address: key.PublicKey.Address(), - PrivateKey: &ecdsa.PrivateKey{D: secp256k1.ToInt(*key.k)}, - } -} - -// passwordPrefix is added to the beginning of the passwords for -// EncryptedVRFKey's, so that VRF keys can't casually be used as ethereum -// keys, and vice-versa. If you want to do that, DON'T. -var passwordPrefix = "don't mix VRF and Ethereum keys!" - -func adulteratedPassword(password string) string { - return passwordPrefix + password -} diff --git a/core/services/keystore/keys/vrfkey/export_test.go b/core/services/keystore/keys/vrfkey/export_test.go deleted file mode 100644 index c262853c584..00000000000 --- a/core/services/keystore/keys/vrfkey/export_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package vrfkey - -import ( - "testing" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" -) - -func TestVRFKeys_ExportImport(t *testing.T) { - keys.RunKeyExportImportTestcase(t, createKey, decryptKey) -} - -func createKey() (keys.KeyType, error) { - return NewV2() -} - -func decryptKey(keyJSON []byte, password string) (keys.KeyType, error) { - return FromEncryptedJSON(keyJSON, password) -} diff --git a/core/services/keystore/keys/vrfkey/key_v2.go b/core/services/keystore/keys/vrfkey/key_v2.go deleted file mode 100644 index e0cecc0ccb8..00000000000 --- a/core/services/keystore/keys/vrfkey/key_v2.go +++ /dev/null @@ -1,153 +0,0 @@ -package vrfkey - -import ( - "crypto/rand" - "fmt" - "math/big" - - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/pkg/errors" - "go.dedis.ch/kyber/v3" - - bm "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - "github.com/smartcontractkit/chainlink-evm/pkg/utils" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" -) - -var suite = secp256k1.NewBlakeKeccackSecp256k1() - -func KeyFor(raw internal.Raw) KeyV2 { - rawKeyInt := new(big.Int).SetBytes(internal.Bytes(raw)) - k := secp256k1.IntToScalar(rawKeyInt) - key, err := keyFromScalar(k) - if err != nil { - panic(err) - } - return key -} - -var _ fmt.GoStringer = &KeyV2{} - -type KeyV2 struct { - k *kyber.Scalar - PublicKey secp256k1.PublicKey -} - -func NewV2() (KeyV2, error) { - k := suite.Scalar().Pick(suite.RandomStream()) - return keyFromScalar(k) -} - -func MustNewV2XXXTestingOnly(k *big.Int) KeyV2 { - rv, err := keyFromScalar(secp256k1.IntToScalar(k)) - if err != nil { - panic(err) - } - return rv -} - -func (key KeyV2) ID() string { - return hexutil.Encode(key.PublicKey[:]) -} - -func (key KeyV2) Raw() internal.Raw { - return internal.NewRaw(secp256k1.ToInt(*key.k).Bytes()) -} - -// GenerateProofWithNonce allows external nonce generation for testing purposes -// -// As with signatures, using nonces which are in any way predictable to an -// adversary will leak your secret key! Most people should use GenerateProof -// instead. -func (key KeyV2) GenerateProofWithNonce(seed, nonce *big.Int) (Proof, error) { - secretKey := secp256k1.ScalarToHash(*key.k).Big() - if !secp256k1.RepresentsScalar(secretKey) || seed.BitLen() > 256 { - return Proof{}, errors.New("badly-formatted key or seed") - } - skAsScalar := secp256k1.IntToScalar(secretKey) - publicKey := Secp256k1Curve.Point().Mul(skAsScalar, nil) - h, err := HashToCurve(publicKey, seed, func(*big.Int) {}) - if err != nil { - return Proof{}, errors.Wrap(err, "vrf.makeProof#HashToCurve") - } - gamma := Secp256k1Curve.Point().Mul(skAsScalar, h) - sm := secp256k1.IntToScalar(nonce) - u := Secp256k1Curve.Point().Mul(sm, Generator) - uWitness := secp256k1.EthereumAddress(u) - v := Secp256k1Curve.Point().Mul(sm, h) - c := ScalarFromCurvePoints(h, publicKey, gamma, uWitness, v) - // (m - c*secretKey) % GroupOrder - s := bm.Mod(bm.Sub(nonce, bm.Mul(c, secretKey)), secp256k1.GroupOrder) - if e := checkCGammaNotEqualToSHash(c, gamma, s, h); e != nil { - return Proof{}, e - } - outputHash := utils.MustHash(string(append(RandomOutputHashPrefix, - secp256k1.LongMarshal(gamma)...))) - rv := Proof{ - PublicKey: publicKey, - Gamma: gamma, - C: c, - S: s, - Seed: seed, - Output: outputHash.Big(), - } - valid, err := rv.VerifyVRFProof() - if !valid || err != nil { - panic("constructed invalid proof") - } - return rv, nil -} - -// GenerateProof returns gamma, plus proof that gamma was constructed from seed -// as mandated from the given secretKey, with public key secretKey*Generator -// -// secretKey and seed must be less than secp256k1 group order. (Without this -// constraint on the seed, the samples and the possible public keys would -// deviate very slightly from uniform distribution.) -func (key KeyV2) GenerateProof(seed *big.Int) (Proof, error) { - for { - nonce, err := rand.Int(rand.Reader, secp256k1.GroupOrder) - if err != nil { - return Proof{}, err - } - proof, err := key.GenerateProofWithNonce(seed, nonce) - switch { - case errors.Is(err, ErrCGammaEqualsSHash): - // This is cryptographically impossible, but if it were ever to happen, we - // should try again with a different nonce. - continue - case err != nil: // Any other error indicates failure - return Proof{}, err - default: - return proof, err // err should be nil - } - } -} - -func (key KeyV2) String() string { - return fmt.Sprintf("VRFKeyV2{PublicKey: %s}", key.PublicKey) -} - -func (key KeyV2) GoString() string { - return key.String() -} - -func keyFromScalar(k kyber.Scalar) (KeyV2, error) { - rawPublicKey, err := secp256k1.ScalarToPublicPoint(k).MarshalBinary() - if err != nil { - return KeyV2{}, errors.Wrapf(err, "could not marshal public key") - } - if len(rawPublicKey) != secp256k1.CompressedPublicKeyLength { - return KeyV2{}, fmt.Errorf("public key %x has wrong length", rawPublicKey) - } - var publicKey secp256k1.PublicKey - if l := copy(publicKey[:], rawPublicKey); l != secp256k1.CompressedPublicKeyLength { - panic(errors.New("failed to copy correct length in serialized public key")) - } - return KeyV2{ - k: &k, - PublicKey: publicKey, - }, nil -} diff --git a/core/services/keystore/keys/vrfkey/key_v2_test.go b/core/services/keystore/keys/vrfkey/key_v2_test.go deleted file mode 100644 index c4fa6097d00..00000000000 --- a/core/services/keystore/keys/vrfkey/key_v2_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package vrfkey - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" -) - -func TestVRFKeys_KeyV2(t *testing.T) { - k, err := NewV2() - require.NoError(t, err) - - assert.Equal(t, hexutil.Encode(k.PublicKey[:]), k.ID()) - assert.Equal(t, internal.NewRaw(secp256k1.ToInt(*k.k).Bytes()), k.Raw()) - - t.Run("generates proof", func(t *testing.T) { - p, err := k.GenerateProof(big.NewInt(1)) - - assert.NotZero(t, p) - assert.NoError(t, err) - }) -} diff --git a/core/services/keystore/keys/vrfkey/models.go b/core/services/keystore/keys/vrfkey/models.go deleted file mode 100644 index 23c484a9a4e..00000000000 --- a/core/services/keystore/keys/vrfkey/models.go +++ /dev/null @@ -1,73 +0,0 @@ -package vrfkey - -import ( - "database/sql/driver" - "encoding/json" - "fmt" - "os" - "time" - - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/pkg/errors" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" - "github.com/smartcontractkit/chainlink/v2/core/utils" -) - -// EncryptedVRFKey contains encrypted private key to be serialized to DB -// -// We could re-use geth's key handling, here, but this makes it much harder to -// misuse VRF proving keys as ethereum keys or vice versa. -type EncryptedVRFKey struct { - PublicKey secp256k1.PublicKey - VRFKey gethKeyStruct `json:"vrf_key"` - CreatedAt time.Time `json:"-"` - UpdatedAt time.Time `json:"-"` - DeletedAt *time.Time `json:"-"` -} - -// JSON returns the JSON representation of e, or errors -func (e *EncryptedVRFKey) JSON() ([]byte, error) { - keyJSON, err := json.Marshal(e) - if err != nil { - return nil, errors.Wrapf(err, "could not marshal encrypted key to JSON") - } - return keyJSON, nil -} - -// WriteToDisk writes the JSON representation of e to given file path, and -// ensures the file has appropriate access permissions -func (e *EncryptedVRFKey) WriteToDisk(path string) error { - keyJSON, err := e.JSON() - if err != nil { - return errors.Wrapf(err, "while marshaling key to save to %s", path) - } - userReadWriteOtherNoAccess := os.FileMode(0600) - return utils.WriteFileWithMaxPerms(path, keyJSON, userReadWriteOtherNoAccess) -} - -// Copied from go-ethereum/accounts/keystore/key.go's encryptedKeyJSONV3 -type gethKeyStruct struct { - Address string `json:"address"` - Crypto keystore.CryptoJSON `json:"crypto"` - Version int `json:"version"` -} - -func (k gethKeyStruct) Value() (driver.Value, error) { - return json.Marshal(&k) -} - -func (k *gethKeyStruct) Scan(value any) error { - var toUnmarshal []byte - switch s := value.(type) { - case []byte: - toUnmarshal = s - case string: - toUnmarshal = []byte(s) - default: - return errors.Wrap( - fmt.Errorf("unable to convert %+v of type %T to gethKeyStruct", - value, value), "scan failure") - } - return json.Unmarshal(toUnmarshal, k) -} diff --git a/core/services/keystore/keys/vrfkey/models_test.go b/core/services/keystore/keys/vrfkey/models_test.go deleted file mode 100644 index e603e6aadae..00000000000 --- a/core/services/keystore/keys/vrfkey/models_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package vrfkey - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestVRFKeys_Models(t *testing.T) { - kv2, err := NewV2() - require.NoError(t, err) - k := EncryptedVRFKey{ - PublicKey: kv2.PublicKey, - VRFKey: gethKeyStruct{}, - } - - v, err := k.JSON() - assert.NotEmpty(t, v) - require.NoError(t, err) - - vrfk := gethKeyStruct{} - - v2, err := vrfk.Value() - require.NoError(t, err) - err = vrfk.Scan(v2) - require.NoError(t, err) - err = vrfk.Scan("") - require.Error(t, err) - err = vrfk.Scan(1) - require.Error(t, err) -} diff --git a/core/services/keystore/keys/vrfkey/proof.go b/core/services/keystore/keys/vrfkey/proof.go deleted file mode 100644 index c6a819b5ff7..00000000000 --- a/core/services/keystore/keys/vrfkey/proof.go +++ /dev/null @@ -1,67 +0,0 @@ -package vrfkey - -import ( - "errors" - "fmt" - "math/big" - - "go.dedis.ch/kyber/v3" - - bm "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" - "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" -) - -// Proof represents a proof that Gamma was constructed from the Seed -// according to the process mandated by the PublicKey. -// -// N.B.: The kyber.Point fields must contain secp256k1.secp256k1Point values, C, -// S and Seed must be secp256k1Point, and Output must be at -// most 256 bits. See Proof.WellFormed. -type Proof struct { - PublicKey kyber.Point // secp256k1 public key of private key used in proof - Gamma kyber.Point - C *big.Int - S *big.Int - Seed *big.Int // Seed input to verifiable random function - Output *big.Int // verifiable random function output;, uniform uint256 sample -} - -func (p *Proof) String() string { - return fmt.Sprintf( - "vrf.Proof{PublicKey: %s, Gamma: %s, C: %x, S: %x, Seed: %x, Output: %x}", - p.PublicKey, p.Gamma, p.C, p.S, p.Seed, p.Output) -} - -// WellFormed is true iff p's attributes satisfy basic domain checks -func (p *Proof) WellFormed() bool { - return (secp256k1.ValidPublicKey(p.PublicKey) && - secp256k1.ValidPublicKey(p.Gamma) && secp256k1.RepresentsScalar(p.C) && - secp256k1.RepresentsScalar(p.S) && p.Output.BitLen() <= 256) -} - -// VerifyProof is true iff gamma was generated in the mandated way from the -// given publicKey and seed, and no error was encountered -func (p *Proof) VerifyVRFProof() (bool, error) { - if !p.WellFormed() { - return false, errors.New("badly-formatted proof") - } - h, err := HashToCurve(p.PublicKey, p.Seed, func(*big.Int) {}) - if err != nil { - return false, err - } - err = checkCGammaNotEqualToSHash(p.C, p.Gamma, p.S, h) - if err != nil { - return false, errors.New("c*γ = s*hash (disallowed in solidity verifier)") - } - // publicKey = secretKey*Generator. See GenerateProof for u, v, m, s - // c*secretKey*Generator + (m - c*secretKey)*Generator = m*Generator = u - uPrime := linearCombination(p.C, p.PublicKey, p.S, Generator) - // c*secretKey*h + (m - c*secretKey)*h = m*h = v - vPrime := linearCombination(p.C, p.Gamma, p.S, h) - uWitness := secp256k1.EthereumAddress(uPrime) - cPrime := ScalarFromCurvePoints(h, p.PublicKey, p.Gamma, uWitness, vPrime) - output := utils.MustHash(string(append( - RandomOutputHashPrefix, secp256k1.LongMarshal(p.Gamma)...))) - return bm.Equal(p.C, cPrime) && bm.Equal(p.Output, output.Big()), nil -} diff --git a/core/services/keystore/keys/vrfkey/proof_test.go b/core/services/keystore/keys/vrfkey/proof_test.go deleted file mode 100644 index 0a6af4b088a..00000000000 --- a/core/services/keystore/keys/vrfkey/proof_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package vrfkey - -import ( - "fmt" - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestVRF_VerifyProof(t *testing.T) { - sk, err := NewV2() - require.NoError(t, err) - seed, nonce := big.NewInt(2), big.NewInt(3) - p, err := sk.GenerateProofWithNonce(seed, nonce) - require.NoError(t, err, "could not generate proof") - p.Seed = big.NewInt(0).Add(seed, big.NewInt(1)) - valid, err := p.VerifyVRFProof() - require.NoError(t, err, "could not validate proof") - assert.False(t, valid, "invalid proof was found valid") - assert.Equal(t, fmt.Sprintf( - "vrf.Proof{PublicKey: %s, Gamma: %s, C: %x, S: %x, Seed: %x, Output: %x}", - p.PublicKey, p.Gamma, p.C, p.S, p.Seed, p.Output), p.String()) -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/crypto_test.go b/core/services/keystore/keys/vrfkey/secp256k1/crypto_test.go deleted file mode 100644 index 475ca5991df..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/crypto_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package secp256k1 - -import ( - "math/rand" - "testing" -) - -// randomStream implements cipher.Stream, but with a deterministic output. -type randomStream rand.Rand - -// NewStream returns a randomStream seeded from seed, for deterministic -// randomness in tests of random outputs, and for small property-based tests. -// -// This API is deliberately awkward to prevent it from being used outside of -// tests. -// -// The testing framework runs the tests in a file in series, unless you -// explicitly request otherwise with testing.T.Parallel(). So one such stream -// per file is enough, most of the time. -func NewStream(t *testing.T, seed int64) *randomStream { - return (*randomStream)(rand.New(rand.NewSource(seed))) -} - -// XORKeyStream dumps the output from a math/rand PRNG on dst. -// -// It gives no consideration for the contents of src, and is named so -// misleadingly purely to satisfy the cipher.Stream interface. -func (s *randomStream) XORKeyStream(dst, src []byte) { - (*rand.Rand)(s).Read(dst) -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/curve.go b/core/services/keystore/keys/vrfkey/secp256k1/curve.go deleted file mode 100644 index 70187e68738..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/curve.go +++ /dev/null @@ -1,46 +0,0 @@ -// Package secp256k1 is an implementation of the kyber.{Group,Point,Scalar} -// ////////////////////////////////////////////////////////////////////////////// -// -// XXX: Do not use in production until this code has been audited. -// -// ////////////////////////////////////////////////////////////////////////////// -// interfaces, based on btcd/btcec and kyber/group/mod -// -// XXX: NOT CONSTANT TIME! -package secp256k1 - -import ( - "math/big" - - secp256k1BTCD "github.com/btcsuite/btcd/btcec/v2" - - "go.dedis.ch/kyber/v3" -) - -// Secp256k1 represents the secp256k1 group. -// There are no parameters and no initialization is required -// because it supports only this one specific curve. -type Secp256k1 struct{} - -// s256 is the btcec representation of secp256k1. -var s256 *secp256k1BTCD.KoblitzCurve = secp256k1BTCD.S256() - -// String returns the name of the curve -func (*Secp256k1) String() string { return "Secp256k1" } - -var egScalar kyber.Scalar = newScalar(big.NewInt(0)) -var egPoint kyber.Point = &secp256k1Point{newFieldZero(), newFieldZero()} - -// ScalarLen returns the length of a marshalled Scalar -func (*Secp256k1) ScalarLen() int { return egScalar.MarshalSize() } - -// Scalar creates a new Scalar for the prime-order group on the secp256k1 curve -func (*Secp256k1) Scalar() kyber.Scalar { return newScalar(big.NewInt(0)) } - -// PointLen returns the length of a marshalled Point -func (*Secp256k1) PointLen() int { return egPoint.MarshalSize() } - -// Point returns a new secp256k1 point -func (*Secp256k1) Point() kyber.Point { - return &secp256k1Point{newFieldZero(), newFieldZero()} -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/curve_test.go b/core/services/keystore/keys/vrfkey/secp256k1/curve_test.go deleted file mode 100644 index 325bae20d41..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/curve_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package secp256k1 - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -var group = &Secp256k1{} - -func TestSecp256k1_String(t *testing.T) { - require.Equal(t, "Secp256k1", group.String()) -} - -func TestSecp256k1_Constructors(t *testing.T) { - require.Equal(t, 32, group.ScalarLen()) - require.Equal(t, ToInt(group.Scalar()), bigZero) - require.Equal(t, 33, group.PointLen()) - require.Equal(t, &secp256k1Point{fieldZero, fieldZero}, group.Point()) -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/field.go b/core/services/keystore/keys/vrfkey/secp256k1/field.go deleted file mode 100644 index bf9652e5dbd..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/field.go +++ /dev/null @@ -1,169 +0,0 @@ -// Package secp256k1 is an implementation of the kyber.{Group,Point,Scalar} -// ////////////////////////////////////////////////////////////////////////////// -// -// XXX: Do not use in production until this code has been audited. -// -// ////////////////////////////////////////////////////////////////////////////// -// interfaces, based on btcd/btcec and kyber/group/mod -// -// XXX: NOT CONSTANT TIME! -package secp256k1 - -// Arithmetic operations in the base field of secp256k1, i.e. ℤ/qℤ, where q is -// the base field characteristic. - -import ( - "crypto/cipher" - "fmt" - "math/big" - - "go.dedis.ch/kyber/v3/util/random" -) - -// q is the field characteristic (cardinality) of the secp256k1 base field. All -// arithmetic operations on the field are modulo this. -var q = s256.P - -type fieldElt big.Int - -// newFieldZero returns a newly allocated field element. -func newFieldZero() *fieldElt { return (*fieldElt)(big.NewInt(0)) } - -// Int returns f as a big.Int -func (f *fieldElt) int() *big.Int { return (*big.Int)(f) } - -// modQ reduces f's underlying big.Int modulo q, and returns it -func (f *fieldElt) modQ() *fieldElt { - if f.int().Cmp(q) != -1 || f.int().Cmp(bigZero) == -1 { - // f ∉ {0, ..., q-1}. Find the representative of f+qℤ in that set. - // - // Per Mod docstring, "Mod implements Euclidean modulus", meaning that after - // this, f will be the smallest non-negative representative of its - // equivalence class in ℤ/qℤ. TODO(alx): Make this faster - f.int().Mod(f.int(), q) - } - return f -} - -// This differs from SetInt below, in that it does not take a copy of v. -func fieldEltFromBigInt(v *big.Int) *fieldElt { return (*fieldElt)(v).modQ() } - -func fieldEltFromInt(v int64) *fieldElt { - return fieldEltFromBigInt(big.NewInt(v)).modQ() -} - -var fieldZero = fieldEltFromInt(0) -var bigZero = big.NewInt(0) - -// String returns the string representation of f -func (f *fieldElt) String() string { - return fmt.Sprintf("fieldElt{%x}", f.int()) -} - -// Equal returns true iff f=g, i.e. the backing big.Ints satisfy f ≡ g mod q -func (f *fieldElt) Equal(g *fieldElt) bool { - if f == (*fieldElt)(nil) && g == (*fieldElt)(nil) { - return true - } - if f == (*fieldElt)(nil) { // f is nil, g is not - return false - } - if g == (*fieldElt)(nil) { // g is nil, f is not - return false - } - return bigZero.Cmp(newFieldZero().Sub(f, g).modQ().int()) == 0 -} - -// Add sets f to the sum of a and b modulo q, and returns it. -func (f *fieldElt) Add(a, b *fieldElt) *fieldElt { - f.int().Add(a.int(), b.int()) - return f.modQ() -} - -// Sub sets f to a-b mod q, and returns it. -func (f *fieldElt) Sub(a, b *fieldElt) *fieldElt { - f.int().Sub(a.int(), b.int()) - return f.modQ() -} - -// Set sets f's value to v, and returns f. -func (f *fieldElt) Set(v *fieldElt) *fieldElt { - f.int().Set(v.int()) - return f.modQ() -} - -// SetInt sets f's value to v mod q, and returns f. -func (f *fieldElt) SetInt(v *big.Int) *fieldElt { - f.int().Set(v) - return f.modQ() -} - -// Pick samples uniformly from {0, ..., q-1}, assigns sample to f, and returns f -func (f *fieldElt) Pick(rand cipher.Stream) *fieldElt { - return f.SetInt(random.Int(q, rand)) // random.Int safe because q≅2²⁵⁶, q<2²⁵⁶ -} - -// Neg sets f to the negation of g modulo q, and returns it -func (f *fieldElt) Neg(g *fieldElt) *fieldElt { - f.int().Neg(g.int()) - return f.modQ() -} - -// Clone returns a new fieldElt, backed by a clone of f -func (f *fieldElt) Clone() *fieldElt { return newFieldZero().Set(f.modQ()) } - -// SetBytes sets f to the 32-byte big-endian value represented by buf, reduces -// it, and returns it. -func (f *fieldElt) SetBytes(buf [32]byte) *fieldElt { - f.int().SetBytes(buf[:]) - return f.modQ() -} - -// Bytes returns the 32-byte big-endian representation of f -func (f *fieldElt) Bytes() [32]byte { - bytes := f.modQ().int().Bytes() - if len(bytes) > 32 { - panic("field element longer than 256 bits") - } - var rv [32]byte - copy(rv[32-len(bytes):], bytes) // leftpad w zeros - return rv -} - -var two = big.NewInt(2) - -// square returns y² mod q -func fieldSquare(y *fieldElt) *fieldElt { - return fieldEltFromBigInt(newFieldZero().int().Exp(y.int(), two, q)) -} - -func i() *big.Int { return new(big.Int) } - -// sqrtPower is s.t. n^sqrtPower≡sqrt(n) mod q, if n has a root at all. See -// https://math.stackexchange.com/a/1816280, for instance -var sqrtPower = i().Rsh(i().Add(q, big.NewInt(1)), 2) // (q +1)/4 - -// maybeSqrtInField returns a square root of v, if it has any, else nil -func maybeSqrtInField(v *fieldElt) *fieldElt { - s := newFieldZero() - s.int().Exp(v.int(), sqrtPower, q) - if !fieldSquare(s).Equal(v) { - return nil - } - return s -} - -var three = big.NewInt(3) -var seven = fieldEltFromInt(7) - -// rightHandSide returns the RHS of the secp256k1 equation, x³+7 mod q, given x -func rightHandSide(x *fieldElt) *fieldElt { - xCubed := newFieldZero() - xCubed.int().Exp(x.int(), three, q) - return xCubed.Add(xCubed, seven) -} - -// isEven returns true if f is even, false otherwise -func (f *fieldElt) isEven() bool { - return big.NewInt(0).Mod(f.int(), two).Cmp(big.NewInt(0)) == 0 -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/field_test.go b/core/services/keystore/keys/vrfkey/secp256k1/field_test.go deleted file mode 100644 index a3b3a9085dd..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/field_test.go +++ /dev/null @@ -1,154 +0,0 @@ -package secp256k1 - -import ( - "encoding/hex" - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -var numFieldSamples = 10 - -var observedFieldElts map[string]bool - -func init() { - observedFieldElts = make(map[string]bool) -} - -// observedFieldElt ensures that novel scalars are being picked. -func observedFieldElt(t *testing.T, s *fieldElt) { - elt := s.Bytes() - data := hex.Dump(elt[:]) - require.False(t, observedFieldElts[data]) - observedFieldElts[data] = true -} - -func TestField_SetIntAndEqual(t *testing.T) { - tests := []int64{5, 67108864, 67108865, 4294967295} - g := newFieldZero() - for _, test := range tests { - f := fieldEltFromInt(test) - i := big.NewInt(test) - g.SetInt(i) - assert.Equal(t, f, g, - "different values obtained for same input, using "+ - "SetInt vs fieldEltFromInt") - i.Add(i, big.NewInt(1)) - assert.Equal(t, f, g, - "SetInt should take a copy of the backing big.Int") - } -} - -func TestField_String(t *testing.T) { - require.Equal(t, "fieldElt{0}", fieldZero.String()) -} - -func TestField_Equal(t *testing.T) { - require.True(t, (*fieldElt)(nil).Equal((*fieldElt)(nil))) - require.False(t, (*fieldElt)(nil).Equal(fieldZero)) - require.False(t, fieldZero.Equal((*fieldElt)(nil))) -} - -func TestField_Set(t *testing.T) { - f := fieldEltFromInt(1) - g := newFieldZero() - g.Set(f) - g.Add(g, fieldEltFromInt(1)) - assert.Equal(t, f, fieldEltFromInt(1), - "Set takes a copy of the backing big.Int") -} - -func TestFieldEltFromInt(t *testing.T) { - assert.Equal(t, fieldEltFromInt(1), // Also tests fieldElt.modQ - fieldEltFromBigInt(new(big.Int).Add(q, big.NewInt(1))), - "only one representation of a ℤ/qℤ element should be used") -} - -func TestField_SmokeTestPick(t *testing.T) { - f := newFieldZero() - f.Pick(randomStreamPoint) - observedFieldElt(t, f) - assert.Equal(t, 1, f.int().Cmp(big.NewInt(1000000000)), - "should be greater than 1000000000, with very high probability") -} - -func TestField_Neg(t *testing.T) { - f := newFieldZero() - for range numFieldSamples { - f.Pick(randomStreamPoint) - observedFieldElt(t, f) - g := f.Clone() - g.Neg(g) - require.True(t, g.Add(f, g).Equal(fieldZero), - "adding something to its negative should give zero: "+ - "failed with %s", f) - } -} - -func TestField_Sub(t *testing.T) { - f := newFieldZero() - for range numFieldSamples { - f.Pick(randomStreamPoint) - observedFieldElt(t, f) - require.True(t, f.Sub(f, f).Equal(fieldZero), - "subtracting something from itself should give zero: "+ - "failed with %s", f) - } -} - -func TestField_Clone(t *testing.T) { - f := fieldEltFromInt(1) - g := f.Clone() - h := f.Clone() - assert.Equal(t, f, g, "clone output does not equal original") - g.Add(f, f) - assert.Equal(t, f, h, "clone does not make a copy") -} - -func TestField_SetBytesAndBytes(t *testing.T) { - f := newFieldZero() - g := newFieldZero() - for range numFieldSamples { - f.Pick(randomStreamPoint) - observedFieldElt(t, f) - g.SetBytes(f.Bytes()) - require.True(t, g.Equal(f), - "roundtrip through serialization should give same "+ - "result back: failed with %s", f) - } -} - -func TestField_MaybeSquareRootInField(t *testing.T) { - f := newFieldZero() - minusOne := fieldEltFromInt(-1) - assert.Nil(t, maybeSqrtInField(minusOne), "-1 is not a square, in this field") - for range numFieldSamples { - f.Pick(randomStreamPoint) - observedFieldElt(t, f) - require.Equal(t, -1, f.int().Cmp(q), "picked larger value than q: %s", f) - require.NotEqual(t, -1, f.int().Cmp(big.NewInt(-1)), - "backing int must be non-negative") - s := fieldSquare(f) - g := maybeSqrtInField(s) - require.NotEqual(t, (*fieldElt)(nil), g) - ng := newFieldZero().Neg(g) - require.True(t, f.Equal(g) || f.Equal(ng), "squaring something and "+ - "taking the square root should give ± the original: failed with %s", f) - bigIntSqrt := newFieldZero() // Cross-check against big.ModSqrt - rv := bigIntSqrt.int().ModSqrt(s.int(), q) - require.NotNil(t, rv) - require.True(t, bigIntSqrt.Equal(g) || bigIntSqrt.Equal(ng)) - nonSquare := newFieldZero().Neg(s) - rv = bigIntSqrt.int().ModSqrt(nonSquare.int(), q) - require.Nil(t, rv, "ModSqrt indicates nonSquare is square") - require.Nil(t, maybeSqrtInField(nonSquare), "the negative of square "+ - "should not be a square") - } -} - -func TestField_RightHandSide(t *testing.T) { - assert.Equal(t, rightHandSide(fieldEltFromInt(1)), fieldEltFromInt(8)) - assert.Equal(t, rightHandSide(fieldEltFromInt(2)), fieldEltFromInt(15)) -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/point.go b/core/services/keystore/keys/vrfkey/secp256k1/point.go deleted file mode 100644 index cc3fb47b60d..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/point.go +++ /dev/null @@ -1,381 +0,0 @@ -// Package secp256k1 is an implementation of the kyber.{Group,Point,Scalar} -// ////////////////////////////////////////////////////////////////////////////// -// -// XXX: Do not use in production until this code has been audited. -// -// ////////////////////////////////////////////////////////////////////////////// -// interfaces, based on btcd/btcec and kyber/group/mod -// -// XXX: NOT CONSTANT TIME! -package secp256k1 - -// Implementation of kyber.Point interface for elliptic-curve arithmetic -// operations on secpk256k1. -// -// This is mostly a wrapper of the functionality provided by btcec - -import ( - "crypto/cipher" - "errors" - "fmt" - "io" - "math/big" - - "go.dedis.ch/kyber/v3" - "go.dedis.ch/kyber/v3/util/key" - "golang.org/x/crypto/sha3" -) - -// btcec's public interface uses this affine representation for points on the -// curve. This does not naturally accommodate the point at infinity. btcec -// represents it as (0, 0), which is not a point on {y²=x³+7}. -type secp256k1Point struct { - X *fieldElt - Y *fieldElt -} - -func newPoint() *secp256k1Point { - return &secp256k1Point{newFieldZero(), newFieldZero()} -} - -// String returns a string representation of P -func (P *secp256k1Point) String() string { - return fmt.Sprintf("Secp256k1{X: %s, Y: %s}", P.X, P.Y) -} - -// Equal returns true if p and pPrime represent the same point, false otherwise. -func (P *secp256k1Point) Equal(pPrime kyber.Point) bool { - return P.X.Equal(pPrime.(*secp256k1Point).X) && - P.Y.Equal(pPrime.(*secp256k1Point).Y) -} - -// Null sets p to the group-identity value, and returns it. -func (P *secp256k1Point) Null() kyber.Point { - P.X = fieldEltFromInt(0) // btcec representation of null point is (0,0) - P.Y = fieldEltFromInt(0) - return P -} - -// Base sets p to a copy of the standard group generator, and returns it. -func (P *secp256k1Point) Base() kyber.Point { - P.X.SetInt(s256.Gx) - P.Y.SetInt(s256.Gy) - return P -} - -// Pick sets P to a random point sampled from rand, and returns it. -func (P *secp256k1Point) Pick(rand cipher.Stream) kyber.Point { - for { // Keep trying X's until one fits the curve (~50% probability of - // success each iteration - P.X.Set(newFieldZero().Pick(rand)) - maybeRHS := rightHandSide(P.X) - if maybeY := maybeSqrtInField(maybeRHS); maybeY != (*fieldElt)(nil) { - P.Y.Set(maybeY) - // Take the negative with 50% probability - b := make([]byte, 1) - rand.XORKeyStream(b, b) - if b[0]&1 == 0 { - P.Y.Neg(P.Y) - } - return P - } - } -} - -// Set sets P to copies of pPrime's values, and returns it. -func (P *secp256k1Point) Set(pPrime kyber.Point) kyber.Point { - P.X.Set(pPrime.(*secp256k1Point).X) - P.Y.Set(pPrime.(*secp256k1Point).Y) - return P -} - -// Clone returns a copy of P. -func (P *secp256k1Point) Clone() kyber.Point { - return &secp256k1Point{X: P.X.Clone(), Y: P.Y.Clone()} -} - -// EmbedLen returns the number of bytes of data which can be embedded in a point. -func (*secp256k1Point) EmbedLen() int { - // Reserve the most-significant 8 bits for pseudo-randomness. - // Reserve the least-significant 8 bits for embedded data length. - return (255 - 8 - 8) / 8 -} - -// Embed encodes a limited amount of specified data in the Point, using r as a -// source of cryptographically secure random data. Implementations only embed -// the first EmbedLen bytes of the given data. -func (P *secp256k1Point) Embed(data []byte, r cipher.Stream) kyber.Point { - numEmbedBytes := P.EmbedLen() - if len(data) > numEmbedBytes { - panic("too much data to embed in a point") - } - numEmbedBytes = len(data) - var x [32]byte - randStart := 1 // First byte to fill with random data - if data != nil { - x[0] = byte(numEmbedBytes) // Encode length in low 8 bits - copy(x[1:1+numEmbedBytes], data) // Copy in data to embed - randStart = 1 + numEmbedBytes - } - maxAttempts := 10000 - // Try random x ordinates satisfying the constraints, until one provides - // a point on secp256k1 - for range maxAttempts { - // Fill the rest of the x ordinate with random data - r.XORKeyStream(x[randStart:], x[randStart:]) - xOrdinate := newFieldZero().SetBytes(x) - // RHS of secp256k1 equation is x³+7 mod p. Success if square. - // We optimistically don't use btcec.IsOnCurve, here, because we - // hope to assign the intermediate result maybeY to P.Y - secp256k1RHS := rightHandSide(xOrdinate) - if maybeY := maybeSqrtInField(secp256k1RHS); maybeY != (*fieldElt)(nil) { - P.X = xOrdinate // success: found (x,y) s.t. y²=x³+7 - P.Y = maybeY - return P - } - } - // Probability 2^{-maxAttempts}, under correct operation. - panic("failed to find point satisfying all constraints") -} - -// Data returns data embedded in P, or an error if inconsistent with encoding -func (P *secp256k1Point) Data() ([]byte, error) { - b := P.X.Bytes() - dataLength := int(b[0]) - if dataLength > P.EmbedLen() { - return nil, errors.New("point specifies too much data") - } - return b[1 : dataLength+1], nil -} - -// Add sets P to a+b (secp256k1 group operation) and returns it. -func (P *secp256k1Point) Add(a, b kyber.Point) kyber.Point { - X, Y := s256.Add( - a.(*secp256k1Point).X.int(), a.(*secp256k1Point).Y.int(), - b.(*secp256k1Point).X.int(), b.(*secp256k1Point).Y.int()) - P.X.SetInt(X) - P.Y.SetInt(Y) - return P -} - -// Add sets P to a-b (secp256k1 group operation), and returns it. -func (P *secp256k1Point) Sub(a, b kyber.Point) kyber.Point { - X, Y := s256.Add( - a.(*secp256k1Point).X.int(), a.(*secp256k1Point).Y.int(), - b.(*secp256k1Point).X.int(), - newFieldZero().Neg(b.(*secp256k1Point).Y).int()) // -b_y - P.X.SetInt(X) - P.Y.SetInt(Y) - return P -} - -// Neg sets P to -a (in the secp256k1 group), and returns it. -func (P *secp256k1Point) Neg(a kyber.Point) kyber.Point { - P.X = a.(*secp256k1Point).X.Clone() - P.Y = newFieldZero().Neg(a.(*secp256k1Point).Y) - return P -} - -// Mul sets P to s*a (in the secp256k1 group, i.e. adding a to itself s times), -// and returns it. If a is nil, it is replaced by the secp256k1 generator. -func (P *secp256k1Point) Mul(s kyber.Scalar, a kyber.Point) kyber.Point { - sBytes, err := s.(*secp256k1Scalar).MarshalBinary() - if err != nil { - panic(fmt.Errorf("failure while marshaling multiplier: %w", - err)) - } - var X, Y *big.Int - if a == (*secp256k1Point)(nil) || a == nil { - X, Y = s256.ScalarBaseMult(sBytes) - } else { - X, Y = s256.ScalarMult(a.(*secp256k1Point).X.int(), - a.(*secp256k1Point).Y.int(), sBytes) - } - P.X.SetInt(X) - P.Y.SetInt(Y) - return P -} - -// MarshalBinary returns the concatenated big-endian representation of the X -// ordinate and a byte which is 0 if Y is even, 1 if it's odd. Or it returns an -// error on failure. -func (P *secp256k1Point) MarshalBinary() ([]byte, error) { - maybeSqrt := maybeSqrtInField(rightHandSide(P.X)) - if maybeSqrt == (*fieldElt)(nil) { - return nil, errors.New("x³+7 not a square") - } - minusMaybeSqrt := newFieldZero().Neg(maybeSqrt) - if !P.Y.Equal(maybeSqrt) && !P.Y.Equal(minusMaybeSqrt) { - return nil, errors.New("y ≠ ±maybeSqrt(x³+7), so not a point on the curve") - } - rv := make([]byte, P.MarshalSize()) - signByte := P.MarshalSize() - 1 // Last byte contains sign of Y. - xordinate := P.X.Bytes() - copyLen := copy(rv[:signByte], xordinate[:]) - if copyLen != P.MarshalSize()-1 { - return []byte{}, errors.New("marshal of x ordinate too short") - } - if P.Y.isEven() { - rv[signByte] = 0 - } else { - rv[signByte] = 1 - } - return rv, nil -} - -// MarshalSize returns the length of the byte representation of P -func (P *secp256k1Point) MarshalSize() int { return 33 } - -// MarshalID returns the ID for a secp256k1 point -func (P *secp256k1Point) MarshalID() [8]byte { - return [8]byte{'s', 'p', '2', '5', '6', '.', 'p', 'o'} -} - -// UnmarshalBinary sets P to the point represented by contents of buf, or -// returns an non-nil error -func (P *secp256k1Point) UnmarshalBinary(buf []byte) error { - var err error - if len(buf) != P.MarshalSize() { - err = errors.New("wrong length for marshaled point") - } - if err == nil && (buf[32] != 0 && buf[32] != 1) { - err = errors.New("bad sign byte (the last one)") - } - if err != nil { - return err - } - var xordinate [32]byte - copy(xordinate[:], buf[:32]) - P.X = newFieldZero().SetBytes(xordinate) - secp256k1RHS := rightHandSide(P.X) - maybeY := maybeSqrtInField(secp256k1RHS) - if maybeY == (*fieldElt)(nil) { - return errors.New("x ordinate does not correspond to a curve point") - } - isEven := maybeY.isEven() - P.Y.Set(maybeY) - if (buf[32] == 0 && !isEven) || (buf[32] == 1 && isEven) { - P.Y.Neg(P.Y) - } else { - if buf[32] != 0 && buf[32] != 1 { - return errors.New("parity byte must be 0 or 1") - } - } - return nil -} - -// MarshalTo writes the serialized P to w, and returns the number of bytes -// written, or an error on failure. -func (P *secp256k1Point) MarshalTo(w io.Writer) (int, error) { - buf, err := P.MarshalBinary() - if err != nil { - return 0, err - } - return w.Write(buf) -} - -// UnmarshalFrom sets P to the secp256k1 point represented by bytes read from r, -// and returns the number of bytes read, or an error on failure. -func (P *secp256k1Point) UnmarshalFrom(r io.Reader) (int, error) { - buf := make([]byte, P.MarshalSize()) - n, err := io.ReadFull(r, buf) - if err != nil { - return 0, err - } - return n, P.UnmarshalBinary(buf) -} - -// EthereumAddress returns the 160-bit address corresponding to p as public key. -func EthereumAddress(p kyber.Point) (rv [20]byte) { - // The Ethereum address of P is the bottom 160 bits of keccak256(P.X‖P.Y), - // where P.X and P.Y are represented in 32 bytes as big-endian. See equations - // (277, 284) of Ethereum Yellow Paper version 3e36772, or go-ethereum's - // crypto.PubkeyToAddress. - h := sha3.NewLegacyKeccak256() - if _, err := h.Write(LongMarshal(p)); err != nil { - panic(err) - } - copy(rv[:], h.Sum(nil)[12:]) - return rv -} - -// IsSecp256k1Point returns true if p is a secp256k1Point -func IsSecp256k1Point(p kyber.Point) bool { - switch p.(type) { - case *secp256k1Point: - return true - default: - return false - } -} - -// Coordinates returns the coordinates of p -func Coordinates(p kyber.Point) (*big.Int, *big.Int) { - return p.(*secp256k1Point).X.int(), p.(*secp256k1Point).Y.int() -} - -// ValidPublicKey returns true iff p can be used in the optimized on-chain -// Schnorr-signature verification. See SchnorrSECP256K1.sol for details. -func ValidPublicKey(p kyber.Point) bool { - if p == (*secp256k1Point)(nil) || p == nil { - return false - } - P, ok := p.(*secp256k1Point) - if !ok { - return false - } - maybeY := maybeSqrtInField(rightHandSide(P.X)) - return maybeY != nil && (P.Y.Equal(maybeY) || P.Y.Equal(maybeY.Neg(maybeY))) -} - -// Generate generates a public/private key pair, which can be verified cheaply -// on-chain -func Generate(random cipher.Stream) *key.Pair { - p := key.Pair{} - for !ValidPublicKey(p.Public) { - p.Private = (&Secp256k1{}).Scalar().Pick(random) - p.Public = (&Secp256k1{}).Point().Mul(p.Private, nil) - } - return &p -} - -// LongMarshal returns the concatenated coordinates serialized as uint256's -func LongMarshal(p kyber.Point) []byte { - xMarshal := p.(*secp256k1Point).X.Bytes() - yMarshal := p.(*secp256k1Point).Y.Bytes() - return append(xMarshal[:], yMarshal[:]...) -} - -// LongUnmarshal returns the secp256k1 point represented by m, as a concatenated -// pair of uint256's -func LongUnmarshal(m []byte) (kyber.Point, error) { - if len(m) != 64 { - return nil, fmt.Errorf( - "0x%x does not represent an uncompressed secp256k1Point. Should be length 64, but is length %d", - m, len(m)) - } - p := newPoint() - p.X.SetInt(big.NewInt(0).SetBytes(m[:32])) - p.Y.SetInt(big.NewInt(0).SetBytes(m[32:])) - if !ValidPublicKey(p) { - return nil, fmt.Errorf("%s is not a valid secp256k1 point", p) - } - return p, nil -} - -// ScalarToPublicPoint returns the public secp256k1 point associated to s -func ScalarToPublicPoint(s kyber.Scalar) kyber.Point { - publicPoint := (&Secp256k1{}).Point() - return publicPoint.Mul(s, nil) -} - -// SetCoordinates returns the point (x,y), or panics if an invalid secp256k1Point -func SetCoordinates(x, y *big.Int) kyber.Point { - rv := newPoint() - rv.X.SetInt(x) - rv.Y.SetInt(y) - if !ValidPublicKey(rv) { - panic("point requested from invalid coordinates") - } - return rv -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/point_test.go b/core/services/keystore/keys/vrfkey/secp256k1/point_test.go deleted file mode 100644 index 5558647e72e..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/point_test.go +++ /dev/null @@ -1,226 +0,0 @@ -package secp256k1 - -import ( - "bytes" - "crypto/rand" - "encoding/hex" - "math/big" - "testing" - - "go.dedis.ch/kyber/v3/group/curve25519" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -var numPointSamples = 10 - -var randomStreamPoint = NewStream(&testing.T{}, 0) - -func TestPoint_String(t *testing.T) { - require.Equal(t, "Secp256k1{X: fieldElt{0}, Y: fieldElt{0}}", newPoint().String()) -} - -func TestPoint_CloneAndEqual(t *testing.T) { - f := newPoint() - for range numPointSamples { - g := f.Clone() - f.Pick(randomStreamPoint) - assert.NotEqual(t, f, g, - "modifying original shouldn't change clone") - g, h := f.Clone(), f.Clone() - assert.Equal(t, f, g, "clones should be equal") - g.Add(g, f) - assert.Equal(t, h, f, - "modifying a clone shouldn't change original") - } -} - -func TestPoint_NullAndAdd(t *testing.T) { - f, g := newPoint(), newPoint() - for range numPointSamples { - g.Null() - f.Pick(randomStreamPoint) - g.Add(f, g) - assert.Equal(t, f, g, "adding zero should have no effect") - } -} - -func TestPoint_Set(t *testing.T) { - p := newPoint() - base := newPoint().Base() - assert.NotEqual(t, p, base, "generator should not be zero") - p.Set(base) - assert.Equal(t, p, base, "setting to generator should yield generator") -} - -func TestPoint_Embed(t *testing.T) { - p := newPoint() - for range numPointSamples { - data := make([]byte, p.EmbedLen()) - _, err := rand.Read(data) - require.NoError(t, err) - p.Embed(data, randomStreamPoint) - require.True(t, s256.IsOnCurve(p.X.int(), p.Y.int()), - "should embed to a secp256k1 point") - output, err := p.Data() - require.NoError(t, err) - require.True(t, bytes.Equal(data, output), - "should get same value back after round-trip "+ - "embedding, got %v, then %v", data, output) - } - var uint256Bytes [32]byte - uint256Bytes[0] = 30 - p.X.SetBytes(uint256Bytes) - _, err := p.Data() - require.Error(t, err) - require.Contains(t, err.Error(), "specifies too much data") - var b bytes.Buffer - p.Pick(randomStreamPoint) - _, err = p.MarshalTo(&b) - require.NoError(t, err) - _, err = p.UnmarshalFrom(&b) - require.NoError(t, err) - data := make([]byte, p.EmbedLen()+1) // Check length validation. This test - defer func() { // comes last, because it triggers panic - r := recover() - require.NotNil(t, r, "calling embed with too much data should panic") - require.Contains(t, r, "too much data to embed in a point") - }() - p.Embed(data, randomStreamPoint) -} - -func TestPoint_AddSubAndNeg(t *testing.T) { - zero := newPoint().Null() - p := newPoint() - for range numPointSamples { - p.Pick(randomStreamPoint) - q := p.Clone() - p.Sub(p, q) - require.True(t, p.Equal(zero), - "subtracting a point from itself should give zero, "+ - "got %v - %v = %v ≠ %v", q, q, p, zero) - p.Neg(q) - r := newPoint().Add(p, q) - require.True(t, r.Equal(zero), - "adding a point to its negative should give zero"+ - " got %v+%v=%v≠%v", q, p, r, zero) - r.Neg(q) - p.Sub(q, r) - s := newPoint().Add(q, q) - require.True(t, p.Equal(s), "q-(-q)=q+q?"+ - " got %v-%v=%v≠%v", q, r, p, s) - } -} - -func TestPoint_Mul(t *testing.T) { - zero := newPoint().Null() - multiplier := newScalar(bigZero) - one := newScalar(big.NewInt(int64(1))) - var p *secp256k1Point - for i := 0; i < numPointSamples/5; i++ { - if i%20 == 0 { - p = nil // Test default to generator point - } else { - p = newPoint() - p.Pick(randomStreamPoint) - } - multiplier.Pick(randomStreamPoint) - q := newPoint().Mul(one, p) - comparee := newPoint() - if p == (*secp256k1Point)(nil) { - comparee.Base() - } else { - comparee = p.Clone().(*secp256k1Point) - } - require.True(t, comparee.Equal(q), "1*p=p? %v * %v ≠ %v", one, - comparee, q) - q.Mul(multiplier, p) - negMultiplier := newScalar(bigZero).Neg(multiplier) - r := newPoint().Mul(negMultiplier, p) - s := newPoint().Add(q, r) - require.True(t, s.Equal(zero), "s*p+(-s)*p=0? got "+ - "%v*%v + %v*%v = %v + %v = %v ≠ %v", multiplier, p, - ) - } -} - -func TestPoint_Marshal(t *testing.T) { - p := newPoint() - for range numPointSamples { - p.Pick(randomStreamPoint) - serialized, err := p.MarshalBinary() - require.NoError(t, err) - q := newPoint() - err = q.UnmarshalBinary(serialized) - require.NoError(t, err) - require.True(t, p.Equal(q), "%v marshalled to %x, which "+ - "unmarshalled to %v", p, serialized, q) - } - p.X.SetInt(big.NewInt(0)) // 0³+7 is not a square in the base field. - _, err := p.MarshalBinary() - require.Error(t, err) - require.Contains(t, err.Error(), "not a square") - p.X.SetInt(big.NewInt(1)) - _, err = p.MarshalBinary() - require.Error(t, err) - require.Contains(t, err.Error(), "not a point on the curve") - id := p.MarshalID() - require.Equal(t, "sp256.po", string(id[:])) - data := make([]byte, 34) - err = p.UnmarshalBinary(data) - require.Error(t, err) - require.Contains(t, err.Error(), "wrong length for marshaled point") - require.Contains(t, p.UnmarshalBinary(data[:32]).Error(), - "wrong length for marshaled point") - data[32] = 2 - require.Contains(t, p.UnmarshalBinary(data[:33]).Error(), - "bad sign byte") - data[32] = 0 - data[31] = 5 // I.e., x-ordinate is now 5 - require.Contains(t, p.UnmarshalBinary(data[:33]).Error(), - "does not correspond to a curve point") -} - -func TestPoint_BaseTakesCopy(t *testing.T) { - p := newPoint().Base() - p.Add(p, p) - q := newPoint().Base() - assert.False(t, p.Equal(q), - "modifying output from Base changes S256.G{x,y}") -} - -func TestPoint_EthereumAddress(t *testing.T) { - // Example taken from - // https://theethereum.wiki/w/index.php/Accounts,_Addresses,_Public_And_Private_Keys,_And_Tokens - pString := "3a1076bf45ab87712ad64ccb3b10217737f7faacbf2872e88fdd9a537d8fe266" - pInt, ok := big.NewInt(0).SetString(pString, 16) - require.True(t, ok, "failed to parse private key") - private := newScalar(pInt) - public := newPoint().Mul(private, nil) - address := EthereumAddress(public) - assert.Equal(t, "c2d7cf95645d33006175b78989035c7c9061d3f9", hex.EncodeToString(address[:])) -} - -func TestIsSecp256k1Point(t *testing.T) { - p := curve25519.NewBlakeSHA256Curve25519(false).Point() - require.False(t, IsSecp256k1Point(p)) - require.True(t, IsSecp256k1Point(newPoint())) -} - -func TestCoordinates(t *testing.T) { - x, y := Coordinates(newPoint()) - require.Equal(t, x, bigZero) - require.Equal(t, y, bigZero) -} - -func TestValidPublicKey(t *testing.T) { - require.False(t, ValidPublicKey(newPoint()), "zero is not a valid key") - require.True(t, ValidPublicKey(newPoint().Base())) -} - -func TestGenerate(t *testing.T) { - for !ValidPublicKey(Generate(randomStreamPoint).Public) { - - } -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/public_key.go b/core/services/keystore/keys/vrfkey/secp256k1/public_key.go deleted file mode 100644 index bfd8fb0e31e..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/public_key.go +++ /dev/null @@ -1,150 +0,0 @@ -package secp256k1 - -import ( - "database/sql/driver" - "fmt" - - "github.com/pkg/errors" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "go.dedis.ch/kyber/v3" - - "github.com/smartcontractkit/chainlink-evm/pkg/utils" -) - -// PublicKey is a secp256k1 point in compressed format -type PublicKey [CompressedPublicKeyLength]byte - -// CompressedPublicKeyLength is the length of a secp256k1 public key's x -// coordinate as a uint256, concatenated with 00 if y is even, 01 if odd. -const CompressedPublicKeyLength = 33 - -func init() { - if CompressedPublicKeyLength != (&Secp256k1{}).Point().MarshalSize() { - panic("disparity in expected public key lengths") - } -} - -// Set sets k to the public key represented by l -func (k *PublicKey) Set(l PublicKey) { - if copy(k[:], l[:]) != CompressedPublicKeyLength { - panic(fmt.Errorf("failed to copy entire public key %x to %x", l, k)) - } -} - -// Point returns the secp256k1 point corresponding to k -func (k *PublicKey) Point() (kyber.Point, error) { - p := (&Secp256k1{}).Point() - return p, p.UnmarshalBinary(k[:]) -} - -// NewPublicKeyFromHex returns the PublicKey encoded by 0x-hex string hex, or errors -func NewPublicKeyFromHex(hex string) (PublicKey, error) { - rawKey, err := hexutil.Decode(hex) - if err != nil { - return PublicKey{}, err - } - return NewPublicKeyFromBytes(rawKey) -} - -// NewPublicKeyFromBytes returns the PublicKey built from the given bytes, or errors -func NewPublicKeyFromBytes(rawKey []byte) (PublicKey, error) { - if l := len(rawKey); l != CompressedPublicKeyLength { - return PublicKey{}, fmt.Errorf( - "wrong length for public key: %s of length %d", rawKey, l) - } - var k PublicKey - if c := copy(k[:], rawKey); c != CompressedPublicKeyLength { - panic(errors.New("failed to copy entire key to return value")) - } - return k, nil -} - -// SetFromHex sets k to the public key represented by hex, which must represent -// the compressed binary format -func (k *PublicKey) SetFromHex(hex string) error { - nk, err := NewPublicKeyFromHex(hex) - if err != nil { - return err - } - k.Set(nk) - return nil -} - -// String returns k's binary compressed representation, as 0x-hex -func (k PublicKey) String() string { - return hexutil.Encode(k[:]) -} - -// StringUncompressed returns k's binary uncompressed representation, as 0x-hex -func (k *PublicKey) StringUncompressed() (string, error) { - p, err := k.Point() - if err != nil { - return "", err - } - return hexutil.Encode(LongMarshal(p)), nil -} - -// Hash returns the solidity Keccak256 hash of k. Corresponds to hashOfKey on -// VRFCoordinator. -func (k *PublicKey) Hash() (common.Hash, error) { - p, err := k.Point() - if err != nil { - return common.Hash{}, err - } - return utils.MustHash(string(LongMarshal(p))), nil -} - -// MustHash is like Hash, but panics on error. Useful for testing. -func (k *PublicKey) MustHash() common.Hash { - hash, err := k.Hash() - if err != nil { - panic(fmt.Sprintf("Failed to compute hash of public vrf key %v", k)) - } - return hash -} - -// Address returns the Ethereum address of k or 0 if the key is invalid -func (k *PublicKey) Address() common.Address { - hash, err := k.Hash() - if err != nil { - return common.Address{} - } - return common.BytesToAddress(hash.Bytes()[12:]) -} - -// IsZero returns true iff k is the zero value for PublicKey -func (k *PublicKey) IsZero() bool { - return *k == PublicKey{} -} - -// MarshalText renders k as a text string -func (k PublicKey) MarshalText() ([]byte, error) { - return []byte(k.String()), nil -} - -// UnmarshalText reads a PublicKey into k from text, or errors -func (k *PublicKey) UnmarshalText(text []byte) error { - if err := k.SetFromHex(string(text)); err != nil { - return errors.Wrapf(err, "while parsing %s as public key", text) - } - return nil -} - -// Value marshals PublicKey to be saved in the DB -func (k PublicKey) Value() (driver.Value, error) { - return k.String(), nil -} - -// Scan reconstructs a PublicKey from a DB record of it. -func (k *PublicKey) Scan(value any) error { - rawKey, ok := value.(string) - if !ok { - return errors.Wrap(fmt.Errorf("unable to convert %+v of type %T to PublicKey", value, value), "scan failure") - } - if err := k.SetFromHex(rawKey); err != nil { - return errors.Wrapf(err, "while scanning %s as PublicKey", rawKey) - } - return nil -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/public_key_test.go b/core/services/keystore/keys/vrfkey/secp256k1/public_key_test.go deleted file mode 100644 index 79758918b97..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/public_key_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package secp256k1 - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestValueScanIdentityPointSet(t *testing.T) { - randomStream := NewStream(t, 0) - for range 10 { - p := NewBlakeKeccackSecp256k1().Point().Pick(randomStream) - var pk, nPk, nnPk PublicKey - marshaledKey, err := p.MarshalBinary() - require.NoError(t, err, "failed to marshal public key") - require.Equal(t, CompressedPublicKeyLength, copy(pk[:], marshaledKey), "failed to copy marshaled key to pk") - assert.NotEqual(t, pk, nPk, "equality test succeeds on different keys!") - np, err := pk.Point() - require.NoError(t, err, "failed to marshal public key") - assert.True(t, p.Equal(np), "Point should give the point we constructed pk from") - value, err := pk.Value() - require.NoError(t, err, "failed to serialize public key for database") - require.NoError(t, nPk.Scan(value)) - assert.Equal(t, pk, nPk, - "roundtripping public key through db Value/Scan gave different key!") - nnPk.Set(pk) - assert.Equal(t, pk, nnPk, - "setting one PubliKey to another should result in equal keys") - } -} - -// Tests that PublicKey.Hash gives the same result as the VRFCoordinator's -func TestHash(t *testing.T) { - pk, err := NewPublicKeyFromHex("0x9dc09a0f898f3b5e8047204e7ce7e44b587920932f08431e29c9bf6923b8450a01") - assert.NoError(t, err) - assert.Equal(t, "0xc4406d555db624837188b91514a5f47e34d825d935ab887a35c06a3e7c41de69", pk.MustHash().String()) -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/scalar.go b/core/services/keystore/keys/vrfkey/secp256k1/scalar.go deleted file mode 100644 index d1d63ddcd1c..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/scalar.go +++ /dev/null @@ -1,232 +0,0 @@ -// Package secp256k1 is an implementation of the kyber.{Group,Point,Scalcar} -// ////////////////////////////////////////////////////////////////////////////// -// -// XXX: Do not use in production until this code has been audited. -// -// ////////////////////////////////////////////////////////////////////////////// -// interfaces, based on btcd/btcec and kyber/group/mod -// -// XXX: NOT CONSTANT TIME! -package secp256k1 - -// Implementation of kyber.Scalar interface for arithmetic operations mod the -// order of the secpk256k1 group (i.e. hex value -// 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141.) - -import ( - "crypto/cipher" - "errors" - "fmt" - "io" - "math/big" - - secp256k1BTCD "github.com/btcsuite/btcd/btcec/v2" - "github.com/ethereum/go-ethereum/common" - - "go.dedis.ch/kyber/v3" - "go.dedis.ch/kyber/v3/util/random" -) - -var GroupOrder = secp256k1BTCD.S256().N -var FieldSize = secp256k1BTCD.S256().P - -type secp256k1Scalar big.Int - -// AllowVarTime, if passed true indicates that variable-time operations may be -// used on s. -func (s *secp256k1Scalar) AllowVarTime(varTimeAllowed bool) { - // Since constant-time operations are unimplemented for secp256k1, a - // value of false panics. - if !varTimeAllowed { - panic("implementation is not constant-time!") - } -} - -// newScalar returns a secpk256k1 scalar, with value v modulo GroupOrder. -func newScalar(v *big.Int) kyber.Scalar { - return (*secp256k1Scalar)(zero().Mod(v, GroupOrder)) -} - -func zero() *big.Int { return big.NewInt(0) } - -func ToInt(s kyber.Scalar) *big.Int { return (*big.Int)(s.(*secp256k1Scalar)) } - -func (s *secp256k1Scalar) int() *big.Int { return (*big.Int)(s) } - -func (s *secp256k1Scalar) modG() kyber.Scalar { - // TODO(alx): Make this faster - s.int().Mod(s.int(), GroupOrder) - return s -} - -func (s *secp256k1Scalar) String() string { - return fmt.Sprintf("scalar{%x}", (*big.Int)(s)) -} - -var scalarZero = zero() - -// Equal returns true if s and sPrime represent the same value modulo the group -// order, false otherwise -func (s *secp256k1Scalar) Equal(sPrime kyber.Scalar) bool { - difference := zero().Sub(s.int(), ToInt(sPrime)) - return scalarZero.Cmp(difference.Mod(difference, GroupOrder)) == 0 -} - -// Set copies sPrime's value (modulo GroupOrder) to s, and returns it -func (s *secp256k1Scalar) Set(sPrime kyber.Scalar) kyber.Scalar { - return (*secp256k1Scalar)(s.int().Mod(ToInt(sPrime), GroupOrder)) -} - -// Clone returns a copy of s mod GroupOrder -func (s *secp256k1Scalar) Clone() kyber.Scalar { - return (*secp256k1Scalar)(zero().Mod(s.int(), GroupOrder)) -} - -// SetInt64 returns s with value set to v modulo GroupOrder -func (s *secp256k1Scalar) SetInt64(v int64) kyber.Scalar { - return (*secp256k1Scalar)(s.int().SetInt64(v)).modG() -} - -// Zero sets s to 0 mod GroupOrder, and returns it -func (s *secp256k1Scalar) Zero() kyber.Scalar { - return s.SetInt64(0) -} - -// Add sets s to a+b mod GroupOrder, and returns it -func (s *secp256k1Scalar) Add(a, b kyber.Scalar) kyber.Scalar { - s.int().Add(ToInt(a), ToInt(b)) - return s.modG() -} - -// Sub sets s to a-b mod GroupOrder, and returns it -func (s *secp256k1Scalar) Sub(a, b kyber.Scalar) kyber.Scalar { - s.int().Sub(ToInt(a), ToInt(b)) - return s.modG() -} - -// Neg sets s to -a mod GroupOrder, and returns it -func (s *secp256k1Scalar) Neg(a kyber.Scalar) kyber.Scalar { - s.int().Neg(ToInt(a)) - return s.modG() -} - -// One sets s to 1 mod GroupOrder, and returns it -func (s *secp256k1Scalar) One() kyber.Scalar { - return s.SetInt64(1) -} - -// Mul sets s to a*b mod GroupOrder, and returns it -func (s *secp256k1Scalar) Mul(a, b kyber.Scalar) kyber.Scalar { - // TODO(alx): Make this faster - s.int().Mul(ToInt(a), ToInt(b)) - return s.modG() -} - -// Div sets s to a*b⁻¹ mod GroupOrder, and returns it -func (s *secp256k1Scalar) Div(a, b kyber.Scalar) kyber.Scalar { - if ToInt(b).Cmp(scalarZero) == 0 { - panic("attempt to divide by zero") - } - // TODO(alx): Make this faster - s.int().Mul(ToInt(a), zero().ModInverse(ToInt(b), GroupOrder)) - return s.modG() -} - -// Inv sets s to s⁻¹ mod GroupOrder, and returns it -func (s *secp256k1Scalar) Inv(a kyber.Scalar) kyber.Scalar { - if ToInt(a).Cmp(scalarZero) == 0 { - panic("attempt to divide by zero") - } - s.int().ModInverse(ToInt(a), GroupOrder) - return s -} - -// Pick sets s to a random value mod GroupOrder sampled from rand, and returns -// it -func (s *secp256k1Scalar) Pick(rand cipher.Stream) kyber.Scalar { - return s.Set((*secp256k1Scalar)(random.Int(GroupOrder, rand))) -} - -// MarshalBinary returns the big-endian byte representation of s, or an error on -// failure -func (s *secp256k1Scalar) MarshalBinary() ([]byte, error) { - b := ToInt(s.modG()).Bytes() - // leftpad with zeros - rv := append(make([]byte, s.MarshalSize()-len(b)), b...) - if len(rv) != s.MarshalSize() { - return nil, errors.New("marshalled scalar to wrong length") - } - return rv, nil -} - -// MarshalSize returns the length of the byte representation of s -func (s *secp256k1Scalar) MarshalSize() int { return 32 } - -// MarshalID returns the ID for a secp256k1 scalar -func (s *secp256k1Scalar) MarshalID() [8]byte { - return [8]byte{'s', 'p', '2', '5', '6', '.', 's', 'c'} -} - -// UnmarshalBinary sets s to the scalar represented by the contents of buf, -// returning error on failure. -func (s *secp256k1Scalar) UnmarshalBinary(buf []byte) error { - if len(buf) != s.MarshalSize() { - return errors.New("cannot unmarshal to scalar: wrong length") - } - s.int().Mod(s.int().SetBytes(buf), GroupOrder) - return nil -} - -// MarshalTo writes the serialized s to w, and returns the number of bytes -// written, or an error on failure. -func (s *secp256k1Scalar) MarshalTo(w io.Writer) (int, error) { - buf, err := s.MarshalBinary() - if err != nil { - return 0, fmt.Errorf("cannot marshal binary: %w", err) - } - return w.Write(buf) -} - -// UnmarshalFrom sets s to the scalar represented by bytes read from r, and -// returns the number of bytes read, or an error on failure. -func (s *secp256k1Scalar) UnmarshalFrom(r io.Reader) (int, error) { - buf := make([]byte, s.MarshalSize()) - n, err := io.ReadFull(r, buf) - if err != nil { - return n, err - } - return n, s.UnmarshalBinary(buf) -} - -// SetBytes sets s to the number with big-endian representation a mod -// GroupOrder, and returns it -func (s *secp256k1Scalar) SetBytes(a []byte) kyber.Scalar { - return ((*secp256k1Scalar)(s.int().SetBytes(a))).modG() -} - -// IsSecp256k1Scalar returns true if p is a secp256k1Scalar -func IsSecp256k1Scalar(s kyber.Scalar) bool { - switch s := s.(type) { - case *secp256k1Scalar: - s.modG() - return true - default: - return false - } -} - -// IntToScalar returns i wrapped as a big.Int. -// -// May modify i to reduce mod GroupOrder -func IntToScalar(i *big.Int) kyber.Scalar { - return ((*secp256k1Scalar)(i)).modG() -} - -func ScalarToHash(s kyber.Scalar) common.Hash { - return common.BigToHash(ToInt(s.(*secp256k1Scalar))) -} - -// RepresentsScalar returns true iff i is in the right range to be a scalar -func RepresentsScalar(i *big.Int) bool { - return i.Cmp(GroupOrder) == -1 -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/scalar_test.go b/core/services/keystore/keys/vrfkey/secp256k1/scalar_test.go deleted file mode 100644 index be36a7056e8..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/scalar_test.go +++ /dev/null @@ -1,187 +0,0 @@ -package secp256k1 - -import ( - "bytes" - "encoding/hex" - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "go.dedis.ch/kyber/v3" - "go.dedis.ch/kyber/v3/group/curve25519" -) - -var numScalarSamples = 10 - -var observedScalars map[string]bool - -func init() { - observedScalars = make(map[string]bool) -} - -// observedScalar ensures that novel scalars are being picked. -func observedScalar(t *testing.T, s kyber.Scalar) { - data, err := s.(*secp256k1Scalar).modG().MarshalBinary() - require.NoError(t, err) - scalar := hex.Dump(data) - require.False(t, observedScalars[scalar]) - observedScalars[scalar] = true -} - -var randomStreamScalar = NewStream(&testing.T{}, 0) - -func TestScalar_SetAndEqual(t *testing.T) { - tests := []int64{5, 67108864, 67108865, 4294967295} - g := newScalar(scalarZero) - for _, test := range tests { - f := newScalar(big.NewInt(test)) - g.Set(f) - assert.Equal(t, f, g, - "the method Set should give the same value to receiver") - f.Add(f, newScalar(big.NewInt(1))) - assert.NotEqual(t, f, g, - "SetInt should take a copy of the backing big.Int") - } -} - -func TestNewScalar(t *testing.T) { - one := newScalar(big.NewInt(1)) - assert.Equal(t, ToInt(one), - ToInt(newScalar(big.NewInt(0).Add(ToInt(one), GroupOrder))), - "equivalence classes mod GroupOrder not equal") -} - -func TestScalar_SmokeTestPick(t *testing.T) { - f := newScalar(scalarZero).Clone() - for range numScalarSamples { - f.Pick(randomStreamScalar) - observedScalar(t, f) - require.Equal(t, 1, ToInt(f).Cmp(big.NewInt(1000000000)), - "implausibly low value returned from Pick: %v", f) - } -} - -func TestScalar_Neg(t *testing.T) { - f := newScalar(scalarZero).Clone() - for range numScalarSamples { - f.Pick(randomStreamScalar) - observedScalar(t, f) - g := f.Clone() - g.Neg(g) - require.True(t, g.Add(f, g).Equal(newScalar(scalarZero))) - } -} - -func TestScalar_Sub(t *testing.T) { - f := newScalar(scalarZero).Clone() - for range numScalarSamples { - f.Pick(randomStreamScalar) - observedScalar(t, f) - require.True(t, f.Sub(f, f).Equal(newScalar(scalarZero)), - "subtracting something from itself should give zero") - } -} - -func TestScalar_Clone(t *testing.T) { - f := newScalar(big.NewInt(1)) - g := f.Clone() - h := f.Clone() - assert.Equal(t, f, g, "clone output does not equal input") - g.Add(f, f) - assert.Equal(t, f, h, "clone does not make a copy") -} - -func TestScalar_Marshal(t *testing.T) { - f := newScalar(scalarZero) - g := newScalar(scalarZero) - for range numFieldSamples { - f.Pick(randomStreamScalar) - observedScalar(t, f) - data, err := f.MarshalBinary() - require.NoError(t, err) - err = g.UnmarshalBinary(data) - require.NoError(t, err) - require.True(t, g.Equal(f), - "roundtrip through serialization should give same "+ - "result back: failed with %s", f) - } - marshalID := f.(*secp256k1Scalar).MarshalID() - require.Equal(t, "sp256.sc", string(marshalID[:])) - data := make([]byte, 33) - require.Contains(t, f.UnmarshalBinary(data).Error(), "wrong length") - var buf bytes.Buffer - _, err := f.MarshalTo(&buf) - require.NoError(t, err) - _, err = f.UnmarshalFrom(&buf) - require.NoError(t, err) -} - -func TestScalar_MulDivInv(t *testing.T) { - f := newScalar(scalarZero) - g := newScalar(scalarZero) - h := newScalar(scalarZero) - j := newScalar(scalarZero) - k := newScalar(scalarZero) - for range numFieldSamples { - f.Pick(randomStreamScalar) - observedScalar(t, f) - g.Inv(f) - h.Mul(f, g) - require.True(t, h.Equal(newScalar(big.NewInt(1)))) - h.Div(f, f) - require.True(t, h.Equal(newScalar(big.NewInt(1)))) - h.Div(newScalar(big.NewInt(1)), f) - require.True(t, h.Equal(g)) - h.Pick(randomStreamScalar) - observedScalar(t, h) - j.Neg(j.Mul(h, f)) - k.Mul(h, k.Neg(f)) - require.True(t, j.Equal(k), "-(h*f) != h*(-f)") - } -} - -func TestScalar_AllowVarTime(t *testing.T) { - defer func() { require.Contains(t, recover(), "not constant-time!") }() - newScalar(bigZero).(*secp256k1Scalar).AllowVarTime(false) -} - -func TestScalar_String(t *testing.T) { - require.Equal(t, "scalar{0}", newScalar(bigZero).String()) -} - -func TestScalar_SetInt64(t *testing.T) { - require.Equal(t, newScalar(bigZero).SetInt64(1), newScalar(big.NewInt(1))) - require.True(t, newScalar(big.NewInt(1)).Zero().Equal(newScalar(bigZero))) - require.Equal(t, newScalar(bigZero).One(), newScalar(big.NewInt(1))) -} - -func TestScalar_DivPanicsOnZeroDivisor(t *testing.T) { - defer func() { require.Contains(t, recover(), "divide by zero") }() - newScalar(bigZero).Div(newScalar(bigZero).One(), newScalar(bigZero)) -} - -func TestScalar_InvPanicsOnZero(t *testing.T) { - defer func() { require.Contains(t, recover(), "divide by zero") }() - newScalar(bigZero).Inv(newScalar(bigZero)) -} - -func TestScalar_SetBytes(t *testing.T) { - u256Cardinality := zero().Lsh(big.NewInt(1), 256) - newScalar(bigZero).(*secp256k1Scalar).int().Cmp( - zero().Sub(u256Cardinality, GroupOrder)) -} - -func TestScalar_IsSecp256k1Scalar(t *testing.T) { - c := curve25519.NewBlakeSHA256Curve25519(true) - require.False(t, IsSecp256k1Scalar(c.Scalar())) - require.True(t, IsSecp256k1Scalar(newScalar(bigZero))) -} - -func TestScalar_IntToScalar(t *testing.T) { - u256Cardinality := zero().Lsh(big.NewInt(1), 256) - IntToScalar(u256Cardinality) - require.Equal(t, u256Cardinality, zero().Sub(zero().Lsh(big.NewInt(1), 256), - GroupOrder)) -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/suite.go b/core/services/keystore/keys/vrfkey/secp256k1/suite.go deleted file mode 100644 index 9141f881a0b..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/suite.go +++ /dev/null @@ -1,91 +0,0 @@ -// Package secp256k1 is an implementation of the kyber.{Group,Point,Scalar} -// ////////////////////////////////////////////////////////////////////////////// -// -// XXX: Do not use in production until this code has been audited. -// -// ////////////////////////////////////////////////////////////////////////////// -// interfaces, based on btcd/btcec and kyber/group/mod -// -// XXX: NOT CONSTANT TIME! -package secp256k1 - -import ( - "crypto/cipher" - "hash" - "io" - "reflect" - - "golang.org/x/crypto/sha3" - - "go.dedis.ch/fixbuf" - "go.dedis.ch/kyber/v3" - "go.dedis.ch/kyber/v3/util/random" - "go.dedis.ch/kyber/v3/xof/blake2xb" -) - -// SuiteSecp256k1 implements some basic functionalities such as Group, HashFactory, -// and XOFFactory. -type SuiteSecp256k1 struct { - Secp256k1 - r cipher.Stream -} - -// Hash returns a newly instantiated keccak hash function. -func (s *SuiteSecp256k1) Hash() hash.Hash { - return sha3.NewLegacyKeccak256() -} - -// XOF returns an XOR function, implemented via the Blake2b hash. -// -// This should only be used for generating secrets, so there is no need to make -// it cheap to compute on-chain. -func (s *SuiteSecp256k1) XOF(key []byte) kyber.XOF { - return blake2xb.New(key) -} - -// Read implements the Encoding interface function, and reads a series of objs from r -// The objs must all be pointers -func (s *SuiteSecp256k1) Read(r io.Reader, objs ...any) error { - return fixbuf.Read(r, s, objs...) -} - -// Write implements the Encoding interface, and writes the objs to r using their -// built-in binary serializations. Supports Points, Scalars, fixed-length data -// types supported by encoding/binary/Write(), and structs, arrays, and slices -// containing these types. -func (s *SuiteSecp256k1) Write(w io.Writer, objs ...any) error { - return fixbuf.Write(w, objs) -} - -var aScalar kyber.Scalar -var tScalar = reflect.TypeOf(aScalar) -var aPoint kyber.Point -var tPoint = reflect.TypeOf(aPoint) - -// New implements the kyber.Encoding interface, and returns a new element of -// type t, which can be a Point or a Scalar -func (s *SuiteSecp256k1) New(t reflect.Type) any { - switch t { - case tScalar: - return s.Scalar() - case tPoint: - return s.Point() - } - return nil -} - -// RandomStream returns a cipher.Stream that returns a key stream -// from crypto/rand. -func (s *SuiteSecp256k1) RandomStream() cipher.Stream { - if s.r != nil { - return s.r - } - return random.New() -} - -// NewBlakeKeccackSecp256k1 returns a cipher suite based on package -// go.dedis.ch/kyber/xof/blake2xb, SHA-256, and the secp256k1 curve. It -// produces cryptographically secure random numbers via package crypto/rand. -func NewBlakeKeccackSecp256k1() *SuiteSecp256k1 { - return new(SuiteSecp256k1) -} diff --git a/core/services/keystore/keys/vrfkey/secp256k1/suite_test.go b/core/services/keystore/keys/vrfkey/secp256k1/suite_test.go deleted file mode 100644 index f9c48999d1a..00000000000 --- a/core/services/keystore/keys/vrfkey/secp256k1/suite_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package secp256k1 - -import ( - "encoding/hex" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestSuite(t *testing.T) { - s := NewBlakeKeccackSecp256k1() - emptyHashAsHex := hex.EncodeToString(s.Hash().Sum(nil)) - require.Equal(t, "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", emptyHashAsHex) - _ = s.RandomStream() -} diff --git a/core/services/keystore/keys/workflowkey/export.go b/core/services/keystore/keys/workflowkey/export.go deleted file mode 100644 index 4654dc9949e..00000000000 --- a/core/services/keystore/keys/workflowkey/export.go +++ /dev/null @@ -1,43 +0,0 @@ -package workflowkey - -import ( - "github.com/ethereum/go-ethereum/accounts/keystore" - - commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -const keyTypeIdentifier = "Workflow" - -func FromEncryptedJSON(keyJSON []byte, password string) (Key, error) { - return internal.FromEncryptedJSON( - keyTypeIdentifier, - keyJSON, - password, - adulteratedPassword, - func(_ internal.EncryptedKeyExport, rawPrivKey internal.Raw) (Key, error) { - return KeyFor(rawPrivKey), nil - }, - ) -} - -func (k Key) ToEncryptedJSON(password string, scryptParams commonkeystore.ScryptParams) (export []byte, err error) { - return internal.ToEncryptedJSON( - keyTypeIdentifier, - k, - password, - scryptParams, - adulteratedPassword, - func(id string, key Key, cryptoJSON keystore.CryptoJSON) internal.EncryptedKeyExport { - return internal.EncryptedKeyExport{ - KeyType: id, - PublicKey: key.PublicKeyString(), - Crypto: cryptoJSON, - } - }, - ) -} - -func adulteratedPassword(password string) string { - return "workflowkey" + password -} diff --git a/core/services/keystore/keys/workflowkey/key.go b/core/services/keystore/keys/workflowkey/key.go deleted file mode 100644 index 3a22249f9d0..00000000000 --- a/core/services/keystore/keys/workflowkey/key.go +++ /dev/null @@ -1,129 +0,0 @@ -package workflowkey - -import ( - "crypto/ed25519" - cryptorand "crypto/rand" - "encoding/hex" - "errors" - "math/big" - - "golang.org/x/crypto/curve25519" - "golang.org/x/crypto/nacl/box" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func KeyFor(raw internal.Raw) Key { - privateKey := [32]byte(internal.Bytes(raw)) - return Key{ - raw: raw, - openFn: func(out, ciphertext []byte, publicKey *[32]byte) (message []byte, ok bool) { - return box.OpenAnonymous(nil, ciphertext, publicKey, &privateKey) - }, - publicKey: curve25519PubKeyFromPrivateKey(privateKey), - } -} - -type Key struct { - raw internal.Raw - openFn func(out, ciphertext []byte, publicKey *[32]byte) (message []byte, ok bool) - - publicKey *[curve25519.PointSize]byte -} - -func New() (Key, error) { - publicKey, privateKey, err := box.GenerateKey(cryptorand.Reader) - if err != nil { - return Key{}, err - } - - raw := make([]byte, curve25519.PointSize) - copy(raw, privateKey[:]) - return Key{ - raw: internal.NewRaw(raw), - openFn: func(out, ciphertext []byte, publicKey *[32]byte) (message []byte, ok bool) { - return box.OpenAnonymous(nil, ciphertext, publicKey, privateKey) - }, - publicKey: publicKey, - }, nil -} - -func (k Key) PublicKey() [curve25519.PointSize]byte { - if k.publicKey == nil { - return [curve25519.PointSize]byte{} - } - - return *k.publicKey -} - -func (k Key) PublicKeyString() string { - if k.publicKey == nil { - return "" - } - - return hex.EncodeToString(k.publicKey[:]) -} - -func (k Key) ID() string { - return k.PublicKeyString() -} - -func (k Key) Raw() internal.Raw { return k.raw } - -// Encrypt encrypts a message using the public key -func (k Key) Encrypt(plaintext []byte) ([]byte, error) { - publicKey := k.PublicKey() - if publicKey == [curve25519.PointSize]byte{} { - return nil, errors.New("public key is empty") - } - - encrypted, err := box.SealAnonymous(nil, plaintext, &publicKey, cryptorand.Reader) - if err != nil { - return nil, err - } - - return encrypted, nil -} - -// Decrypt decrypts a message that was encrypted using the private key -func (k Key) Decrypt(ciphertext []byte) (plaintext []byte, err error) { - publicKey := k.PublicKey() - if publicKey == [curve25519.PointSize]byte{} { - return nil, errors.New("public key is empty") - } - - decrypted, success := k.openFn(nil, ciphertext, &publicKey) - if !success { - return nil, errors.New("decryption failed") - } - - return decrypted, nil -} - -func curve25519PubKeyFromPrivateKey(privateKey [curve25519.PointSize]byte) *[curve25519.PointSize]byte { - var publicKey [curve25519.PointSize]byte - - // Derive the public key - curve25519.ScalarBaseMult(&publicKey, &privateKey) - - return &publicKey -} - -func MustNewXXXTestingOnly(k *big.Int) Key { - seed := make([]byte, ed25519.SeedSize) - copy(seed, k.Bytes()) - privKey := ed25519.NewKeyFromSeed(seed) - - var privateKey [32]byte - copy(privateKey[:], privKey.Seed()) - - raw := make([]byte, curve25519.PointSize) - copy(raw, privateKey[:]) - return Key{ - raw: internal.NewRaw(raw), - openFn: func(out, ciphertext []byte, publicKey *[32]byte) (message []byte, ok bool) { - return box.OpenAnonymous(nil, ciphertext, publicKey, &privateKey) - }, - publicKey: curve25519PubKeyFromPrivateKey(privateKey), - } -} diff --git a/core/services/keystore/keys/workflowkey/key_test.go b/core/services/keystore/keys/workflowkey/key_test.go deleted file mode 100644 index 61789b97685..00000000000 --- a/core/services/keystore/keys/workflowkey/key_test.go +++ /dev/null @@ -1,116 +0,0 @@ -package workflowkey - -import ( - cryptorand "crypto/rand" - "encoding/hex" - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/nacl/box" - - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/internal" -) - -func TestNew(t *testing.T) { - key, err := New() - require.NoError(t, err) - - assert.NotNil(t, key.PublicKey) - assert.NotNil(t, key.raw) -} - -func TestPublicKey(t *testing.T) { - key, err := New() - require.NoError(t, err) - - assert.Equal(t, *key.publicKey, key.PublicKey()) -} - -func TestEncryptKeyFromRawPrivateKey(t *testing.T) { - boxPubKey, boxPrivKey, err := box.GenerateKey(cryptorand.Reader) - require.NoError(t, err) - - privKey := make([]byte, 32) - copy(privKey, boxPrivKey[:]) - key := KeyFor(internal.NewRaw(privKey)) - - assert.Equal(t, boxPubKey, key.publicKey) - assert.Equal(t, boxPrivKey[:], internal.Bytes(key.raw)) - - byteBoxPubKey := make([]byte, 32) - copy(byteBoxPubKey, boxPubKey[:]) - - assert.Equal(t, hex.EncodeToString(byteBoxPubKey), key.PublicKeyString()) -} - -func TestPublicKeyStringAndID(t *testing.T) { - key := "my-test-public-key" - var pubkey [32]byte - copy(pubkey[:], key) - k := Key{ - publicKey: &pubkey, - } - - expected := hex.EncodeToString([]byte(key)) - // given the key is a [32]byte we need to ensure the encoded string is 64 character long - for len(expected) < 64 { - expected += "0" - } - - assert.Equal(t, expected, k.PublicKeyString()) - assert.Equal(t, expected, k.ID()) -} - -func TestDecrypt(t *testing.T) { - key, err := New() - require.NoError(t, err) - - secret := []byte("my-secret") - ciphertext, err := key.Encrypt(secret) - require.NoError(t, err) - - plaintext, err := key.Decrypt(ciphertext) - require.NoError(t, err) - - assert.Equal(t, secret, plaintext) -} - -func TestMustNewXXXTestingOnly(t *testing.T) { - tests := []struct { - name string - k *big.Int - wantSuccess bool - }{ - { - name: "generates valid key from big.Int", - k: big.NewInt(1), - wantSuccess: true, - }, - { - name: "panics on nil input", - k: nil, - wantSuccess: false, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if !tt.wantSuccess { - require.Panics(t, func() { MustNewXXXTestingOnly(tt.k) }) - return - } - - key := MustNewXXXTestingOnly(tt.k) - require.NotNil(t, key.raw) - require.NotNil(t, key.publicKey) - - // Verify key generation is deterministic - if tt.k.Cmp(big.NewInt(1)) != 0 { - key1 := MustNewXXXTestingOnly(tt.k) - require.Equal(t, key1.PublicKey(), key.PublicKey()) - } - }) - } -} diff --git a/core/services/keystore/keystoretest.go b/core/services/keystore/keystoretest.go index 68a8c261d8a..a77824aa5bc 100644 --- a/core/services/keystore/keystoretest.go +++ b/core/services/keystore/keystoretest.go @@ -6,8 +6,8 @@ import ( "sync" "github.com/smartcontractkit/chainlink-common/keystore" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/models" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/models" ) // memoryORM is an in-memory version of the keystore. This is diff --git a/core/services/keystore/master.go b/core/services/keystore/master.go index 17a1834412b..6b913c99292 100644 --- a/core/services/keystore/master.go +++ b/core/services/keystore/master.go @@ -11,23 +11,23 @@ import ( "github.com/smartcontractkit/chainlink-common/keystore" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/models" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/models" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" ) var ( diff --git a/core/services/keystore/mocks/aptos.go b/core/services/keystore/mocks/aptos.go index d8943898d13..3573dd621ea 100644 --- a/core/services/keystore/mocks/aptos.go +++ b/core/services/keystore/mocks/aptos.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - aptoskey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" + aptoskey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" mock "github.com/stretchr/testify/mock" ) diff --git a/core/services/keystore/mocks/cosmos.go b/core/services/keystore/mocks/cosmos.go index 7ef56e41ad4..7d2c7b593ba 100644 --- a/core/services/keystore/mocks/cosmos.go +++ b/core/services/keystore/mocks/cosmos.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - cosmoskey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" + cosmoskey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" mock "github.com/stretchr/testify/mock" ) diff --git a/core/services/keystore/mocks/csa.go b/core/services/keystore/mocks/csa.go index a3758edaf04..53e7d7fa0d6 100644 --- a/core/services/keystore/mocks/csa.go +++ b/core/services/keystore/mocks/csa.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - csakey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" + csakey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" mock "github.com/stretchr/testify/mock" ) diff --git a/core/services/keystore/mocks/eth.go b/core/services/keystore/mocks/eth.go index 978dacb426c..8369da8c45b 100644 --- a/core/services/keystore/mocks/eth.go +++ b/core/services/keystore/mocks/eth.go @@ -8,7 +8,7 @@ import ( common "github.com/ethereum/go-ethereum/common" - ethkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" + ethkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" keys "github.com/smartcontractkit/chainlink-evm/pkg/keys" diff --git a/core/services/keystore/mocks/ocr.go b/core/services/keystore/mocks/ocr.go index 1c5b8cc190a..0998099292f 100644 --- a/core/services/keystore/mocks/ocr.go +++ b/core/services/keystore/mocks/ocr.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - ocrkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" + ocrkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" ) // OCR is an autogenerated mock type for the OCR type diff --git a/core/services/keystore/mocks/ocr2.go b/core/services/keystore/mocks/ocr2.go index aab0692d28f..70ca6d45ca5 100644 --- a/core/services/keystore/mocks/ocr2.go +++ b/core/services/keystore/mocks/ocr2.go @@ -9,7 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - ocr2key "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + ocr2key "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" ) // OCR2 is an autogenerated mock type for the OCR2 type diff --git a/core/services/keystore/mocks/p2p.go b/core/services/keystore/mocks/p2p.go index be47fd342ac..06bb4df54d3 100644 --- a/core/services/keystore/mocks/p2p.go +++ b/core/services/keystore/mocks/p2p.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - p2pkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + p2pkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) // P2P is an autogenerated mock type for the P2P type diff --git a/core/services/keystore/mocks/solana.go b/core/services/keystore/mocks/solana.go index f5c9cac4f19..2acd96620dd 100644 --- a/core/services/keystore/mocks/solana.go +++ b/core/services/keystore/mocks/solana.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - solkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" + solkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" ) // Solana is an autogenerated mock type for the Solana type diff --git a/core/services/keystore/mocks/starknet.go b/core/services/keystore/mocks/starknet.go index c55c2da9051..08d088c5d11 100644 --- a/core/services/keystore/mocks/starknet.go +++ b/core/services/keystore/mocks/starknet.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - starkkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" + starkkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" ) // StarkNet is an autogenerated mock type for the StarkNet type diff --git a/core/services/keystore/mocks/sui.go b/core/services/keystore/mocks/sui.go index a741550917e..3e53dcc5a9c 100644 --- a/core/services/keystore/mocks/sui.go +++ b/core/services/keystore/mocks/sui.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - suikey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" + suikey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" ) // Sui is an autogenerated mock type for the Sui type diff --git a/core/services/keystore/mocks/ton.go b/core/services/keystore/mocks/ton.go index b47687cc298..fca75276e55 100644 --- a/core/services/keystore/mocks/ton.go +++ b/core/services/keystore/mocks/ton.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - tonkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" + tonkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" ) // TON is an autogenerated mock type for the TON type diff --git a/core/services/keystore/mocks/tron.go b/core/services/keystore/mocks/tron.go index 8c7fb164e55..700af6dda8e 100644 --- a/core/services/keystore/mocks/tron.go +++ b/core/services/keystore/mocks/tron.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - tronkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" + tronkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" ) // Tron is an autogenerated mock type for the Tron type diff --git a/core/services/keystore/mocks/vrf.go b/core/services/keystore/mocks/vrf.go index a37d1b519e4..ca274def36f 100644 --- a/core/services/keystore/mocks/vrf.go +++ b/core/services/keystore/mocks/vrf.go @@ -8,7 +8,7 @@ import ( mock "github.com/stretchr/testify/mock" - vrfkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" + vrfkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" ) // VRF is an autogenerated mock type for the VRF type diff --git a/core/services/keystore/mocks/workflow.go b/core/services/keystore/mocks/workflow.go index cbd7bfae686..4e902381bf4 100644 --- a/core/services/keystore/mocks/workflow.go +++ b/core/services/keystore/mocks/workflow.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - workflowkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" + workflowkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" ) // Workflow is an autogenerated mock type for the Workflow type diff --git a/core/services/keystore/ocr.go b/core/services/keystore/ocr.go index 4a342b9a259..43e26021a26 100644 --- a/core/services/keystore/ocr.go +++ b/core/services/keystore/ocr.go @@ -6,7 +6,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" ) type OCR interface { diff --git a/core/services/keystore/ocr2.go b/core/services/keystore/ocr2.go index 7d81c781498..f573cd3b3aa 100644 --- a/core/services/keystore/ocr2.go +++ b/core/services/keystore/ocr2.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" ) type OCR2 interface { diff --git a/core/services/keystore/ocr2_test.go b/core/services/keystore/ocr2_test.go index 269d94a8d48..24262e850b8 100644 --- a/core/services/keystore/ocr2_test.go +++ b/core/services/keystore/ocr2_test.go @@ -8,11 +8,11 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) func Test_OCR2KeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/ocr_test.go b/core/services/keystore/ocr_test.go index f3ad841c8d0..7b2c42af549 100644 --- a/core/services/keystore/ocr_test.go +++ b/core/services/keystore/ocr_test.go @@ -7,12 +7,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" ) func Test_OCRKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/orm.go b/core/services/keystore/orm.go index 86be93231ae..79c29290a88 100644 --- a/core/services/keystore/orm.go +++ b/core/services/keystore/orm.go @@ -6,9 +6,9 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/models" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/models" ) func NewORM(ds sqlutil.DataSource) ksORM { diff --git a/core/services/keystore/p2p.go b/core/services/keystore/p2p.go index 3946f0b108e..b6b7a0d5139 100644 --- a/core/services/keystore/p2p.go +++ b/core/services/keystore/p2p.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type P2P interface { diff --git a/core/services/keystore/p2p_test.go b/core/services/keystore/p2p_test.go index 02745c5154d..30672381035 100644 --- a/core/services/keystore/p2p_test.go +++ b/core/services/keystore/p2p_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func Test_P2PKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/solana.go b/core/services/keystore/solana.go index f4ccd9436ef..c73e74c6173 100644 --- a/core/services/keystore/solana.go +++ b/core/services/keystore/solana.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" ) type Solana interface { diff --git a/core/services/keystore/solana_test.go b/core/services/keystore/solana_test.go index cd44dee7096..588e37d807c 100644 --- a/core/services/keystore/solana_test.go +++ b/core/services/keystore/solana_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" ) func Test_SolanaKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/starknet.go b/core/services/keystore/starknet.go index 0656bf3bab2..56414ab42c3 100644 --- a/core/services/keystore/starknet.go +++ b/core/services/keystore/starknet.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" ) type StarkNet interface { diff --git a/core/services/keystore/starknet_test.go b/core/services/keystore/starknet_test.go index 7e1c38a6aa1..4fa7f9affb4 100644 --- a/core/services/keystore/starknet_test.go +++ b/core/services/keystore/starknet_test.go @@ -9,14 +9,14 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" ) diff --git a/core/services/keystore/sui.go b/core/services/keystore/sui.go index 1d78da4b1f0..4c29e3a8763 100644 --- a/core/services/keystore/sui.go +++ b/core/services/keystore/sui.go @@ -4,9 +4,9 @@ import ( "context" "fmt" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" ) // Sui is the interface for the Sui keystore diff --git a/core/services/keystore/sui_test.go b/core/services/keystore/sui_test.go index b032324e5c3..51ac9bb06ed 100644 --- a/core/services/keystore/sui_test.go +++ b/core/services/keystore/sui_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" ) func Test_SuiKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/ton.go b/core/services/keystore/ton.go index 8c1bad226b4..7f9ec7902c1 100644 --- a/core/services/keystore/ton.go +++ b/core/services/keystore/ton.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" ) type TON interface { diff --git a/core/services/keystore/ton_test.go b/core/services/keystore/ton_test.go index 7ecb77089f0..5901e14020e 100644 --- a/core/services/keystore/ton_test.go +++ b/core/services/keystore/ton_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" ) func Test_TONKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/tron.go b/core/services/keystore/tron.go index 895545c4fbd..ecf9b163428 100644 --- a/core/services/keystore/tron.go +++ b/core/services/keystore/tron.go @@ -6,8 +6,8 @@ import ( "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" "github.com/smartcontractkit/chainlink-common/pkg/types/core" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" ) type Tron interface { diff --git a/core/services/keystore/tron_test.go b/core/services/keystore/tron_test.go index 8887d519ba1..2300b64d822 100644 --- a/core/services/keystore/tron_test.go +++ b/core/services/keystore/tron_test.go @@ -9,13 +9,13 @@ import ( "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" ) func Test_TronKeyStore_E2E(t *testing.T) { diff --git a/core/services/keystore/vrf.go b/core/services/keystore/vrf.go index 82afc33ce7c..21373862b2f 100644 --- a/core/services/keystore/vrf.go +++ b/core/services/keystore/vrf.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" ) type VRF interface { diff --git a/core/services/keystore/vrf_test.go b/core/services/keystore/vrf_test.go index 3df9101492f..0a55bd81efb 100644 --- a/core/services/keystore/vrf_test.go +++ b/core/services/keystore/vrf_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/assert" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/stretchr/testify/require" ) diff --git a/core/services/keystore/workflow.go b/core/services/keystore/workflow.go index 4837743c216..443f93bee29 100644 --- a/core/services/keystore/workflow.go +++ b/core/services/keystore/workflow.go @@ -6,7 +6,7 @@ import ( "github.com/pkg/errors" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" ) // ErrWorkflowKeyExists describes the error when the workflow key already exists diff --git a/core/services/keystore/workflow_test.go b/core/services/keystore/workflow_test.go index d4c8eb678d5..7c95f81e858 100644 --- a/core/services/keystore/workflow_test.go +++ b/core/services/keystore/workflow_test.go @@ -9,12 +9,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" ) func Test_EncryptionKeyStore_E2E(t *testing.T) { diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index edfb56f47b4..64656a25136 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -62,6 +62,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ring" "github.com/smartcontractkit/chainlink/v2/core/services/shardorchestrator" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/bridges" gatewayconnector "github.com/smartcontractkit/chainlink/v2/core/capabilities/gateway_connector" vaultcap "github.com/smartcontractkit/chainlink/v2/core/capabilities/vault" @@ -70,7 +71,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/arbiter" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/llo" "github.com/smartcontractkit/chainlink/v2/core/services/llo/retirement" "github.com/smartcontractkit/chainlink/v2/core/services/ocr/capregconfig" diff --git a/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go b/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go index 6c86f0b407e..9cb27cee8ec 100644 --- a/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go +++ b/core/services/ocr2/plugins/ccip/testhelpers/integration/chainlink.go @@ -51,6 +51,8 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/commit_store" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_offramp" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" configv2 "github.com/smartcontractkit/chainlink/v2/core/config/toml" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" @@ -60,8 +62,6 @@ import ( feedsMocks "github.com/smartcontractkit/chainlink/v2/core/services/feeds/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ksMocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" ccipconfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/config" diff --git a/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go index 3bd768cf5f7..2c2e3e322e5 100644 --- a/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go +++ b/core/services/ocr2/plugins/ccip/testhelpers/testhelpers_1_4_0/chainlink.go @@ -49,6 +49,8 @@ import ( commit_store_1_2_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/commit_store" evm_2_evm_offramp_1_2_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/evm_2_evm_offramp" evm_2_evm_onramp_1_2_0 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_2_0/evm_2_evm_onramp" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" evmcapabilities "github.com/smartcontractkit/chainlink/v2/core/capabilities" configv2 "github.com/smartcontractkit/chainlink/v2/core/config/toml" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -59,8 +61,6 @@ import ( feedsMocks "github.com/smartcontractkit/chainlink/v2/core/services/feeds/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ksMocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/abihelpers" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/internal/ccipdata" diff --git a/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go b/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go index e009a96af31..a0e251369a3 100644 --- a/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go +++ b/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go @@ -30,6 +30,8 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-evm/gethwrappers/functions/generated/functions_allow_list" "github.com/smartcontractkit/chainlink-evm/gethwrappers/functions/generated/functions_client_example" "github.com/smartcontractkit/chainlink-evm/gethwrappers/functions/generated/functions_coordinator" @@ -47,8 +49,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/functions" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" functionsConfig "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/functions/config" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" diff --git a/core/services/ocr2/plugins/functions/plugin_test.go b/core/services/ocr2/plugins/functions/plugin_test.go index 6916ea4aa2e..1fa8db7fbc5 100644 --- a/core/services/ocr2/plugins/functions/plugin_test.go +++ b/core/services/ocr2/plugins/functions/plugin_test.go @@ -6,6 +6,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-common/pkg/ratelimit" "github.com/smartcontractkit/chainlink-evm/pkg/keys/keystest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -14,7 +15,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/connector" gfaMocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/allowlist/mocks" gfsMocks "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/functions/subscriptions/mocks" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/functions" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/functions/config" s4mocks "github.com/smartcontractkit/chainlink/v2/core/services/s4/mocks" diff --git a/core/services/ocr2/plugins/generic/oraclefactory.go b/core/services/ocr2/plugins/generic/oraclefactory.go index 35acad8ced8..8be03661319 100644 --- a/core/services/ocr2/plugins/generic/oraclefactory.go +++ b/core/services/ocr2/plugins/generic/oraclefactory.go @@ -17,10 +17,10 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/types/core" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/ocr/capregconfig" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" "github.com/smartcontractkit/chainlink/v2/core/services/telemetry" diff --git a/core/services/ocr2/plugins/llo/helpers_test.go b/core/services/ocr2/plugins/llo/helpers_test.go index e2b02fc629a..2f471dfdeaf 100644 --- a/core/services/ocr2/plugins/llo/helpers_test.go +++ b/core/services/ocr2/plugins/llo/helpers_test.go @@ -32,6 +32,9 @@ import ( "github.com/smartcontractkit/chainlink-common/keystore/corekeys" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/config/toml" @@ -40,9 +43,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" "github.com/smartcontractkit/chainlink/v2/core/services/streams" diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index e53ee8d45ca..828a58c3405 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -55,12 +55,12 @@ import ( evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" evmutils "github.com/smartcontractkit/chainlink-evm/pkg/utils" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/toml" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" reportcodecv3 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec" diff --git a/core/services/ocr2/plugins/mercury/helpers_test.go b/core/services/ocr2/plugins/mercury/helpers_test.go index e48e4b602fe..8d926d289f1 100644 --- a/core/services/ocr2/plugins/mercury/helpers_test.go +++ b/core/services/ocr2/plugins/mercury/helpers_test.go @@ -29,6 +29,9 @@ import ( "github.com/smartcontractkit/chainlink-common/keystore/corekeys" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" @@ -36,9 +39,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index f1060d21928..07b5aee4907 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -42,6 +42,7 @@ import ( datastreamsmercury "github.com/smartcontractkit/chainlink-data-streams/mercury" "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink-evm/gethwrappers/llo-feeds/generated/fee_manager" "github.com/smartcontractkit/chainlink-evm/gethwrappers/llo-feeds/generated/reward_manager" @@ -53,7 +54,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" reportcodecv2 "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v2/reportcodec" diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go index 05b5d1d13aa..d3feb6c197a 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go @@ -37,6 +37,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" automationForwarderLogic "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/automation_forwarder_logic" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/basic_upkeep_contract" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/dummy_protocol_wrapper" @@ -56,7 +57,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury/streams" diff --git a/core/services/ocr2/plugins/vault/plugin.go b/core/services/ocr2/plugins/vault/plugin.go index 3d8936908de..4adcca17b5b 100644 --- a/core/services/ocr2/plugins/vault/plugin.go +++ b/core/services/ocr2/plugins/vault/plugin.go @@ -28,6 +28,7 @@ import ( "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/structpb" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" vaultcommon "github.com/smartcontractkit/chainlink-common/pkg/capabilities/actions/vault" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/requests" pkgconfig "github.com/smartcontractkit/chainlink-common/pkg/config" @@ -39,7 +40,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/vault/vaulttypes" "github.com/smartcontractkit/chainlink/v2/core/capabilities/vault/vaultutils" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" ) const ( diff --git a/core/services/ocr2/plugins/vault/plugin_test.go b/core/services/ocr2/plugins/vault/plugin_test.go index d9951814929..0ed0e64e747 100644 --- a/core/services/ocr2/plugins/vault/plugin_test.go +++ b/core/services/ocr2/plugins/vault/plugin_test.go @@ -22,6 +22,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" vaultcommon "github.com/smartcontractkit/chainlink-common/pkg/capabilities/actions/vault" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/requests" pkgconfig "github.com/smartcontractkit/chainlink-common/pkg/config" @@ -33,7 +34,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/capabilities/vault/vaulttypes" "github.com/smartcontractkit/chainlink/v2/core/capabilities/vault/vaultutils" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" ) func writeDKGPackage(t *testing.T, orm dkgocrtypes.ResultPackageDatabase, key dkgocrtypes.P256Keyring, instanceID string) dkgocrtypes.ResultPackage { diff --git a/core/services/ocrcommon/adapters.go b/core/services/ocrcommon/adapters.go index ebecf350a7e..4affce1489c 100644 --- a/core/services/ocrcommon/adapters.go +++ b/core/services/ocrcommon/adapters.go @@ -17,8 +17,8 @@ import ( "google.golang.org/protobuf/types/known/structpb" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) var _ ocr3types.OnchainKeyring[[]byte] = (*OCR3OnchainKeyringAdapter)(nil) diff --git a/core/services/ocrcommon/adapters_test.go b/core/services/ocrcommon/adapters_test.go index 9c091a8a9fb..283d515ca94 100644 --- a/core/services/ocrcommon/adapters_test.go +++ b/core/services/ocrcommon/adapters_test.go @@ -17,9 +17,9 @@ import ( "google.golang.org/protobuf/types/known/structpb" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) diff --git a/core/services/ocrcommon/discoverer_database_test.go b/core/services/ocrcommon/discoverer_database_test.go index 2448be29d67..ca8395661ac 100644 --- a/core/services/ocrcommon/discoverer_database_test.go +++ b/core/services/ocrcommon/discoverer_database_test.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) diff --git a/core/services/ocrcommon/peer_wrapper.go b/core/services/ocrcommon/peer_wrapper.go index 2b300a0e63c..0938c1a70da 100644 --- a/core/services/ocrcommon/peer_wrapper.go +++ b/core/services/ocrcommon/peer_wrapper.go @@ -21,10 +21,10 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type PeerWrapperOCRConfig interface { diff --git a/core/services/ocrcommon/peer_wrapper_test.go b/core/services/ocrcommon/peer_wrapper_test.go index dfc41b55ef1..0be021a8335 100644 --- a/core/services/ocrcommon/peer_wrapper_test.go +++ b/core/services/ocrcommon/peer_wrapper_test.go @@ -10,6 +10,7 @@ import ( "github.com/smartcontractkit/freeport" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" @@ -18,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" ) diff --git a/core/services/p2p/shared_peer_test.go b/core/services/p2p/shared_peer_test.go index 4701db3df40..93eab232316 100644 --- a/core/services/p2p/shared_peer_test.go +++ b/core/services/p2p/shared_peer_test.go @@ -12,6 +12,7 @@ import ( ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ragetypes "github.com/smartcontractkit/libocr/ragep2p/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -19,7 +20,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" "github.com/smartcontractkit/chainlink/v2/core/services/p2p" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" diff --git a/core/services/p2p/signer.go b/core/services/p2p/signer.go index e8c9c06506a..7d57b7d3849 100644 --- a/core/services/p2p/signer.go +++ b/core/services/p2p/signer.go @@ -6,8 +6,8 @@ import ( "errors" "fmt" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" ) diff --git a/core/services/p2p/signer_test.go b/core/services/p2p/signer_test.go index 4c91375c8e7..ba823a147f7 100644 --- a/core/services/p2p/signer_test.go +++ b/core/services/p2p/signer_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" ) diff --git a/core/services/p2p/wrapper/wrapper_test.go b/core/services/p2p/wrapper/wrapper_test.go index 53231b48417..7a1b9e21a31 100644 --- a/core/services/p2p/wrapper/wrapper_test.go +++ b/core/services/p2p/wrapper/wrapper_test.go @@ -9,12 +9,12 @@ import ( "github.com/smartcontractkit/freeport" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/p2p/wrapper" ) diff --git a/core/services/pipeline/task.vrf.go b/core/services/pipeline/task.vrf.go index 3873a12f780..27c54a028ff 100644 --- a/core/services/pipeline/task.vrf.go +++ b/core/services/pipeline/task.vrf.go @@ -14,8 +14,8 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/pipeline/task.vrfv2.go b/core/services/pipeline/task.vrfv2.go index 04a603bbcc9..8f91e37c89a 100644 --- a/core/services/pipeline/task.vrfv2.go +++ b/core/services/pipeline/task.vrfv2.go @@ -14,9 +14,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/pipeline/task.vrfv2plus.go b/core/services/pipeline/task.vrfv2plus.go index afbaffc9384..870796c972e 100644 --- a/core/services/pipeline/task.vrfv2plus.go +++ b/core/services/pipeline/task.vrfv2plus.go @@ -14,9 +14,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2plus_interface" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/relay/evm/capabilities/testutils/signing_keystore.go b/core/services/relay/evm/capabilities/testutils/signing_keystore.go index ec3e0ee75e6..cd394c16a80 100644 --- a/core/services/relay/evm/capabilities/testutils/signing_keystore.go +++ b/core/services/relay/evm/capabilities/testutils/signing_keystore.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-evm/pkg/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/relay/evm/chain_components_test.go b/core/services/relay/evm/chain_components_test.go index 2a786998ff3..8fed72f1ae8 100644 --- a/core/services/relay/evm/chain_components_test.go +++ b/core/services/relay/evm/chain_components_test.go @@ -46,11 +46,11 @@ import ( clevmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" writertestutils "github.com/smartcontractkit/chainlink-evm/pkg/writer/testutils" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" lpmocks "github.com/smartcontractkit/chainlink/v2/common/logpoller/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" . "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/evmtesting" //nolint:revive // dot-imports ) diff --git a/core/services/relay/evm/mercury/wsrpc/client_test.go b/core/services/relay/evm/mercury/wsrpc/client_test.go index 482a990ad93..dce9d0e9984 100644 --- a/core/services/relay/evm/mercury/wsrpc/client_test.go +++ b/core/services/relay/evm/mercury/wsrpc/client_test.go @@ -10,10 +10,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/cache" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" diff --git a/core/services/relay/evm/mercury/wsrpc/pool_test.go b/core/services/relay/evm/mercury/wsrpc/pool_test.go index fe50c96d190..85fe75d319d 100644 --- a/core/services/relay/evm/mercury/wsrpc/pool_test.go +++ b/core/services/relay/evm/mercury/wsrpc/pool_test.go @@ -11,9 +11,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/pb" ) diff --git a/core/services/signatures/ethdss/ethdss.go b/core/services/signatures/ethdss/ethdss.go index 55e7c4d1172..0f98b46b127 100644 --- a/core/services/signatures/ethdss/ethdss.go +++ b/core/services/signatures/ethdss/ethdss.go @@ -28,7 +28,7 @@ import ( "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/share" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/ethschnorr" ) diff --git a/core/services/signatures/ethdss/ethdss_test.go b/core/services/signatures/ethdss/ethdss_test.go index 5f7b38130f9..a9adcf65bc2 100644 --- a/core/services/signatures/ethdss/ethdss_test.go +++ b/core/services/signatures/ethdss/ethdss_test.go @@ -11,7 +11,7 @@ import ( "go.dedis.ch/kyber/v3" dkg "go.dedis.ch/kyber/v3/share/dkg/rabin" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/ethschnorr" ) diff --git a/core/services/signatures/ethschnorr/ethschnorr.go b/core/services/signatures/ethschnorr/ethschnorr.go index b6517cf2ec9..3d4a5337f5c 100644 --- a/core/services/signatures/ethschnorr/ethschnorr.go +++ b/core/services/signatures/ethschnorr/ethschnorr.go @@ -24,7 +24,7 @@ import ( "go.dedis.ch/kyber/v3" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" ) var secp256k1Suite = secp256k1.NewBlakeKeccackSecp256k1() diff --git a/core/services/signatures/ethschnorr/ethschnorr_test.go b/core/services/signatures/ethschnorr/ethschnorr_test.go index ca2513fc188..d64c720a871 100644 --- a/core/services/signatures/ethschnorr/ethschnorr_test.go +++ b/core/services/signatures/ethschnorr/ethschnorr_test.go @@ -14,7 +14,7 @@ import ( "go.dedis.ch/kyber/v3" "go.dedis.ch/kyber/v3/group/curve25519" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/signatures/cryptotest" ) diff --git a/core/services/standardcapabilities/delegate.go b/core/services/standardcapabilities/delegate.go index 9c676c1dd06..401a1fb0f2c 100644 --- a/core/services/standardcapabilities/delegate.go +++ b/core/services/standardcapabilities/delegate.go @@ -15,6 +15,8 @@ import ( chainselectors "github.com/smartcontractkit/chain-selectors" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/services/orgresolver" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -31,8 +33,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr/capregconfig" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/generic" "github.com/smartcontractkit/chainlink/v2/core/services/ocrcommon" diff --git a/core/services/synchronization/telemetry_ingress_batch_client_test.go b/core/services/synchronization/telemetry_ingress_batch_client_test.go index c745bb00352..8953a122624 100644 --- a/core/services/synchronization/telemetry_ingress_batch_client_test.go +++ b/core/services/synchronization/telemetry_ingress_batch_client_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" diff --git a/core/services/synchronization/telemetry_ingress_client_test.go b/core/services/synchronization/telemetry_ingress_client_test.go index eebc03515a5..00c4f1ed055 100644 --- a/core/services/synchronization/telemetry_ingress_client_test.go +++ b/core/services/synchronization/telemetry_ingress_client_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" diff --git a/core/services/telemetry/manager_test.go b/core/services/telemetry/manager_test.go index 735a0356494..a260a682a64 100644 --- a/core/services/telemetry/manager_test.go +++ b/core/services/telemetry/manager_test.go @@ -13,11 +13,11 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink/v2/core/config" "github.com/smartcontractkit/chainlink/v2/core/config/mocks" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" keymocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/synchronization" mocks2 "github.com/smartcontractkit/chainlink/v2/core/services/synchronization/mocks" diff --git a/core/services/vrf/delegate_test.go b/core/services/vrf/delegate_test.go index d8324ff9d72..6512d541096 100644 --- a/core/services/vrf/delegate_test.go +++ b/core/services/vrf/delegate_test.go @@ -25,6 +25,8 @@ import ( evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" evmutils "github.com/smartcontractkit/chainlink-evm/pkg/utils" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/solidity_vrf_coordinator_interface" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/log" @@ -40,8 +42,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/vrf" vrf_mocks "github.com/smartcontractkit/chainlink/v2/core/services/vrf/mocks" diff --git a/core/services/vrf/proof/proof_response.go b/core/services/vrf/proof/proof_response.go index 923ce176325..883d36a4dc5 100644 --- a/core/services/vrf/proof/proof_response.go +++ b/core/services/vrf/proof/proof_response.go @@ -9,12 +9,12 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2plus_interface" "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) // ProofResponse is the data which is sent back to the VRFCoordinator, so that diff --git a/core/services/vrf/proof/solidity_proof.go b/core/services/vrf/proof/solidity_proof.go index c6a84ef6bf0..78247256b16 100644 --- a/core/services/vrf/proof/solidity_proof.go +++ b/core/services/vrf/proof/solidity_proof.go @@ -14,8 +14,8 @@ import ( bm "github.com/smartcontractkit/chainlink-common/pkg/utils/big_math" "github.com/smartcontractkit/chainlink-evm/pkg/utils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" ) // SolidityProof contains precalculations which VRF.sol needs to verify proofs diff --git a/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go index 5455143daa3..f57b8121f34 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_coordinator_solidity_crosscheck_test.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" proof2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/solidity_cross_tests" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" diff --git a/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go b/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go index 1eafcf1d2d1..af81bf8c2fb 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_hash_to_curve_cost_test.go @@ -17,13 +17,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/solidity_vrf_verifier_wrapper" "github.com/smartcontractkit/chainlink-evm/pkg/assets" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" ) type contract struct { diff --git a/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go b/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go index ecc860dc4e6..de9830322a4 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_randomness_output_cost_test.go @@ -9,8 +9,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" ) func TestMeasureRandomValueFromVRFProofGasCost(t *testing.T) { diff --git a/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go index 94c93db036d..c432bae81d6 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_solidity_crosscheck_test.go @@ -16,12 +16,12 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/solidity_vrf_verifier_wrapper" "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" proof2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" ) diff --git a/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go b/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go index 6766cf87b37..18e5ec5b68c 100644 --- a/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go +++ b/core/services/vrf/solidity_cross_tests/vrf_v08_solidity_crosscheck_test.go @@ -7,8 +7,8 @@ import ( gethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/solidity_vrf_v08_verifier_wrapper" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" proof2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" "github.com/ethereum/go-ethereum/eth/ethconfig" @@ -18,10 +18,10 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/utils" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" ) // Note these tests are identical to the ones in vrf_solidity_crosscheck_test.go, diff --git a/core/services/vrf/v1/integration_test.go b/core/services/vrf/v1/integration_test.go index 691bb343ccf..2481b51450f 100644 --- a/core/services/vrf/v1/integration_test.go +++ b/core/services/vrf/v1/integration_test.go @@ -15,6 +15,8 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/solidity_vrf_coordinator_interface" @@ -24,8 +26,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" diff --git a/core/services/vrf/v2/integration_helpers_test.go b/core/services/vrf/v2/integration_helpers_test.go index 42adda38283..88c92cf47c2 100644 --- a/core/services/vrf/v2/integration_helpers_test.go +++ b/core/services/vrf/v2/integration_helpers_test.go @@ -18,6 +18,7 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_consumer_v2_upgradeable_example" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_external_sub_owner_example" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrfv2_transparent_upgradeable_proxy" @@ -33,7 +34,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/evmtest" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" v22 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrftesthelpers" diff --git a/core/services/vrf/v2/integration_v2_plus_test.go b/core/services/vrf/v2/integration_v2_plus_test.go index c79ffd84078..a7ade37a8fe 100644 --- a/core/services/vrf/v2/integration_v2_plus_test.go +++ b/core/services/vrf/v2/integration_v2_plus_test.go @@ -18,6 +18,8 @@ import ( "github.com/smartcontractkit/quarantine" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/batch_blockhash_store" @@ -47,8 +49,6 @@ import ( "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" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/extraargs" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" v22 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2" diff --git a/core/services/vrf/v2/integration_v2_reverted_txns_test.go b/core/services/vrf/v2/integration_v2_reverted_txns_test.go index 95106d1877f..8d40397bca7 100644 --- a/core/services/vrf/v2/integration_v2_reverted_txns_test.go +++ b/core/services/vrf/v2/integration_v2_reverted_txns_test.go @@ -16,6 +16,7 @@ import ( "github.com/jmoiron/sqlx" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/batch_vrf_coordinator_v2" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_coordinator_v2" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/vrf_external_sub_owner_example" @@ -30,7 +31,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" prooflib "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" v2 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" diff --git a/core/services/vrf/v2/integration_v2_test.go b/core/services/vrf/v2/integration_v2_test.go index a28b5e400e1..e62cc670927 100644 --- a/core/services/vrf/v2/integration_v2_test.go +++ b/core/services/vrf/v2/integration_v2_test.go @@ -47,6 +47,9 @@ import ( txmgrcommon "github.com/smartcontractkit/chainlink-framework/chains/txmgr" txmgrtypes "github.com/smartcontractkit/chainlink-framework/chains/txmgr/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/batch_blockhash_store" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/batch_vrf_coordinator_v2" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/blockhash_store" @@ -74,9 +77,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" v1 "github.com/smartcontractkit/chainlink/v2/core/services/vrf/v1" diff --git a/core/services/vrf/vrfcommon/validate.go b/core/services/vrf/vrfcommon/validate.go index f2357b86b55..0ac0a472943 100644 --- a/core/services/vrf/vrfcommon/validate.go +++ b/core/services/vrf/vrfcommon/validate.go @@ -9,9 +9,9 @@ import ( "github.com/pelletier/go-toml" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" ) diff --git a/core/services/vrf/vrftesthelpers/helpers.go b/core/services/vrf/vrftesthelpers/helpers.go index c04f7028376..a80455159e5 100644 --- a/core/services/vrf/vrftesthelpers/helpers.go +++ b/core/services/vrf/vrftesthelpers/helpers.go @@ -15,6 +15,8 @@ import ( "github.com/shopspring/decimal" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/blockhash_store" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/link_token_interface" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/solidity_vrf_consumer_interface" @@ -30,8 +32,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/blockhashstore" "github.com/smartcontractkit/chainlink/v2/core/services/blockheaderfeeder" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/proof" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" ) diff --git a/core/services/workflows/artifacts/store.go b/core/services/workflows/artifacts/store.go index d8965548d61..b36a1132656 100644 --- a/core/services/workflows/artifacts/store.go +++ b/core/services/workflows/artifacts/store.go @@ -21,10 +21,10 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/workflows/secrets" "github.com/smartcontractkit/chainlink/v2/core/platform" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/types" "github.com/smartcontractkit/chainlink/v2/core/utils" ) diff --git a/core/services/workflows/artifacts/store_test.go b/core/services/workflows/artifacts/store_test.go index 06d94bdd4fa..0672226459a 100644 --- a/core/services/workflows/artifacts/store_test.go +++ b/core/services/workflows/artifacts/store_test.go @@ -12,12 +12,12 @@ import ( "testing" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/custmsg" "github.com/smartcontractkit/chainlink-common/pkg/workflows/secrets" "github.com/smartcontractkit/chainlink/v2/core/logger" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" diff --git a/core/services/workflows/artifacts/v2/store.go b/core/services/workflows/artifacts/v2/store.go index 05f8e14f5e7..15a82f12e82 100644 --- a/core/services/workflows/artifacts/v2/store.go +++ b/core/services/workflows/artifacts/v2/store.go @@ -17,6 +17,7 @@ import ( "github.com/jonboulle/clockwork" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/custmsg" "github.com/smartcontractkit/chainlink-common/pkg/settings/cresettings" @@ -25,7 +26,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/types" ) diff --git a/core/services/workflows/artifacts/v2/store_test.go b/core/services/workflows/artifacts/v2/store_test.go index fbbfa0c1f96..0cb573c9b7f 100644 --- a/core/services/workflows/artifacts/v2/store_test.go +++ b/core/services/workflows/artifacts/v2/store_test.go @@ -10,6 +10,7 @@ import ( "github.com/jonboulle/clockwork" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/contexts" "github.com/smartcontractkit/chainlink-common/pkg/custmsg" "github.com/smartcontractkit/chainlink-common/pkg/settings/limits" @@ -17,7 +18,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" diff --git a/core/services/workflows/cmd/cre/utils/standalone_engine.go b/core/services/workflows/cmd/cre/utils/standalone_engine.go index c31db90bdf5..5d0d33f2691 100644 --- a/core/services/workflows/cmd/cre/utils/standalone_engine.go +++ b/core/services/workflows/cmd/cre/utils/standalone_engine.go @@ -25,9 +25,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/host" sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/capabilities/fakes" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/workflows" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/ratelimiter" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" diff --git a/core/services/workflows/syncer/handler.go b/core/services/workflows/syncer/handler.go index f20917aed3c..32488343167 100644 --- a/core/services/workflows/syncer/handler.go +++ b/core/services/workflows/syncer/handler.go @@ -16,11 +16,11 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/host" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/ratelimiter" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/platform" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/workflows" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/artifacts" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/events" diff --git a/core/services/workflows/syncer/handler_test.go b/core/services/workflows/syncer/handler_test.go index 3f448d26ed0..f69dbc9b312 100644 --- a/core/services/workflows/syncer/handler_test.go +++ b/core/services/workflows/syncer/handler_test.go @@ -9,6 +9,7 @@ import ( "math/big" "testing" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/custmsg" "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/settings/limits" @@ -21,7 +22,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/artifacts" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/ratelimiter" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" diff --git a/core/services/workflows/syncer/v2/handler.go b/core/services/workflows/syncer/v2/handler.go index 8b5623e1d2d..6acb5941b0d 100644 --- a/core/services/workflows/syncer/v2/handler.go +++ b/core/services/workflows/syncer/v2/handler.go @@ -18,11 +18,11 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/workflows/dontime" "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/host" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/platform" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/workflows" artifacts "github.com/smartcontractkit/chainlink/v2/core/services/workflows/artifacts/v2" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/events" diff --git a/core/services/workflows/syncer/v2/handler_test.go b/core/services/workflows/syncer/v2/handler_test.go index ec9e088d88e..4b0ff941203 100644 --- a/core/services/workflows/syncer/v2/handler_test.go +++ b/core/services/workflows/syncer/v2/handler_test.go @@ -31,6 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/workflows/ratelimiter" v2 "github.com/smartcontractkit/chainlink/v2/core/services/workflows/v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/services/orgresolver" "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" @@ -39,7 +40,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" artifacts "github.com/smartcontractkit/chainlink/v2/core/services/workflows/artifacts/v2" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/syncer/v2/mocks" diff --git a/core/services/workflows/syncer/v2/workflow_syncer_v2_test.go b/core/services/workflows/syncer/v2/workflow_syncer_v2_test.go index c45947aade8..445b6c9e320 100644 --- a/core/services/workflows/syncer/v2/workflow_syncer_v2_test.go +++ b/core/services/workflows/syncer/v2/workflow_syncer_v2_test.go @@ -21,6 +21,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" vaultcommon "github.com/smartcontractkit/chainlink-common/pkg/capabilities/actions/vault" "github.com/smartcontractkit/chainlink-common/pkg/custmsg" @@ -38,7 +39,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/testutils" artifacts "github.com/smartcontractkit/chainlink/v2/core/services/workflows/artifacts/v2" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/ratelimiter" diff --git a/core/services/workflows/syncer/workflow_syncer_test.go b/core/services/workflows/syncer/workflow_syncer_test.go index d0ea43669aa..c28524a90b8 100644 --- a/core/services/workflows/syncer/workflow_syncer_test.go +++ b/core/services/workflows/syncer/workflow_syncer_test.go @@ -24,6 +24,7 @@ import ( "github.com/smartcontractkit/quarantine" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" "github.com/smartcontractkit/chainlink-common/pkg/custmsg" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" @@ -39,7 +40,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/pgtest" "github.com/smartcontractkit/chainlink/v2/core/logger" ghcapabilities "github.com/smartcontractkit/chainlink/v2/core/services/gateway/handlers/capabilities" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/capabilities/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/artifacts" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/ratelimiter" diff --git a/core/services/workflows/v2/config.go b/core/services/workflows/v2/config.go index 35921b290e8..49e91ca6098 100644 --- a/core/services/workflows/v2/config.go +++ b/core/services/workflows/v2/config.go @@ -19,9 +19,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/services/orgresolver" "github.com/smartcontractkit/chainlink/v2/core/capabilities" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/metering" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/types" diff --git a/core/services/workflows/v2/config_test.go b/core/services/workflows/v2/config_test.go index 2789f0f3ccf..ec9e855e995 100644 --- a/core/services/workflows/v2/config_test.go +++ b/core/services/workflows/v2/config_test.go @@ -17,9 +17,9 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/workflows/dontime" modulemocks "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/host/mocks" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" capmocks "github.com/smartcontractkit/chainlink/v2/core/capabilities/mocks" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" metmocks "github.com/smartcontractkit/chainlink/v2/core/services/workflows/metering/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/store" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/syncerlimiter" diff --git a/core/services/workflows/v2/secrets.go b/core/services/workflows/v2/secrets.go index 531def77751..75abdb30d72 100644 --- a/core/services/workflows/v2/secrets.go +++ b/core/services/workflows/v2/secrets.go @@ -25,7 +25,7 @@ import ( sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" "github.com/smartcontractkit/chainlink/v2/core/capabilities/vault/vaulttypes" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/monitoring" ) diff --git a/core/services/workflows/v2/secrets_test.go b/core/services/workflows/v2/secrets_test.go index ba1b89e25c9..c7a207bb110 100644 --- a/core/services/workflows/v2/secrets_test.go +++ b/core/services/workflows/v2/secrets_test.go @@ -24,9 +24,9 @@ import ( sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk" "github.com/smartcontractkit/chainlink-protos/cre/go/values" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" coreCap "github.com/smartcontractkit/chainlink/v2/core/capabilities" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/monitoring" diff --git a/core/web/aptos_keys_controller.go b/core/web/aptos_keys_controller.go index 5be4b815773..e236f2d1c59 100644 --- a/core/web/aptos_keys_controller.go +++ b/core/web/aptos_keys_controller.go @@ -1,8 +1,8 @@ package web import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/cosmos_keys_controller.go b/core/web/cosmos_keys_controller.go index 281cf3dd3c9..83f6a48e6ba 100644 --- a/core/web/cosmos_keys_controller.go +++ b/core/web/cosmos_keys_controller.go @@ -1,8 +1,8 @@ package web import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/eth_keys_controller.go b/core/web/eth_keys_controller.go index 94dc42f13cd..619c717f111 100644 --- a/core/web/eth_keys_controller.go +++ b/core/web/eth_keys_controller.go @@ -10,6 +10,7 @@ import ( "strconv" "strings" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/pkg/assets" @@ -19,7 +20,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" evmrelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" diff --git a/core/web/eth_keys_controller_test.go b/core/web/eth_keys_controller_test.go index 5effbcbd6e6..dd756f86de2 100644 --- a/core/web/eth_keys_controller_test.go +++ b/core/web/eth_keys_controller_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/client/clienttest" @@ -22,7 +23,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest" "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" webpresenters "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/jobs_controller_test.go b/core/web/jobs_controller_test.go index ba4ff8bcbf4..7503318419f 100644 --- a/core/web/jobs_controller_test.go +++ b/core/web/jobs_controller_test.go @@ -26,6 +26,8 @@ import ( "github.com/smartcontractkit/freeport" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-evm/pkg/client/clienttest" @@ -36,8 +38,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/directrequest" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/testdata/testspecs" "github.com/smartcontractkit/chainlink/v2/core/utils/tomlutils" "github.com/smartcontractkit/chainlink/v2/core/web" diff --git a/core/web/p2p_keys_controller.go b/core/web/p2p_keys_controller.go index 20126c4f3a8..d3188634ae6 100644 --- a/core/web/p2p_keys_controller.go +++ b/core/web/p2p_keys_controller.go @@ -6,9 +6,9 @@ import ( "github.com/gin-gonic/gin" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/logger/audit" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/p2p_keys_controller_test.go b/core/web/p2p_keys_controller_test.go index af1ff49b957..2e2726c0b97 100644 --- a/core/web/p2p_keys_controller_test.go +++ b/core/web/p2p_keys_controller_test.go @@ -4,11 +4,11 @@ import ( "net/http" "testing" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/web" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" diff --git a/core/web/presenters/aptos_key.go b/core/web/presenters/aptos_key.go index 8c0c09ed10a..a166938df8b 100644 --- a/core/web/presenters/aptos_key.go +++ b/core/web/presenters/aptos_key.go @@ -1,6 +1,6 @@ package presenters -import "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" +import "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" // AptosKeyResource represents a Aptos key JSONAPI resource. type AptosKeyResource struct { diff --git a/core/web/presenters/cosmos_key.go b/core/web/presenters/cosmos_key.go index 642bdadc7c3..b752fbd7d70 100644 --- a/core/web/presenters/cosmos_key.go +++ b/core/web/presenters/cosmos_key.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" ) // CosmosKeyResource represents a Cosmos key JSONAPI resource. diff --git a/core/web/presenters/csa_key.go b/core/web/presenters/csa_key.go index 58cdb5a212a..49e0338f26a 100644 --- a/core/web/presenters/csa_key.go +++ b/core/web/presenters/csa_key.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" ) // CSAKeyResource represents a CSA key JSONAPI resource. diff --git a/core/web/presenters/csa_key_test.go b/core/web/presenters/csa_key_test.go index d514519fafd..00c772b1196 100644 --- a/core/web/presenters/csa_key_test.go +++ b/core/web/presenters/csa_key_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" ) func TestCSAKeyResource(t *testing.T) { diff --git a/core/web/presenters/dkg_recipient_key.go b/core/web/presenters/dkg_recipient_key.go index 61deafc31c4..66b5620aecd 100644 --- a/core/web/presenters/dkg_recipient_key.go +++ b/core/web/presenters/dkg_recipient_key.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" ) type DKGRecipientKeyResource struct { diff --git a/core/web/presenters/job_test.go b/core/web/presenters/job_test.go index 1327476f17f..a20a8a31e78 100644 --- a/core/web/presenters/job_test.go +++ b/core/web/presenters/job_test.go @@ -13,14 +13,14 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" evmassets "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/types" clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/presenters/ocr_keys.go b/core/web/presenters/ocr_keys.go index 8988971063e..71a6b34c9c1 100644 --- a/core/web/presenters/ocr_keys.go +++ b/core/web/presenters/ocr_keys.go @@ -5,8 +5,8 @@ import ( "fmt" "sort" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" ) // OCRKeysBundleResource represents a bundle of OCRs keys as JSONAPI resource diff --git a/core/web/presenters/p2p_key.go b/core/web/presenters/p2p_key.go index 963e991ff75..372501ba064 100644 --- a/core/web/presenters/p2p_key.go +++ b/core/web/presenters/p2p_key.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) // P2PKeyResource represents a P2P key JSONAPI resource. diff --git a/core/web/presenters/p2p_key_test.go b/core/web/presenters/p2p_key_test.go index 2d6d307f207..2e033c57b4d 100644 --- a/core/web/presenters/p2p_key_test.go +++ b/core/web/presenters/p2p_key_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) func TestP2PKeyResource(t *testing.T) { diff --git a/core/web/presenters/solana_key.go b/core/web/presenters/solana_key.go index 76805c68438..e011652c3bb 100644 --- a/core/web/presenters/solana_key.go +++ b/core/web/presenters/solana_key.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" ) // SolanaKeyResource represents a Solana key JSONAPI resource. diff --git a/core/web/presenters/starknet_key.go b/core/web/presenters/starknet_key.go index 1ac98de87e2..1219722e9ab 100644 --- a/core/web/presenters/starknet_key.go +++ b/core/web/presenters/starknet_key.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" ) // StarkNetKeyResource represents a StarkNet key JSONAPI resource. diff --git a/core/web/presenters/sui_key.go b/core/web/presenters/sui_key.go index 93168f6f2a8..eed27d32732 100644 --- a/core/web/presenters/sui_key.go +++ b/core/web/presenters/sui_key.go @@ -1,6 +1,6 @@ package presenters -import "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" +import "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" // SuiKeyResource represents a Sui key JSONAPI resource. type SuiKeyResource struct { diff --git a/core/web/presenters/ton_key.go b/core/web/presenters/ton_key.go index 172523b1643..274ae919fe1 100644 --- a/core/web/presenters/ton_key.go +++ b/core/web/presenters/ton_key.go @@ -1,6 +1,6 @@ package presenters -import "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" +import "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" // TONKeyResource represents a TON key JSONAPI resource. type TONKeyResource struct { diff --git a/core/web/presenters/tron_key.go b/core/web/presenters/tron_key.go index abe74ed7f41..ccb09125405 100644 --- a/core/web/presenters/tron_key.go +++ b/core/web/presenters/tron_key.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" ) // TronKeyResource represents a Tron key JSONAPI resource. diff --git a/core/web/presenters/vrf_key.go b/core/web/presenters/vrf_key.go index 61dec5ebb0c..f3896665b8b 100644 --- a/core/web/presenters/vrf_key.go +++ b/core/web/presenters/vrf_key.go @@ -1,8 +1,8 @@ package presenters import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/logger" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" ) type VRFKeyResource struct { diff --git a/core/web/presenters/workflow_key.go b/core/web/presenters/workflow_key.go index a8d3a9c2373..fba3143e6d6 100644 --- a/core/web/presenters/workflow_key.go +++ b/core/web/presenters/workflow_key.go @@ -1,7 +1,7 @@ package presenters import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" ) type WorkflowKeyResource struct { diff --git a/core/web/resolver/aptos_key.go b/core/web/resolver/aptos_key.go index 862f7b57fc7..f1e13afc566 100644 --- a/core/web/resolver/aptos_key.go +++ b/core/web/resolver/aptos_key.go @@ -3,7 +3,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" ) type AptosKeyResolver struct { diff --git a/core/web/resolver/aptos_key_test.go b/core/web/resolver/aptos_key_test.go index e0dcb2a4194..260f6c40085 100644 --- a/core/web/resolver/aptos_key_test.go +++ b/core/web/resolver/aptos_key_test.go @@ -8,8 +8,8 @@ import ( gqlerrors "github.com/graph-gophers/graphql-go/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/aptoskey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/aptoskey" ) func TestResolver_AptosKeys(t *testing.T) { diff --git a/core/web/resolver/cosmos_key.go b/core/web/resolver/cosmos_key.go index 42a0464b97b..11f11079a6c 100644 --- a/core/web/resolver/cosmos_key.go +++ b/core/web/resolver/cosmos_key.go @@ -3,7 +3,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" ) type CosmosKeyResolver struct { diff --git a/core/web/resolver/cosmos_key_test.go b/core/web/resolver/cosmos_key_test.go index c970edc0949..273900cb933 100644 --- a/core/web/resolver/cosmos_key_test.go +++ b/core/web/resolver/cosmos_key_test.go @@ -8,8 +8,8 @@ import ( gqlerrors "github.com/graph-gophers/graphql-go/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/cosmoskey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/cosmoskey" ) func TestResolver_CosmosKeys(t *testing.T) { diff --git a/core/web/resolver/csa_keys.go b/core/web/resolver/csa_keys.go index be4eb4ebb4c..89f30af30dd 100644 --- a/core/web/resolver/csa_keys.go +++ b/core/web/resolver/csa_keys.go @@ -4,8 +4,8 @@ import ( "github.com/graph-gophers/graphql-go" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ) // CSAKeyResolver resolves the single CSA Key object diff --git a/core/web/resolver/csa_keys_test.go b/core/web/resolver/csa_keys_test.go index ae7c1986c85..44a3149d908 100644 --- a/core/web/resolver/csa_keys_test.go +++ b/core/web/resolver/csa_keys_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" ) type expectedKey struct { diff --git a/core/web/resolver/eth_key.go b/core/web/resolver/eth_key.go index f3ee8ca9b61..e29885b172b 100644 --- a/core/web/resolver/eth_key.go +++ b/core/web/resolver/eth_key.go @@ -8,9 +8,9 @@ import ( commonTypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/v2/core/web/loader" ) diff --git a/core/web/resolver/mutation.go b/core/web/resolver/mutation.go index 9438ec41e0b..56d19e52817 100644 --- a/core/web/resolver/mutation.go +++ b/core/web/resolver/mutation.go @@ -16,6 +16,10 @@ import ( "github.com/smartcontractkit/chainlink-common/keystore/corekeys" "github.com/smartcontractkit/chainlink-common/pkg/assets" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/auth" "github.com/smartcontractkit/chainlink/v2/core/bridges" ccip "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate" @@ -34,10 +38,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keeper" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" diff --git a/core/web/resolver/ocr.go b/core/web/resolver/ocr.go index 90ba38e1d07..3bace7d5e54 100644 --- a/core/web/resolver/ocr.go +++ b/core/web/resolver/ocr.go @@ -4,8 +4,8 @@ import ( "github.com/graph-gophers/graphql-go" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" ) type OCRKeyBundleResolver struct { diff --git a/core/web/resolver/ocr2_keys.go b/core/web/resolver/ocr2_keys.go index 5d5a66fa9aa..0758aa37764 100644 --- a/core/web/resolver/ocr2_keys.go +++ b/core/web/resolver/ocr2_keys.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" ) // OCR2ChainType defines OCR2 Chain Types accepted on this resolver diff --git a/core/web/resolver/ocr2_keys_test.go b/core/web/resolver/ocr2_keys_test.go index 9271fac41fd..1673811ad71 100644 --- a/core/web/resolver/ocr2_keys_test.go +++ b/core/web/resolver/ocr2_keys_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/require" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" ) func TestResolver_GetOCR2KeyBundles(t *testing.T) { diff --git a/core/web/resolver/ocr_test.go b/core/web/resolver/ocr_test.go index 6a6cfea3d4d..ee6f628e446 100644 --- a/core/web/resolver/ocr_test.go +++ b/core/web/resolver/ocr_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocrkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" ) func TestResolver_GetOCRKeyBundles(t *testing.T) { diff --git a/core/web/resolver/p2p.go b/core/web/resolver/p2p.go index b441a70a817..b745a6409dc 100644 --- a/core/web/resolver/p2p.go +++ b/core/web/resolver/p2p.go @@ -4,8 +4,8 @@ import ( "github.com/graph-gophers/graphql-go" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type P2PKeyResolver struct { diff --git a/core/web/resolver/p2p_test.go b/core/web/resolver/p2p_test.go index 7b53f9d34df..964d43028cd 100644 --- a/core/web/resolver/p2p_test.go +++ b/core/web/resolver/p2p_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestResolver_GetP2PKeys(t *testing.T) { diff --git a/core/web/resolver/query.go b/core/web/resolver/query.go index 301a1169550..7f35e83cd47 100644 --- a/core/web/resolver/query.go +++ b/core/web/resolver/query.go @@ -16,10 +16,10 @@ import ( "github.com/smartcontractkit/chainlink-evm/pkg/chains" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/bridges" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" evmrelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" "github.com/smartcontractkit/chainlink/v2/core/utils/stringutils" "github.com/smartcontractkit/chainlink/v2/core/web/loader" diff --git a/core/web/resolver/solana_key.go b/core/web/resolver/solana_key.go index 1d2d7845915..222c6200169 100644 --- a/core/web/resolver/solana_key.go +++ b/core/web/resolver/solana_key.go @@ -3,7 +3,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" ) type SolanaKeyResolver struct { diff --git a/core/web/resolver/solana_key_test.go b/core/web/resolver/solana_key_test.go index 9ef5cd85a42..10f5d08a2b4 100644 --- a/core/web/resolver/solana_key_test.go +++ b/core/web/resolver/solana_key_test.go @@ -8,8 +8,8 @@ import ( gqlerrors "github.com/graph-gophers/graphql-go/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" ) func TestResolver_SolanaKeys(t *testing.T) { diff --git a/core/web/resolver/spec_test.go b/core/web/resolver/spec_test.go index d7a595a5004..d865b4cb9dc 100644 --- a/core/web/resolver/spec_test.go +++ b/core/web/resolver/spec_test.go @@ -12,16 +12,16 @@ import ( "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-evm/pkg/assets" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) diff --git a/core/web/resolver/starknet_key.go b/core/web/resolver/starknet_key.go index a3835e5153a..71e205541b3 100644 --- a/core/web/resolver/starknet_key.go +++ b/core/web/resolver/starknet_key.go @@ -3,7 +3,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" ) type StarkNetKeyResolver struct { diff --git a/core/web/resolver/starknet_key_test.go b/core/web/resolver/starknet_key_test.go index 42d5943a2c4..69e5a27e65a 100644 --- a/core/web/resolver/starknet_key_test.go +++ b/core/web/resolver/starknet_key_test.go @@ -8,8 +8,8 @@ import ( gqlerrors "github.com/graph-gophers/graphql-go/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" ) func TestResolver_StarkNetKeys(t *testing.T) { diff --git a/core/web/resolver/sui_key.go b/core/web/resolver/sui_key.go index d4ff95b845b..2fc42ff5761 100644 --- a/core/web/resolver/sui_key.go +++ b/core/web/resolver/sui_key.go @@ -3,7 +3,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" ) type SuiKeyResolver struct { diff --git a/core/web/resolver/sui_key_test.go b/core/web/resolver/sui_key_test.go index c1b66ad100c..3771555ec22 100644 --- a/core/web/resolver/sui_key_test.go +++ b/core/web/resolver/sui_key_test.go @@ -8,8 +8,8 @@ import ( gqlerrors "github.com/graph-gophers/graphql-go/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" ) func TestResolver_SuiKeys(t *testing.T) { diff --git a/core/web/resolver/ton_key.go b/core/web/resolver/ton_key.go index 738c3fce7ff..729ba52dc58 100644 --- a/core/web/resolver/ton_key.go +++ b/core/web/resolver/ton_key.go @@ -3,7 +3,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" ) type TONKeyResolver struct { diff --git a/core/web/resolver/ton_key_test.go b/core/web/resolver/ton_key_test.go index 7e286cd4d26..d4010e4daa6 100644 --- a/core/web/resolver/ton_key_test.go +++ b/core/web/resolver/ton_key_test.go @@ -8,8 +8,8 @@ import ( gqlerrors "github.com/graph-gophers/graphql-go/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" ) func TestResolver_TONKeys(t *testing.T) { diff --git a/core/web/resolver/tron_key.go b/core/web/resolver/tron_key.go index d42ed2071c4..c31415c8013 100644 --- a/core/web/resolver/tron_key.go +++ b/core/web/resolver/tron_key.go @@ -3,7 +3,7 @@ package resolver import ( "github.com/graph-gophers/graphql-go" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" ) type TronKeyResolver struct { diff --git a/core/web/resolver/tron_key_test.go b/core/web/resolver/tron_key_test.go index 3b2b7892f50..6b37cfae1ed 100644 --- a/core/web/resolver/tron_key_test.go +++ b/core/web/resolver/tron_key_test.go @@ -8,8 +8,8 @@ import ( gqlerrors "github.com/graph-gophers/graphql-go/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/keystest" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" ) func TestResolver_TronKeys(t *testing.T) { diff --git a/core/web/resolver/vrf.go b/core/web/resolver/vrf.go index d6b16352e11..b3d7090f4f9 100644 --- a/core/web/resolver/vrf.go +++ b/core/web/resolver/vrf.go @@ -4,8 +4,8 @@ import ( "github.com/graph-gophers/graphql-go" "github.com/pkg/errors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" ) type VRFKeyResolver struct { diff --git a/core/web/resolver/vrf_test.go b/core/web/resolver/vrf_test.go index 7001c68467d..e2ee97592be 100644 --- a/core/web/resolver/vrf_test.go +++ b/core/web/resolver/vrf_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey" ) func TestResolver_GetVRFKey(t *testing.T) { diff --git a/core/web/solana_keys_controller.go b/core/web/solana_keys_controller.go index 9fe62fc907c..41b3c6bb020 100644 --- a/core/web/solana_keys_controller.go +++ b/core/web/solana_keys_controller.go @@ -1,8 +1,8 @@ package web import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/starknet_keys_controller.go b/core/web/starknet_keys_controller.go index a7968e165b7..31a23f1f8f9 100644 --- a/core/web/starknet_keys_controller.go +++ b/core/web/starknet_keys_controller.go @@ -1,8 +1,8 @@ package web import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/starkkey" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/starkkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/sui_keys_controller.go b/core/web/sui_keys_controller.go index 19e6860fbe6..8a1805a2a31 100644 --- a/core/web/sui_keys_controller.go +++ b/core/web/sui_keys_controller.go @@ -1,8 +1,8 @@ package web import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/suikey" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/suikey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/ton_keys_controller.go b/core/web/ton_keys_controller.go index f80d0cf3763..abda4e742c2 100644 --- a/core/web/ton_keys_controller.go +++ b/core/web/ton_keys_controller.go @@ -1,8 +1,8 @@ package web import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tonkey" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tonkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/tron_keys_controller.go b/core/web/tron_keys_controller.go index e9ac2e0252e..f0719dc3978 100644 --- a/core/web/tron_keys_controller.go +++ b/core/web/tron_keys_controller.go @@ -1,8 +1,8 @@ package web import ( + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/tronkey" "github.com/smartcontractkit/chainlink/v2/core/web/presenters" ) diff --git a/core/web/vault_controller_test.go b/core/web/vault_controller_test.go index e3d18fd60d7..c27d68542ab 100644 --- a/core/web/vault_controller_test.go +++ b/core/web/vault_controller_test.go @@ -16,10 +16,10 @@ import ( "github.com/smartcontractkit/smdkg/dkgocr/tdh2shim" "github.com/smartcontractkit/smdkg/dummydkg" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/vault" "github.com/smartcontractkit/chainlink/v2/core/web" ) diff --git a/deployment/ccip/changeset/testhelpers/test_environment.go b/deployment/ccip/changeset/testhelpers/test_environment.go index 73b8f9dfec1..2aeeebfc236 100644 --- a/deployment/ccip/changeset/testhelpers/test_environment.go +++ b/deployment/ccip/changeset/testhelpers/test_environment.go @@ -73,6 +73,7 @@ import ( cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/globals" ccipChangeSetSolana "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/solana_v0_1_0" @@ -83,7 +84,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) const ( diff --git a/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go b/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go index 7942cb5500d..f682c21ff4b 100644 --- a/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go +++ b/deployment/ccip/changeset/v1_6/cs_update_rmn_config.go @@ -20,6 +20,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_home" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_remote" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ccipseq "github.com/smartcontractkit/chainlink/deployment/ccip/sequence/evm/v1_6" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/ccip/shared/deployergroup" @@ -27,7 +28,6 @@ import ( commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" opsutil "github.com/smartcontractkit/chainlink/deployment/common/opsutils" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var ( diff --git a/deployment/ccip/view/v1_6/ccip_home.go b/deployment/ccip/view/v1_6/ccip_home.go index fff8065ec74..f651604b6e7 100644 --- a/deployment/ccip/view/v1_6/ccip_home.go +++ b/deployment/ccip/view/v1_6/ccip_home.go @@ -18,10 +18,10 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/ccip_home" capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/ccip/shared" "github.com/smartcontractkit/chainlink/deployment/common/view/types" cciptypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type DonView struct { diff --git a/deployment/ccip/view/v1_6/rmnhome.go b/deployment/ccip/view/v1_6/rmnhome.go index 26bb58ed4d2..67531691b08 100644 --- a/deployment/ccip/view/v1_6/rmnhome.go +++ b/deployment/ccip/view/v1_6/rmnhome.go @@ -9,8 +9,8 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_0/rmn_home" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/common/view/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type RMNHomeView struct { diff --git a/deployment/common/view/nops_test.go b/deployment/common/view/nops_test.go index 05599360f3f..b42323e54f7 100644 --- a/deployment/common/view/nops_test.go +++ b/deployment/common/view/nops_test.go @@ -10,12 +10,12 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/logger" nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/shared/ptypes" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/environment/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestGenerateNopsView(t *testing.T) { diff --git a/deployment/common/view/v1_0/capreg.go b/deployment/common/view/v1_0/capreg.go index 31c38152b45..7ffc954f14a 100644 --- a/deployment/common/view/v1_0/capreg.go +++ b/deployment/common/view/v1_0/capreg.go @@ -10,9 +10,9 @@ import ( "github.com/ethereum/go-ethereum/common" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/deployment/common/view/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) // CapabilityRegistryView is a high-fidelity view of the capabilities registry contract. diff --git a/deployment/common/view/v2_0/capreg.go b/deployment/common/view/v2_0/capreg.go index 864f3325a07..cde8cd0a878 100644 --- a/deployment/common/view/v2_0/capreg.go +++ b/deployment/common/view/v2_0/capreg.go @@ -16,8 +16,8 @@ import ( capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/common/view/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type CapabilityRegistryViewV2 struct { diff --git a/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry.go b/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry.go index e73c20f6849..32d0df90c5a 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry.go +++ b/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry.go @@ -10,6 +10,7 @@ import ( capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/operations/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" @@ -17,7 +18,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/common/strategies" crecontracts "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/ocr3" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var _ cldf.ChangeSetV2[ConfigureCapabilitiesRegistryInput] = ConfigureCapabilitiesRegistry{} diff --git a/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry_test.go b/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry_test.go index 6ce1eaf0a64..e267d0e8ebd 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/configure_capabilities_registry_test.go @@ -22,6 +22,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" commontypes "github.com/smartcontractkit/chainlink/deployment/common/types" @@ -30,7 +31,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" crecontracts "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/ocr3" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type testFixture struct { diff --git a/deployment/cre/capabilities_registry/v2/changeset/expand_ocr3_configs_test.go b/deployment/cre/capabilities_registry/v2/changeset/expand_ocr3_configs_test.go index 61437d2de1c..c8e6034869f 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/expand_ocr3_configs_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/expand_ocr3_configs_test.go @@ -21,7 +21,7 @@ import ( nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/shared/ptypes" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) // --------------------------------------------------------------------------- diff --git a/deployment/cre/capabilities_registry/v2/changeset/operations/contracts/update_don.go b/deployment/cre/capabilities_registry/v2/changeset/operations/contracts/update_don.go index ae5e74c578d..3068aeeecfe 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/operations/contracts/update_don.go +++ b/deployment/cre/capabilities_registry/v2/changeset/operations/contracts/update_don.go @@ -11,10 +11,10 @@ import ( "github.com/ethereum/go-ethereum/core/types" mcmstypes "github.com/smartcontractkit/mcms/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/operations" capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" "github.com/smartcontractkit/chainlink/deployment/cre/common/strategies" diff --git a/deployment/cre/capabilities_registry/v2/changeset/operations/contracts/update_nodes.go b/deployment/cre/capabilities_registry/v2/changeset/operations/contracts/update_nodes.go index 2d5f2954885..2c93e645c4d 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/operations/contracts/update_nodes.go +++ b/deployment/cre/capabilities_registry/v2/changeset/operations/contracts/update_nodes.go @@ -15,10 +15,10 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" "github.com/smartcontractkit/chainlink/deployment/cre/common/strategies" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type UpdateNodesDeps struct { diff --git a/deployment/cre/capabilities_registry/v2/changeset/pkg/p2p_ids.go b/deployment/cre/capabilities_registry/v2/changeset/pkg/p2p_ids.go index bfb2ebfa3a2..221c18ee611 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/pkg/p2p_ids.go +++ b/deployment/cre/capabilities_registry/v2/changeset/pkg/p2p_ids.go @@ -1,7 +1,7 @@ package pkg import ( - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) func PeerIDsToBytes(p2pIDs []p2pkey.PeerID) [][32]byte { diff --git a/deployment/cre/capabilities_registry/v2/changeset/sequences/add_capabilities.go b/deployment/cre/capabilities_registry/v2/changeset/sequences/add_capabilities.go index 9b4edb9cee3..d75fa690978 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/sequences/add_capabilities.go +++ b/deployment/cre/capabilities_registry/v2/changeset/sequences/add_capabilities.go @@ -16,11 +16,11 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/operations/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/common/strategies" crecontracts "github.com/smartcontractkit/chainlink/deployment/cre/contracts" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type AddCapabilitiesDeps struct { diff --git a/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go b/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go index 9a43b9283f9..5d0d99ccae6 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go +++ b/deployment/cre/capabilities_registry/v2/changeset/set_dons_families_test.go @@ -10,12 +10,12 @@ import ( commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/common/view/v2_0" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/sequences" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestSetDONsFamilies_VerifyPreconditions(t *testing.T) { diff --git a/deployment/cre/capabilities_registry/v2/changeset/types.go b/deployment/cre/capabilities_registry/v2/changeset/types.go index 01a24cd93a9..d0cdbdee5d7 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/types.go +++ b/deployment/cre/capabilities_registry/v2/changeset/types.go @@ -8,9 +8,9 @@ import ( capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/operations/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type CapabilitiesRegistryNodeOperator struct { diff --git a/deployment/cre/capabilities_registry/v2/changeset/update_don.go b/deployment/cre/capabilities_registry/v2/changeset/update_don.go index f5e4f505e50..13abcd5cab9 100644 --- a/deployment/cre/capabilities_registry/v2/changeset/update_don.go +++ b/deployment/cre/capabilities_registry/v2/changeset/update_don.go @@ -12,6 +12,7 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations" capabilities_registry_v2 "github.com/smartcontractkit/chainlink-evm/gethwrappers/workflow/generated/capabilities_registry_wrapper_v2" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset/state" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/operations/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/capabilities_registry/v2/changeset/pkg" @@ -19,7 +20,6 @@ import ( "github.com/smartcontractkit/chainlink/deployment/cre/common/strategies" crecontracts "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink/deployment/cre/ocr3" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var _ cldf.ChangeSetV2[UpdateDONInput] = UpdateDON{} diff --git a/deployment/cre/ocr3/config_test.go b/deployment/cre/ocr3/config_test.go index 78418a69db4..155862e650c 100644 --- a/deployment/cre/ocr3/config_test.go +++ b/deployment/cre/ocr3/config_test.go @@ -14,10 +14,10 @@ import ( types3 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-deployments-framework/offchain/ocr" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/view" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var wantOCR3Config = `{ diff --git a/deployment/cre/ocr3/ocr3_1/config_test.go b/deployment/cre/ocr3/ocr3_1/config_test.go index 485e44b87b4..65b7e6a9335 100644 --- a/deployment/cre/ocr3/ocr3_1/config_test.go +++ b/deployment/cre/ocr3/ocr3_1/config_test.go @@ -15,9 +15,9 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/offchain/ocr" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/view" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var wantOCR3_1Config = `{ diff --git a/deployment/cre/ocr3/types_test.go b/deployment/cre/ocr3/types_test.go index 0f3a0e1908c..de814c2250a 100644 --- a/deployment/cre/ocr3/types_test.go +++ b/deployment/cre/ocr3/types_test.go @@ -13,8 +13,8 @@ import ( "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func Test_toNodeKeys(t *testing.T) { diff --git a/deployment/cre/test/dons.go b/deployment/cre/test/dons.go index 862f7e7ad1e..b0db1a0c935 100644 --- a/deployment/cre/test/dons.go +++ b/deployment/cre/test/dons.go @@ -3,7 +3,7 @@ package test import ( chain_selectors "github.com/smartcontractkit/chain-selectors" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" ) diff --git a/deployment/cre/test/p2p_ids.go b/deployment/cre/test/p2p_ids.go index 29593a9c7a2..e38329ee5bf 100644 --- a/deployment/cre/test/p2p_ids.go +++ b/deployment/cre/test/p2p_ids.go @@ -1,6 +1,6 @@ package test -import "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" +import "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" // P2PIDs is a slice of p2pkey.PeerID with convenient transform methods. type P2PIDs []p2pkey.PeerID diff --git a/deployment/environment.go b/deployment/environment.go index 1c500c7ba60..a3e924b7b44 100644 --- a/deployment/environment.go +++ b/deployment/environment.go @@ -24,7 +24,7 @@ import ( nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/shared/ptypes" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) func UBigInt(i uint64) *big.Int { diff --git a/deployment/environment/crib/ccip_deployer.go b/deployment/environment/crib/ccip_deployer.go index 8442e27f8ab..4e812c8554d 100644 --- a/deployment/environment/crib/ccip_deployer.go +++ b/deployment/environment/crib/ccip_deployer.go @@ -24,10 +24,10 @@ import ( evm_fee_quoter "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_6_3/fee_quoter" cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" "github.com/smartcontractkit/chainlink-ccip/pluginconfig" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-common/pkg/logger" cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset" diff --git a/deployment/environment/test/jd.go b/deployment/environment/test/jd.go index e1037780f80..bc1a2e08713 100644 --- a/deployment/environment/test/jd.go +++ b/deployment/environment/test/jd.go @@ -16,7 +16,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) var _ nodev1.NodeServiceClient = (*JDNodeService)(nil) diff --git a/deployment/environment/test/jd_test.go b/deployment/environment/test/jd_test.go index 3a06dbc452f..65f6f003cc6 100644 --- a/deployment/environment/test/jd_test.go +++ b/deployment/environment/test/jd_test.go @@ -12,11 +12,11 @@ import ( types2 "github.com/smartcontractkit/libocr/offchainreporting2/types" types3 "github.com/smartcontractkit/libocr/offchainreporting2plus/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/shared/ptypes" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/environment/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestJDNodeService_GetNode(t *testing.T) { diff --git a/deployment/environment/test/nodes.go b/deployment/environment/test/nodes.go index d4cae900456..9a7db2d16f4 100644 --- a/deployment/environment/test/nodes.go +++ b/deployment/environment/test/nodes.go @@ -13,12 +13,12 @@ import ( chain_selectors "github.com/smartcontractkit/chain-selectors" types2 "github.com/smartcontractkit/libocr/offchainreporting2/types" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/shared/ptypes" "github.com/smartcontractkit/chainlink/deployment" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" ) type NodeConfig struct { diff --git a/deployment/environment_test.go b/deployment/environment_test.go index 4e1593ceecd..49df6a0182b 100644 --- a/deployment/environment_test.go +++ b/deployment/environment_test.go @@ -15,8 +15,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestNode_OCRConfigForChainSelector(t *testing.T) { diff --git a/deployment/go.sum b/deployment/go.sum index 20939dc147c..5e67e2be632 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1373,6 +1373,7 @@ github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= diff --git a/deployment/keystone/changeset/add_dons.go b/deployment/keystone/changeset/add_dons.go index 072362289b6..c50cdc1e19b 100644 --- a/deployment/keystone/changeset/add_dons.go +++ b/deployment/keystone/changeset/add_dons.go @@ -18,10 +18,10 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/datastore" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var _ cldf.ChangeSet[*AddDonsRequest] = AddDons diff --git a/deployment/keystone/changeset/add_dons_test.go b/deployment/keystone/changeset/add_dons_test.go index 205417e09df..513b04679d2 100644 --- a/deployment/keystone/changeset/add_dons_test.go +++ b/deployment/keystone/changeset/add_dons_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestAddDONs(t *testing.T) { diff --git a/deployment/keystone/changeset/add_nodes_test.go b/deployment/keystone/changeset/add_nodes_test.go index 4e57534c664..3a1859cf721 100644 --- a/deployment/keystone/changeset/add_nodes_test.go +++ b/deployment/keystone/changeset/add_nodes_test.go @@ -11,10 +11,10 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type mcmsTestCase struct { diff --git a/deployment/keystone/changeset/append_node_capabilities_test.go b/deployment/keystone/changeset/append_node_capabilities_test.go index 2dac32a33e7..fd3079ffab6 100644 --- a/deployment/keystone/changeset/append_node_capabilities_test.go +++ b/deployment/keystone/changeset/append_node_capabilities_test.go @@ -8,11 +8,11 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestAppendNodeCapabilities(t *testing.T) { diff --git a/deployment/keystone/changeset/internal/append_node_capabilities.go b/deployment/keystone/changeset/internal/append_node_capabilities.go index 0582861b81f..0094fd5dbe1 100644 --- a/deployment/keystone/changeset/internal/append_node_capabilities.go +++ b/deployment/keystone/changeset/internal/append_node_capabilities.go @@ -10,7 +10,7 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) type AppendNodeCapabilitiesRequest struct { diff --git a/deployment/keystone/changeset/internal/append_node_capabilities_test.go b/deployment/keystone/changeset/internal/append_node_capabilities_test.go index ce2807b14b1..15ee341fbba 100644 --- a/deployment/keystone/changeset/internal/append_node_capabilities_test.go +++ b/deployment/keystone/changeset/internal/append_node_capabilities_test.go @@ -14,8 +14,8 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestAppendNodeCapabilities(t *testing.T) { diff --git a/deployment/keystone/changeset/internal/deploy_test.go b/deployment/keystone/changeset/internal/deploy_test.go index 439d3b9eb40..762fe66df28 100644 --- a/deployment/keystone/changeset/internal/deploy_test.go +++ b/deployment/keystone/changeset/internal/deploy_test.go @@ -19,10 +19,10 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func Test_RegisterNOPS(t *testing.T) { diff --git a/deployment/keystone/changeset/internal/remove_dons_test.go b/deployment/keystone/changeset/internal/remove_dons_test.go index 2608e571207..e3b2489d22a 100644 --- a/deployment/keystone/changeset/internal/remove_dons_test.go +++ b/deployment/keystone/changeset/internal/remove_dons_test.go @@ -16,11 +16,11 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/helpers/pointer" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func Test_RemoveDONsRequest_validate(t *testing.T) { diff --git a/deployment/keystone/changeset/internal/types.go b/deployment/keystone/changeset/internal/types.go index 2aaa35e2009..46a83e13863 100644 --- a/deployment/keystone/changeset/internal/types.go +++ b/deployment/keystone/changeset/internal/types.go @@ -22,7 +22,7 @@ import ( capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) var ( diff --git a/deployment/keystone/changeset/internal/update_don.go b/deployment/keystone/changeset/internal/update_don.go index 5192c2cb914..ecc7fb0d334 100644 --- a/deployment/keystone/changeset/internal/update_don.go +++ b/deployment/keystone/changeset/internal/update_don.go @@ -20,8 +20,8 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) // CapabilityConfig is a struct that holds a capability and its configuration diff --git a/deployment/keystone/changeset/internal/update_don_test.go b/deployment/keystone/changeset/internal/update_don_test.go index b2733bb2d45..b4c2ef9a412 100644 --- a/deployment/keystone/changeset/internal/update_don_test.go +++ b/deployment/keystone/changeset/internal/update_don_test.go @@ -21,11 +21,11 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" kscs "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var ( diff --git a/deployment/keystone/changeset/internal/update_node_capabilities.go b/deployment/keystone/changeset/internal/update_node_capabilities.go index 60faa6dd6df..7baca607e9b 100644 --- a/deployment/keystone/changeset/internal/update_node_capabilities.go +++ b/deployment/keystone/changeset/internal/update_node_capabilities.go @@ -9,7 +9,7 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) type UpdateNodeCapabilitiesImplRequest struct { diff --git a/deployment/keystone/changeset/internal/update_node_capabilities_test.go b/deployment/keystone/changeset/internal/update_node_capabilities_test.go index 9b155cd19fa..421c1253dd7 100644 --- a/deployment/keystone/changeset/internal/update_node_capabilities_test.go +++ b/deployment/keystone/changeset/internal/update_node_capabilities_test.go @@ -11,9 +11,9 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestUpdateNodeCapabilities(t *testing.T) { diff --git a/deployment/keystone/changeset/internal/update_nodes.go b/deployment/keystone/changeset/internal/update_nodes.go index 5e512513f1f..86695b1a8a5 100644 --- a/deployment/keystone/changeset/internal/update_nodes.go +++ b/deployment/keystone/changeset/internal/update_nodes.go @@ -18,8 +18,8 @@ import ( cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type NodeUpdate struct { diff --git a/deployment/keystone/changeset/internal/update_nodes_test.go b/deployment/keystone/changeset/internal/update_nodes_test.go index 20b5d45bae8..3cba1d24dde 100644 --- a/deployment/keystone/changeset/internal/update_nodes_test.go +++ b/deployment/keystone/changeset/internal/update_nodes_test.go @@ -25,9 +25,9 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/onchain" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func Test_UpdateNodesRequest_validate(t *testing.T) { diff --git a/deployment/keystone/changeset/operations/contracts/add_capabilites_op.go b/deployment/keystone/changeset/operations/contracts/add_capabilites_op.go index e1228b7dd64..d85b757b42f 100644 --- a/deployment/keystone/changeset/operations/contracts/add_capabilites_op.go +++ b/deployment/keystone/changeset/operations/contracts/add_capabilites_op.go @@ -15,9 +15,9 @@ import ( capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type AddCapabilitiesOpDeps struct { diff --git a/deployment/keystone/changeset/operations/contracts/add_capabilities_op_test.go b/deployment/keystone/changeset/operations/contracts/add_capabilities_op_test.go index 99d6b074eab..9ffa65c4193 100644 --- a/deployment/keystone/changeset/operations/contracts/add_capabilities_op_test.go +++ b/deployment/keystone/changeset/operations/contracts/add_capabilities_op_test.go @@ -6,13 +6,13 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink-deployments-framework/operations/optest" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/operations/contracts" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func doAppendCapabilitiesOp(t *testing.T, useMcms bool) { diff --git a/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq.go b/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq.go index 287c88d88fd..a073a713a1d 100644 --- a/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq.go +++ b/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq.go @@ -19,6 +19,7 @@ import ( capabilities_registry "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" forwarder "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/forwarder_1_0_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" mcmsOps "github.com/smartcontractkit/chainlink/deployment/common/changeset/evm/mcms/ops" mcmsSeqs "github.com/smartcontractkit/chainlink/deployment/common/changeset/evm/mcms/seqs" @@ -31,7 +32,6 @@ import ( creforwarder "github.com/smartcontractkit/chainlink/deployment/cre/forwarder" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) // Use this to deploy keystone forwarders and configure them with the given DONs on NEW CHAINS diff --git a/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq_test.go b/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq_test.go index 852ff6ea6d8..f2b3ca5d79c 100644 --- a/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq_test.go +++ b/deployment/keystone/changeset/operations/contracts/deploy_configure_forwarders_seq_test.go @@ -13,11 +13,11 @@ import ( "github.com/smartcontractkit/chainlink-deployments-framework/operations/optest" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" crecontracts "github.com/smartcontractkit/chainlink/deployment/cre/contracts" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/operations/contracts" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func doDeployConfigureForwardersSeq(t *testing.T, useMcms bool) { diff --git a/deployment/keystone/changeset/test/dons.go b/deployment/keystone/changeset/test/dons.go index 016922ef953..59eefbeb432 100644 --- a/deployment/keystone/changeset/test/dons.go +++ b/deployment/keystone/changeset/test/dons.go @@ -4,9 +4,9 @@ import ( "maps" "sort" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/utils/nodetestutils" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) // testDon is an interface for a DON that can be used in tests diff --git a/deployment/keystone/changeset/test/registry.go b/deployment/keystone/changeset/test/registry.go index 27cf956d6a9..6302189a2cb 100644 --- a/deployment/keystone/changeset/test/registry.go +++ b/deployment/keystone/changeset/test/registry.go @@ -24,9 +24,9 @@ import ( cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/onchain" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type Don struct { diff --git a/deployment/keystone/changeset/test/utils.go b/deployment/keystone/changeset/test/utils.go index 6cc69917e64..2200858c747 100644 --- a/deployment/keystone/changeset/test/utils.go +++ b/deployment/keystone/changeset/test/utils.go @@ -9,9 +9,9 @@ import ( "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) // P2PIDs is a slice of p2pkey.PeerID with convenient transform methods. diff --git a/deployment/keystone/changeset/update_don.go b/deployment/keystone/changeset/update_don.go index cf018bb5fba..35c6da0e142 100644 --- a/deployment/keystone/changeset/update_don.go +++ b/deployment/keystone/changeset/update_don.go @@ -9,8 +9,8 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var _ cldf.ChangeSet[*UpdateDonRequest] = UpdateDon diff --git a/deployment/keystone/changeset/update_don_test.go b/deployment/keystone/changeset/update_don_test.go index b5565e90117..3385460136a 100644 --- a/deployment/keystone/changeset/update_don_test.go +++ b/deployment/keystone/changeset/update_don_test.go @@ -14,8 +14,8 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) var ( diff --git a/deployment/keystone/changeset/update_node_capabilities.go b/deployment/keystone/changeset/update_node_capabilities.go index 4c9b2002aaf..b78dc7d09be 100644 --- a/deployment/keystone/changeset/update_node_capabilities.go +++ b/deployment/keystone/changeset/update_node_capabilities.go @@ -20,7 +20,7 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) var _ cldf.ChangeSet[*MutateNodeCapabilitiesRequest] = UpdateNodeCapabilities diff --git a/deployment/keystone/changeset/update_node_capabilities_test.go b/deployment/keystone/changeset/update_node_capabilities_test.go index e53327760b3..ff210902e2a 100644 --- a/deployment/keystone/changeset/update_node_capabilities_test.go +++ b/deployment/keystone/changeset/update_node_capabilities_test.go @@ -8,11 +8,11 @@ import ( kcr "github.com/smartcontractkit/chainlink-evm/gethwrappers/keystone/generated/capabilities_registry_1_1_0" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestUpdateNodeCapabilities(t *testing.T) { diff --git a/deployment/keystone/changeset/update_nodes.go b/deployment/keystone/changeset/update_nodes.go index faf29ded09b..611c898015f 100644 --- a/deployment/keystone/changeset/update_nodes.go +++ b/deployment/keystone/changeset/update_nodes.go @@ -15,8 +15,8 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/cre/contracts" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type MCMSConfig = contracts.MCMSConfig diff --git a/deployment/keystone/changeset/update_nodes_test.go b/deployment/keystone/changeset/update_nodes_test.go index d9fdb7f1e27..3d27dc0943b 100644 --- a/deployment/keystone/changeset/update_nodes_test.go +++ b/deployment/keystone/changeset/update_nodes_test.go @@ -7,11 +7,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" cldf "github.com/smartcontractkit/chainlink-deployments-framework/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) func TestUpdateNodes(t *testing.T) { diff --git a/deployment/utils/nodetestutils/node.go b/deployment/utils/nodetestutils/node.go index ad69415a945..b1bd01a0a92 100644 --- a/deployment/utils/nodetestutils/node.go +++ b/deployment/utils/nodetestutils/node.go @@ -24,6 +24,10 @@ import ( commonkeystore "github.com/smartcontractkit/chainlink-common/keystore" "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/workflowkey" "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types/core" @@ -52,10 +56,6 @@ import ( feeds2 "github.com/smartcontractkit/chainlink/v2/core/services/feeds" feedsMocks "github.com/smartcontractkit/chainlink/v2/core/services/feeds/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/llo/retirement" "github.com/smartcontractkit/chainlink/v2/core/services/relay" "github.com/smartcontractkit/chainlink/v2/core/utils/crypto" diff --git a/go.sum b/go.sum index 6ee303a8b46..65ab1df4db3 100644 --- a/go.sum +++ b/go.sum @@ -1187,6 +1187,8 @@ github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47 h1:5N85Xb0EHgdovqvI4J95Wh3EEgobhxFu8NwY9XVKbbE= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 6ea7e6924ad..79f55f18cfb 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1617,6 +1617,7 @@ github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 961e32904aa..910100ca89e 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1595,6 +1595,7 @@ github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= diff --git a/system-tests/lib/cre/contracts/keystone.go b/system-tests/lib/cre/contracts/keystone.go index 8431f2db158..59b6369a0a3 100644 --- a/system-tests/lib/cre/contracts/keystone.go +++ b/system-tests/lib/cre/contracts/keystone.go @@ -16,6 +16,7 @@ import ( "github.com/rs/zerolog" "google.golang.org/protobuf/proto" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" capabilitiespb "github.com/smartcontractkit/chainlink-common/pkg/capabilities/pb" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-deployments-framework/datastore" @@ -35,7 +36,6 @@ import ( "github.com/smartcontractkit/chainlink/system-tests/lib/cre" "github.com/smartcontractkit/chainlink/system-tests/lib/cre/environment/blockchains" "github.com/smartcontractkit/chainlink/system-tests/lib/cre/flags" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" syncer_v2 "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer/v2" ) diff --git a/system-tests/lib/cre/contracts/keystone_test.go b/system-tests/lib/cre/contracts/keystone_test.go index 3349c3acc81..7cf7ce3df50 100644 --- a/system-tests/lib/cre/contracts/keystone_test.go +++ b/system-tests/lib/cre/contracts/keystone_test.go @@ -20,8 +20,8 @@ import ( nodev1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/shared/ptypes" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" keystone_changeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) // fakeOffchainClient implements offchain.Client; only ListNodes and diff --git a/system-tests/lib/cre/don/secrets/secrets.go b/system-tests/lib/cre/don/secrets/secrets.go index 44b3146fe92..bc98c8aadf8 100644 --- a/system-tests/lib/cre/don/secrets/secrets.go +++ b/system-tests/lib/cre/don/secrets/secrets.go @@ -11,8 +11,8 @@ import ( "github.com/smartcontractkit/smdkg/dkgocr/dkgocrtypes" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" "github.com/smartcontractkit/chainlink/system-tests/lib/crypto" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) type nodeSecret struct { diff --git a/system-tests/lib/crypto/dkgrecipient.go b/system-tests/lib/crypto/dkgrecipient.go index 4ea8235a7cb..e419cb40040 100644 --- a/system-tests/lib/crypto/dkgrecipient.go +++ b/system-tests/lib/crypto/dkgrecipient.go @@ -4,7 +4,7 @@ import ( "github.com/smartcontractkit/smdkg/dkgocr/dkgocrtypes" "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" ) type DKGRecipientKey struct { diff --git a/system-tests/lib/crypto/p2p.go b/system-tests/lib/crypto/p2p.go index 5598320db6e..acb2a382cc0 100644 --- a/system-tests/lib/crypto/p2p.go +++ b/system-tests/lib/crypto/p2p.go @@ -2,7 +2,7 @@ package crypto import ( "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" ) type P2PKey struct { diff --git a/system-tests/lib/crypto/sol.go b/system-tests/lib/crypto/sol.go index c5924d59ad6..848daf3d63d 100644 --- a/system-tests/lib/crypto/sol.go +++ b/system-tests/lib/crypto/sol.go @@ -6,7 +6,7 @@ import ( "github.com/gagliardetto/solana-go" "github.com/smartcontractkit/chainlink-common/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/solkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/solkey" ) type SolKey struct { diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index a39715099fb..628af5ec713 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1572,6 +1572,7 @@ github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index 0f7be8b5ed1..ee1d7c35e67 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1781,6 +1781,7 @@ github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4 github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4/go.mod h1:Zpvul9sTcZNAZOVzt5vBl1XZGNvQebFpnpn3/KOQvOQ= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= diff --git a/system-tests/tests/load/cre/workflow_don_load_test.go b/system-tests/tests/load/cre/workflow_don_load_test.go index f2be3d6439e..be2c509c8b4 100644 --- a/system-tests/tests/load/cre/workflow_don_load_test.go +++ b/system-tests/tests/load/cre/workflow_don_load_test.go @@ -47,6 +47,7 @@ import ( jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" "github.com/smartcontractkit/chainlink-testing-framework/wasp/benchspy" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink/deployment/environment/nodeclient" keystone_changeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" cldlogger "github.com/smartcontractkit/chainlink/deployment/logger" @@ -59,7 +60,6 @@ import ( "github.com/smartcontractkit/chainlink/system-tests/lib/cre/flags" mock_capability "github.com/smartcontractkit/chainlink/system-tests/lib/cre/mock" "github.com/smartcontractkit/chainlink/system-tests/lib/cre/mock/pb" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/llo/cre" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" diff --git a/system-tests/tests/load/cre/writer_don_load_test.go b/system-tests/tests/load/cre/writer_don_load_test.go index 845affbb1c1..b99522d42a5 100644 --- a/system-tests/tests/load/cre/writer_don_load_test.go +++ b/system-tests/tests/load/cre/writer_don_load_test.go @@ -28,6 +28,7 @@ import ( chainselectors "github.com/smartcontractkit/chain-selectors" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" "github.com/smartcontractkit/chainlink-common/pkg/capabilities" consensustypes "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types" "github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/report" @@ -57,7 +58,6 @@ import ( mock_capability "github.com/smartcontractkit/chainlink/system-tests/lib/cre/mock" pb2 "github.com/smartcontractkit/chainlink/system-tests/lib/cre/mock/pb" "github.com/smartcontractkit/chainlink/system-tests/lib/infra" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" ) diff --git a/system-tests/tests/regression/cre/v2_http_trigger_regression_test.go b/system-tests/tests/regression/cre/v2_http_trigger_regression_test.go index 160096d9a0a..5611e5c28b5 100644 --- a/system-tests/tests/regression/cre/v2_http_trigger_regression_test.go +++ b/system-tests/tests/regression/cre/v2_http_trigger_regression_test.go @@ -24,7 +24,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/framework" "github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/dkgrecipientkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/dkgrecipientkey" "github.com/smartcontractkit/chainlink/v2/core/utils" "github.com/smartcontractkit/chainlink/system-tests/lib/cre/environment/blockchains/evm" From 22f538225e1c6bbb0d6c0b7862379e9ade59f849 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Sun, 15 Feb 2026 18:02:24 +0100 Subject: [PATCH 03/11] Minor. --- core/internal/cltest/factories.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/internal/cltest/factories.go b/core/internal/cltest/factories.go index e720f245fbe..b408f37814a 100644 --- a/core/internal/cltest/factories.go +++ b/core/internal/cltest/factories.go @@ -194,7 +194,7 @@ func MustInsertHead(t *testing.T, ds sqlutil.DataSource, number int64) *evmtypes func MustInsertOffchainreportingOracleSpec(t *testing.T, db *sqlx.DB, transmitterAddress evmtypes.EIP55Address) job.OCROracleSpec { t.Helper() - ocrKeyID := keys.MustSha256HashFromHex(DefaultOCRKeyBundleID) + ocrKeyID := corekeys.MustSha256HashFromHex(DefaultOCRKeyBundleID) spec := job.OCROracleSpec{} require.NoError(t, db.Get(&spec, `INSERT INTO ocr_oracle_specs (created_at, updated_at, contract_address, p2pv2_bootstrappers, is_bootstrap_peer, encrypted_ocr_key_bundle_id, transmitter_address, observation_timeout, blockchain_timeout, contract_config_tracker_subscribe_interval, contract_config_tracker_poll_interval, contract_config_confirmations, database_timeout, observation_grace_period, contract_transmitter_transmit_timeout, evm_chain_id) VALUES ( NOW(),NOW(),$1,'{}',false,$2,$3,0,0,0,0,0,0,0,0,0 From 9c79709ff49cf3138f141cbc1e2292a666c412e3 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Sun, 15 Feb 2026 18:19:11 +0100 Subject: [PATCH 04/11] Minor. --- core/services/chainlink/config_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/services/chainlink/config_test.go b/core/services/chainlink/config_test.go index a3d78004f1d..ed6854a218a 100644 --- a/core/services/chainlink/config_test.go +++ b/core/services/chainlink/config_test.go @@ -432,7 +432,7 @@ func TestConfig_Marshal(t *testing.T) { ContractSubscribeInterval: commoncfg.MustNewDuration(time.Minute), ContractTransmitterTransmitTimeout: commoncfg.MustNewDuration(time.Minute), DatabaseTimeout: commoncfg.MustNewDuration(8 * time.Second), - KeyBundleID: ptr(keys.MustSha256HashFromHex("7a5f66bbe6594259325bf2b4f5b1a9c9")), + KeyBundleID: ptr(corekeys.MustSha256HashFromHex("7a5f66bbe6594259325bf2b4f5b1a9c9")), CaptureEATelemetry: ptr(false), CaptureAutomationCustomTelemetry: ptr(true), AllowNoBootstrappers: ptr(true), @@ -449,7 +449,7 @@ func TestConfig_Marshal(t *testing.T) { ContractPollInterval: commoncfg.MustNewDuration(time.Hour), ContractSubscribeInterval: commoncfg.MustNewDuration(time.Minute), DefaultTransactionQueueDepth: ptr[uint32](12), - KeyBundleID: ptr(keys.MustSha256HashFromHex("acdd42797a8b921b2910497badc50006")), + KeyBundleID: ptr(corekeys.MustSha256HashFromHex("acdd42797a8b921b2910497badc50006")), SimulateTransactions: ptr(true), TransmitterAddress: ptr(types.MustEIP55Address("0xa0788FC17B1dEe36f057c42B6F373A34B014687e")), CaptureEATelemetry: ptr(false), From 100e906ca970af4bf405e2d6549d3a2dcdb68aed Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Tue, 17 Feb 2026 14:43:15 +0100 Subject: [PATCH 05/11] Minor. --- core/services/blockhashstore/delegate_test.go | 2 +- core/services/job/mocks/orm.go | 20 +++++----- .../plugins/ocr2keeper/integration_test.go | 12 +++--- core/web/presenters/eth_key.go | 2 +- core/web/presenters/eth_key_test.go | 2 +- core/web/presenters/job.go | 38 +++++++++---------- core/web/resolver/eth_key_test.go | 2 +- go.md | 6 ++- 8 files changed, 43 insertions(+), 41 deletions(-) diff --git a/core/services/blockhashstore/delegate_test.go b/core/services/blockhashstore/delegate_test.go index f18ca7693c2..95b3f6f432e 100644 --- a/core/services/blockhashstore/delegate_test.go +++ b/core/services/blockhashstore/delegate_test.go @@ -11,6 +11,7 @@ import ( "go.uber.org/zap/zapcore" "go.uber.org/zap/zaptest/observer" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/client/clienttest" @@ -26,7 +27,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" "github.com/smartcontractkit/chainlink/v2/core/services/keystore" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" ) func TestDelegate_JobType(t *testing.T) { diff --git a/core/services/job/mocks/orm.go b/core/services/job/mocks/orm.go index 5a526cd0d88..2e0d3dd82f9 100644 --- a/core/services/job/mocks/orm.go +++ b/core/services/job/mocks/orm.go @@ -7,6 +7,8 @@ import ( common "github.com/ethereum/go-ethereum/common" + ethkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + job "github.com/smartcontractkit/chainlink/v2/core/services/job" mock "github.com/stretchr/testify/mock" @@ -15,8 +17,6 @@ import ( sqlutil "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - types "github.com/smartcontractkit/chainlink-evm/pkg/types" - uuid "github.com/google/uuid" ) @@ -543,7 +543,7 @@ func (_c *ORM_FindJobByExternalJobID_Call) RunAndReturn(run func(context.Context } // FindJobIDByAddress provides a mock function with given fields: ctx, address, evmChainID -func (_m *ORM) FindJobIDByAddress(ctx context.Context, address types.EIP55Address, evmChainID *sqlutil.Big) (int32, error) { +func (_m *ORM) FindJobIDByAddress(ctx context.Context, address ethkey.EIP55Address, evmChainID *sqlutil.Big) (int32, error) { ret := _m.Called(ctx, address, evmChainID) if len(ret) == 0 { @@ -552,16 +552,16 @@ func (_m *ORM) FindJobIDByAddress(ctx context.Context, address types.EIP55Addres var r0 int32 var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.EIP55Address, *sqlutil.Big) (int32, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, ethkey.EIP55Address, *sqlutil.Big) (int32, error)); ok { return rf(ctx, address, evmChainID) } - if rf, ok := ret.Get(0).(func(context.Context, types.EIP55Address, *sqlutil.Big) int32); ok { + if rf, ok := ret.Get(0).(func(context.Context, ethkey.EIP55Address, *sqlutil.Big) int32); ok { r0 = rf(ctx, address, evmChainID) } else { r0 = ret.Get(0).(int32) } - if rf, ok := ret.Get(1).(func(context.Context, types.EIP55Address, *sqlutil.Big) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, ethkey.EIP55Address, *sqlutil.Big) error); ok { r1 = rf(ctx, address, evmChainID) } else { r1 = ret.Error(1) @@ -577,15 +577,15 @@ type ORM_FindJobIDByAddress_Call struct { // FindJobIDByAddress is a helper method to define mock.On call // - ctx context.Context -// - address types.EIP55Address +// - address ethkey.EIP55Address // - evmChainID *sqlutil.Big func (_e *ORM_Expecter) FindJobIDByAddress(ctx interface{}, address interface{}, evmChainID interface{}) *ORM_FindJobIDByAddress_Call { return &ORM_FindJobIDByAddress_Call{Call: _e.mock.On("FindJobIDByAddress", ctx, address, evmChainID)} } -func (_c *ORM_FindJobIDByAddress_Call) Run(run func(ctx context.Context, address types.EIP55Address, evmChainID *sqlutil.Big)) *ORM_FindJobIDByAddress_Call { +func (_c *ORM_FindJobIDByAddress_Call) Run(run func(ctx context.Context, address ethkey.EIP55Address, evmChainID *sqlutil.Big)) *ORM_FindJobIDByAddress_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(types.EIP55Address), args[2].(*sqlutil.Big)) + run(args[0].(context.Context), args[1].(ethkey.EIP55Address), args[2].(*sqlutil.Big)) }) return _c } @@ -595,7 +595,7 @@ func (_c *ORM_FindJobIDByAddress_Call) Return(_a0 int32, _a1 error) *ORM_FindJob return _c } -func (_c *ORM_FindJobIDByAddress_Call) RunAndReturn(run func(context.Context, types.EIP55Address, *sqlutil.Big) (int32, error)) *ORM_FindJobIDByAddress_Call { +func (_c *ORM_FindJobIDByAddress_Call) RunAndReturn(run func(context.Context, ethkey.EIP55Address, *sqlutil.Big) (int32, error)) *ORM_FindJobIDByAddress_Call { _c.Call.Return(run) return _c } diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_test.go index 10d650484c9..251d28c0e52 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_test.go @@ -28,13 +28,15 @@ import ( ocrTypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types" "github.com/smartcontractkit/chainlink-automation/pkg/v2/config" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ocr2key" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/p2pkey" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" + "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" - "github.com/smartcontractkit/chainlink-common/keystore/corekeys" - "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/basic_upkeep_contract" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/keeper_registry_logic2_0" "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/keeper_registry_wrapper2_0" @@ -42,6 +44,7 @@ import ( "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/mock_v3_aggregator_contract" "github.com/smartcontractkit/chainlink-evm/gethwrappers/operatorforwarder/generated/authorized_forwarder" "github.com/smartcontractkit/chainlink-evm/pkg/assets" + "github.com/smartcontractkit/chainlink-evm/pkg/chains/legacyevm" "github.com/smartcontractkit/chainlink-evm/pkg/forwarders" "github.com/smartcontractkit/chainlink-evm/pkg/logpoller" evmtestutils "github.com/smartcontractkit/chainlink-evm/pkg/testutils" @@ -52,9 +55,6 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/logger" "github.com/smartcontractkit/chainlink/v2/core/services/chainlink" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" diff --git a/core/web/presenters/eth_key.go b/core/web/presenters/eth_key.go index 0ff353d0825..d10b1503490 100644 --- a/core/web/presenters/eth_key.go +++ b/core/web/presenters/eth_key.go @@ -3,10 +3,10 @@ package presenters import ( "time" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/pkg/assets" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" ) // ETHKeyResource represents a ETH key JSONAPI resource. It holds the hex diff --git a/core/web/presenters/eth_key_test.go b/core/web/presenters/eth_key_test.go index 5cba9e349e0..03a9d3db563 100644 --- a/core/web/presenters/eth_key_test.go +++ b/core/web/presenters/eth_key_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" "github.com/smartcontractkit/chainlink-evm/pkg/assets" "github.com/smartcontractkit/chainlink-evm/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/ethereum/go-ethereum/common" "github.com/manyminds/api2go/jsonapi" diff --git a/core/web/presenters/job.go b/core/web/presenters/job.go index 3d8e061c866..80ed7570e56 100644 --- a/core/web/presenters/job.go +++ b/core/web/presenters/job.go @@ -7,6 +7,8 @@ import ( "github.com/lib/pq" "gopkg.in/guregu/null.v4" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -15,8 +17,6 @@ import ( clnull "github.com/smartcontractkit/chainlink/v2/core/null" "github.com/smartcontractkit/chainlink/v2/core/services/job" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/store/models" ) @@ -126,23 +126,23 @@ func NewFluxMonitorSpec(spec *job.FluxMonitorSpec) *FluxMonitorSpec { // OffChainReportingSpec defines the spec details of a OffChainReporting Job type OffChainReportingSpec struct { - ContractAddress types.EIP55Address `json:"contractAddress"` - P2PV2Bootstrappers pq.StringArray `json:"p2pv2Bootstrappers"` - IsBootstrapPeer bool `json:"isBootstrapPeer"` - EncryptedOCRKeyBundleID *keys.Sha256Hash `json:"keyBundleID"` - TransmitterAddress *types.EIP55Address `json:"transmitterAddress"` - ObservationTimeout sqlutil.Interval `json:"observationTimeout"` - BlockchainTimeout sqlutil.Interval `json:"blockchainTimeout"` - ContractConfigTrackerSubscribeInterval sqlutil.Interval `json:"contractConfigTrackerSubscribeInterval"` - ContractConfigTrackerPollInterval sqlutil.Interval `json:"contractConfigTrackerPollInterval"` - ContractConfigConfirmations uint16 `json:"contractConfigConfirmations"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` - EVMChainID *sqlutil.Big `json:"evmChainID"` - DatabaseTimeout *sqlutil.Interval `json:"databaseTimeout"` - ObservationGracePeriod *sqlutil.Interval `json:"observationGracePeriod"` - ContractTransmitterTransmitTimeout *sqlutil.Interval `json:"contractTransmitterTransmitTimeout"` - CollectTelemetry bool `json:"collectTelemetry,omitempty"` + ContractAddress types.EIP55Address `json:"contractAddress"` + P2PV2Bootstrappers pq.StringArray `json:"p2pv2Bootstrappers"` + IsBootstrapPeer bool `json:"isBootstrapPeer"` + EncryptedOCRKeyBundleID *corekeys.Sha256Hash `json:"keyBundleID"` + TransmitterAddress *types.EIP55Address `json:"transmitterAddress"` + ObservationTimeout sqlutil.Interval `json:"observationTimeout"` + BlockchainTimeout sqlutil.Interval `json:"blockchainTimeout"` + ContractConfigTrackerSubscribeInterval sqlutil.Interval `json:"contractConfigTrackerSubscribeInterval"` + ContractConfigTrackerPollInterval sqlutil.Interval `json:"contractConfigTrackerPollInterval"` + ContractConfigConfirmations uint16 `json:"contractConfigConfirmations"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` + EVMChainID *sqlutil.Big `json:"evmChainID"` + DatabaseTimeout *sqlutil.Interval `json:"databaseTimeout"` + ObservationGracePeriod *sqlutil.Interval `json:"observationGracePeriod"` + ContractTransmitterTransmitTimeout *sqlutil.Interval `json:"contractTransmitterTransmitTimeout"` + CollectTelemetry bool `json:"collectTelemetry,omitempty"` } // NewOffChainReportingSpec initializes a new OffChainReportingSpec from a diff --git a/core/web/resolver/eth_key_test.go b/core/web/resolver/eth_key_test.go index 821c02967de..08fe495fd81 100644 --- a/core/web/resolver/eth_key_test.go +++ b/core/web/resolver/eth_key_test.go @@ -10,6 +10,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" commonassets "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/loop" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" @@ -21,7 +22,6 @@ import ( mocks2 "github.com/smartcontractkit/chainlink-evm/pkg/config/mocks" "github.com/smartcontractkit/chainlink-evm/pkg/config/toml" evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types" - "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/v2/core/services/relay" evmrelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm" "github.com/smartcontractkit/chainlink/v2/core/web/testutils" diff --git a/go.md b/go.md index d1b6044b95d..d7c81319de8 100644 --- a/go.md +++ b/go.md @@ -59,6 +59,8 @@ flowchart LR chainlink-common --> libocr click chainlink-common href "https://github.com/smartcontractkit/chainlink-common" chainlink-common/keystore --> chainlink-common + chainlink-common/keystore --> smdkg + chainlink-common/keystore --> wsrpc click chainlink-common/keystore href "https://github.com/smartcontractkit/chainlink-common" chainlink-common/pkg/chipingress click chainlink-common/pkg/chipingress href "https://github.com/smartcontractkit/chainlink-common" @@ -147,7 +149,6 @@ flowchart LR chainlink/v2 --> cre-sdk-go/capabilities/networking/http chainlink/v2 --> cre-sdk-go/capabilities/scheduler/cron chainlink/v2 --> quarantine - chainlink/v2 --> smdkg chainlink/v2 --> tdh2/go/ocr2/decryptionplugin click chainlink/v2 href "https://github.com/smartcontractkit/chainlink" cre-sdk-go --> chainlink-protos/cre/go @@ -311,6 +312,8 @@ flowchart LR chainlink-common --> libocr click chainlink-common href "https://github.com/smartcontractkit/chainlink-common" chainlink-common/keystore --> chainlink-common + chainlink-common/keystore --> smdkg + chainlink-common/keystore --> wsrpc click chainlink-common/keystore href "https://github.com/smartcontractkit/chainlink-common" chainlink-common/pkg/chipingress click chainlink-common/pkg/chipingress href "https://github.com/smartcontractkit/chainlink-common" @@ -526,7 +529,6 @@ flowchart LR chainlink/v2 --> cre-sdk-go/capabilities/networking/http chainlink/v2 --> cre-sdk-go/capabilities/scheduler/cron chainlink/v2 --> quarantine - chainlink/v2 --> smdkg chainlink/v2 --> tdh2/go/ocr2/decryptionplugin click chainlink/v2 href "https://github.com/smartcontractkit/chainlink" cre-sdk-go --> chainlink-common/pkg/workflows/sdk/v2/pb From b69c99026131b244584cd5b18a574e5eae74de31 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Tue, 17 Feb 2026 14:55:57 +0100 Subject: [PATCH 06/11] Minor. --- core/web/presenters/job_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/web/presenters/job_test.go b/core/web/presenters/job_test.go index a20a8a31e78..01feeb13f82 100644 --- a/core/web/presenters/job_test.go +++ b/core/web/presenters/job_test.go @@ -37,7 +37,7 @@ func TestJob(t *testing.T) { // Used in OCR tests var ocrKeyBundleID = "f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5" - ocrKeyID := keys.MustSha256HashFromHex(ocrKeyBundleID) + ocrKeyID := corekeys.MustSha256HashFromHex(ocrKeyBundleID) transmitterAddress, err := types.NewEIP55Address("0x27548a32b9aD5D64c5945EaE9Da5337bc3169D15") require.NoError(t, err) From de859e365b66b8674a0498364081880175924177 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Tue, 17 Feb 2026 15:38:37 +0100 Subject: [PATCH 07/11] Minor. --- core/services/keystore/aptos_test.go | 4 ++-- core/services/keystore/cosmos_test.go | 4 ++-- core/services/keystore/dkgrecipient_test.go | 4 ++-- core/services/keystore/solana_test.go | 4 ++-- core/services/keystore/starknet_test.go | 4 ++-- core/services/keystore/sui_test.go | 4 ++-- core/web/resolver/spec_test.go | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/services/keystore/aptos_test.go b/core/services/keystore/aptos_test.go index 9459272d8d1..09c0507d87e 100644 --- a/core/services/keystore/aptos_test.go +++ b/core/services/keystore/aptos_test.go @@ -49,7 +49,7 @@ func Test_AptosKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) }) t.Run("imports and exports a key", func(t *testing.T) { @@ -74,7 +74,7 @@ func Test_AptosKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) }) t.Run("adds an externally created key / deletes a key", func(t *testing.T) { diff --git a/core/services/keystore/cosmos_test.go b/core/services/keystore/cosmos_test.go index 9fcf40e4c56..c962cdcb344 100644 --- a/core/services/keystore/cosmos_test.go +++ b/core/services/keystore/cosmos_test.go @@ -49,7 +49,7 @@ func Test_CosmosKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) }) t.Run("imports and exports a key", func(t *testing.T) { @@ -74,7 +74,7 @@ func Test_CosmosKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) }) t.Run("adds an externally created key / deletes a key", func(t *testing.T) { diff --git a/core/services/keystore/dkgrecipient_test.go b/core/services/keystore/dkgrecipient_test.go index 03ac71e6095..9b7a4459525 100644 --- a/core/services/keystore/dkgrecipient_test.go +++ b/core/services/keystore/dkgrecipient_test.go @@ -50,7 +50,7 @@ func Test_DKGRecipientKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) t.Run("prevents creating more than one key", func(t *testing.T) { ctx := testutils.Context(t) @@ -78,7 +78,7 @@ func Test_DKGRecipientKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) t.Run("prevents importing more than one key", func(t *testing.T) { k, err2 := ks.Import(testutils.Context(t), exportJSON, cltest.Password) diff --git a/core/services/keystore/solana_test.go b/core/services/keystore/solana_test.go index 588e37d807c..672c9b0ca8f 100644 --- a/core/services/keystore/solana_test.go +++ b/core/services/keystore/solana_test.go @@ -49,7 +49,7 @@ func Test_SolanaKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) }) t.Run("imports and exports a key", func(t *testing.T) { @@ -74,7 +74,7 @@ func Test_SolanaKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) }) t.Run("adds an externally created key / deletes a key", func(t *testing.T) { diff --git a/core/services/keystore/starknet_test.go b/core/services/keystore/starknet_test.go index 4fa7f9affb4..4fbd8c05266 100644 --- a/core/services/keystore/starknet_test.go +++ b/core/services/keystore/starknet_test.go @@ -53,7 +53,7 @@ func Test_StarkNetKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) }) t.Run("imports and exports a key", func(t *testing.T) { @@ -72,7 +72,7 @@ func Test_StarkNetKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) }) t.Run("adds an externally created key / deletes a key", func(t *testing.T) { diff --git a/core/services/keystore/sui_test.go b/core/services/keystore/sui_test.go index 51ac9bb06ed..1e67bd96aca 100644 --- a/core/services/keystore/sui_test.go +++ b/core/services/keystore/sui_test.go @@ -49,7 +49,7 @@ func Test_SuiKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) }) t.Run("imports and exports a key", func(t *testing.T) { @@ -74,7 +74,7 @@ func Test_SuiKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) }) t.Run("adds an externally created key / deletes a key", func(t *testing.T) { diff --git a/core/web/resolver/spec_test.go b/core/web/resolver/spec_test.go index d865b4cb9dc..6e11c209a7c 100644 --- a/core/web/resolver/spec_test.go +++ b/core/web/resolver/spec_test.go @@ -368,7 +368,7 @@ func TestResolver_OCRSpec(t *testing.T) { transmitterAddress, err := evmtypes.NewEIP55Address("0x3cCad4715152693fE3BC4460591e3D3Fbd071b42") require.NoError(t, err) - keyBundleID := keys.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") + keyBundleID := corekeys.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") testCases := []GQLTestCase{ { @@ -465,7 +465,7 @@ func TestResolver_OCR2Spec(t *testing.T) { transmitterAddress, err := evmtypes.NewEIP55Address("0x3cCad4715152693fE3BC4460591e3D3Fbd071b42") require.NoError(t, err) - keyBundleID := keys.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") + keyBundleID := corekeys.MustSha256HashFromHex("f5bf259689b26f1374efb3c9a9868796953a0f814bb2d39b968d0e61b58620a5") relayConfig := map[string]any{ "chainID": 1337, From df06998a5dcab21caa413e930d20039a7fef5b41 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Tue, 17 Feb 2026 16:12:14 +0100 Subject: [PATCH 08/11] Minor. --- core/services/keystore/ton_test.go | 4 ++-- core/services/keystore/tron_test.go | 4 ++-- core/services/keystore/workflow_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/services/keystore/ton_test.go b/core/services/keystore/ton_test.go index 5901e14020e..d3197a73ed6 100644 --- a/core/services/keystore/ton_test.go +++ b/core/services/keystore/ton_test.go @@ -49,7 +49,7 @@ func Test_TONKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) }) t.Run("imports and exports a key", func(t *testing.T) { @@ -74,7 +74,7 @@ func Test_TONKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) }) t.Run("adds an externally created key / deletes a key", func(t *testing.T) { diff --git a/core/services/keystore/tron_test.go b/core/services/keystore/tron_test.go index 2300b64d822..8751d59f17e 100644 --- a/core/services/keystore/tron_test.go +++ b/core/services/keystore/tron_test.go @@ -51,7 +51,7 @@ func Test_TronKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) }) t.Run("imports and exports a key", func(t *testing.T) { @@ -76,7 +76,7 @@ func Test_TronKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) }) t.Run("adds an externally created key / deletes a key", func(t *testing.T) { diff --git a/core/services/keystore/workflow_test.go b/core/services/keystore/workflow_test.go index 7c95f81e858..34308bf4855 100644 --- a/core/services/keystore/workflow_test.go +++ b/core/services/keystore/workflow_test.go @@ -50,7 +50,7 @@ func Test_EncryptionKeyStore_E2E(t *testing.T) { require.NoError(t, err) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, key, retrievedKey) + corekeys.RequireEqualKeys(t, key, retrievedKey) t.Run("prevents creating more than one key", func(t *testing.T) { ctx := testutils.Context(t) @@ -78,7 +78,7 @@ func Test_EncryptionKeyStore_E2E(t *testing.T) { require.Equal(t, key.ID(), importedKey.ID()) retrievedKey, err := ks.Get(key.ID()) require.NoError(t, err) - keys.RequireEqualKeys(t, importedKey, retrievedKey) + corekeys.RequireEqualKeys(t, importedKey, retrievedKey) t.Run("prevents importing more than one key", func(t *testing.T) { k, err2 := ks.Import(testutils.Context(t), exportJSON, cltest.Password) From dbe432e59eafb7385ba7e0629c21e9f756115178 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Tue, 17 Feb 2026 16:13:10 +0100 Subject: [PATCH 09/11] Minor. --- core/services/job/runner_integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/services/job/runner_integration_test.go b/core/services/job/runner_integration_test.go index 489368ff2cd..71b87b5225c 100644 --- a/core/services/job/runner_integration_test.go +++ b/core/services/job/runner_integration_test.go @@ -67,7 +67,7 @@ func TestRunner(t *testing.T) { c.P2P.V2.ListenAddresses = &[]string{fmt.Sprintf("127.0.0.1:%d", freeport.GetOne(t))} kb, err := keyStore.OCR().Create(ctx) require.NoError(t, err) - kbid := keys.MustSha256HashFromHex(kb.ID()) + kbid := corekeys.MustSha256HashFromHex(kb.ID()) c.OCR.KeyBundleID = &kbid taddress := types.EIP55AddressFromAddress(transmitterAddress) c.OCR.TransmitterAddress = &taddress From bee33a61b4101d4c418a8158502d4dfb7a85f8e3 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Tue, 17 Feb 2026 18:14:20 +0100 Subject: [PATCH 10/11] Minor. --- core/scripts/go.mod | 8 ++++---- core/scripts/go.sum | 4 ++++ deployment/go.mod | 8 ++++---- deployment/go.sum | 4 ++++ go.mod | 8 ++++---- go.sum | 8 ++++++++ integration-tests/go.mod | 8 ++++---- integration-tests/go.sum | 4 ++++ integration-tests/load/go.mod | 8 ++++---- integration-tests/load/go.sum | 4 ++++ system-tests/lib/go.mod | 8 ++++---- system-tests/lib/go.sum | 4 ++++ system-tests/tests/go.mod | 8 ++++---- system-tests/tests/go.sum | 4 ++++ 14 files changed, 60 insertions(+), 28 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index eb6c5c5ad98..7fd5e50d329 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -46,13 +46,13 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260203202624-5101f4d33736 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 - github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 + github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 github.com/smartcontractkit/chainlink-data-streams v0.1.11 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 - github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 + github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 github.com/smartcontractkit/chainlink-testing-framework/framework v0.13.14-0.20260202230832-eb33f42188d1 github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.20 diff --git a/core/scripts/go.sum b/core/scripts/go.sum index c1ab5c011c0..f533a427f13 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1614,9 +1614,11 @@ github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1: github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4/go.mod h1:Zpvul9sTcZNAZOVzt5vBl1XZGNvQebFpnpn3/KOQvOQ= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= @@ -1627,6 +1629,7 @@ github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.2026020918 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c h1:eX7SCn5AGUGduv5OrjbVJkUSOnyeal0BtVem6zBSB2Y= @@ -1653,6 +1656,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251 github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/deployment/go.mod b/deployment/go.mod index 4fc4cdd82b7..68b93800b1a 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -43,14 +43,14 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 - github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 + github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 - github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 + github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 github.com/smartcontractkit/chainlink-protos/orchestrator v0.10.0 github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260211115641-f96bb4343198 diff --git a/deployment/go.sum b/deployment/go.sum index 5e67e2be632..e5fdb111c43 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1371,9 +1371,11 @@ github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1: github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= @@ -1384,6 +1386,7 @@ github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.2026020918 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c h1:eX7SCn5AGUGduv5OrjbVJkUSOnyeal0BtVem6zBSB2Y= @@ -1410,6 +1413,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251 github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/go.mod b/go.mod index 2f2c02df824..3f33072d564 100644 --- a/go.mod +++ b/go.mod @@ -88,11 +88,11 @@ require ( github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 - github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 + github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 github.com/smartcontractkit/chainlink-data-streams v0.1.11 - github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 + github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c github.com/smartcontractkit/chainlink-feeds v0.1.2-0.20250227211209-7cd000095135 @@ -100,7 +100,7 @@ require ( github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20251210101658-1c5c8e4c4f15 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942 github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b github.com/smartcontractkit/chainlink-protos/orchestrator v0.10.0 github.com/smartcontractkit/chainlink-protos/ring/go v0.0.0-20260128151123-605e9540b706 diff --git a/go.sum b/go.sum index 65ab1df4db3..970d864aa74 100644 --- a/go.sum +++ b/go.sum @@ -1185,10 +1185,14 @@ github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1: github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47 h1:5N85Xb0EHgdovqvI4J95Wh3EEgobhxFu8NwY9XVKbbE= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= @@ -1197,6 +1201,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.11 h1:yBzjU0Cu8AcfuM858G github.com/smartcontractkit/chainlink-data-streams v0.1.11/go.mod h1:8rUcGhjeXBoTFx2MynWgXiBWzVSB+LXd9JR6m8y2FfQ= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f h1:29dXt+8hnpSK42N/O+u9Wn3rH8ZTeLYAj7jhbdZvpnI= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c h1:eX7SCn5AGUGduv5OrjbVJkUSOnyeal0BtVem6zBSB2Y= @@ -1223,6 +1229,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251 github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index faabe22c515..384888f82f0 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -51,10 +51,10 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260203202624-5101f4d33736 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 - github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 + github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 - github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 + github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 github.com/smartcontractkit/chainlink-sui v0.0.0-20260205175622-33e65031f9a9 @@ -516,7 +516,7 @@ require ( github.com/smartcontractkit/chainlink-protos/chainlink-ccv/heartbeat v0.0.0-20260115142640-f6b99095c12e // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.10.0 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 79f55f18cfb..7dd5667ca30 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1615,9 +1615,11 @@ github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1: github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= @@ -1628,6 +1630,7 @@ github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.2026020918 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c h1:eX7SCn5AGUGduv5OrjbVJkUSOnyeal0BtVem6zBSB2Y= @@ -1654,6 +1657,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251 github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 3412ad2d020..51737dd1f9b 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -32,9 +32,9 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260203202624-5101f4d33736 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 - github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 + github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c github.com/smartcontractkit/chainlink-testing-framework/framework v0.13.14-0.20260202230832-eb33f42188d1 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.5 @@ -487,7 +487,7 @@ require ( github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm v0.0.0-20260206205333-9187f22f0a04 // indirect github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139 // indirect github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 // indirect - github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 // indirect + github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.11 // indirect github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 // indirect @@ -501,7 +501,7 @@ require ( github.com/smartcontractkit/chainlink-protos/chainlink-ccv/heartbeat v0.0.0-20260115142640-f6b99095c12e // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d // indirect github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d // indirect - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe // indirect + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 // indirect github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 910100ca89e..d992feb05a2 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1593,9 +1593,11 @@ github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1: github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= @@ -1606,6 +1608,7 @@ github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.2026020918 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c h1:eX7SCn5AGUGduv5OrjbVJkUSOnyeal0BtVem6zBSB2Y= @@ -1632,6 +1635,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251 github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/system-tests/lib/go.mod b/system-tests/lib/go.mod index a3cb3d92a56..d8cfa47892a 100644 --- a/system-tests/lib/go.mod +++ b/system-tests/lib/go.mod @@ -32,12 +32,12 @@ require ( github.com/sethvargo/go-retry v0.3.0 github.com/smartcontractkit/chain-selectors v1.0.91 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 - github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 + github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 - github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 + github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260205231316-3b9c600dd791 github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260211115641-f96bb4343198 diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 628af5ec713..9a084b81be3 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1570,9 +1570,11 @@ github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1: github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= @@ -1583,6 +1585,7 @@ github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.2026020918 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c h1:eX7SCn5AGUGduv5OrjbVJkUSOnyeal0BtVem6zBSB2Y= @@ -1609,6 +1612,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251 github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/system-tests/tests/go.mod b/system-tests/tests/go.mod index 4b589d0cec2..98e229a8f4c 100644 --- a/system-tests/tests/go.mod +++ b/system-tests/tests/go.mod @@ -54,12 +54,12 @@ require ( github.com/rs/zerolog v1.34.0 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.91 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 - github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 + github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 github.com/smartcontractkit/chainlink-data-streams v0.1.11 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 github.com/smartcontractkit/chainlink-protos/ring/go v0.0.0-20260128151123-605e9540b706 github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260205231316-3b9c600dd791 @@ -571,7 +571,7 @@ require ( github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260203202624-5101f4d33736 // indirect github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 - github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 // indirect + github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f // indirect github.com/smartcontractkit/chainlink-feeds v0.1.2-0.20250227211209-7cd000095135 // indirect github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250818175541-3389ac08a563 // indirect github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20251210101658-1c5c8e4c4f15 // indirect diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index ee1d7c35e67..c9e2421df21 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1779,9 +1779,11 @@ github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1: github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4/go.mod h1:Zpvul9sTcZNAZOVzt5vBl1XZGNvQebFpnpn3/KOQvOQ= github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 h1:PsjEI+5jZIz9AS4eOsLS5VpSWJINf38clXV3wryPyMk= @@ -1792,6 +1794,7 @@ github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.2026020918 github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c h1:eX7SCn5AGUGduv5OrjbVJkUSOnyeal0BtVem6zBSB2Y= @@ -1818,6 +1821,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251 github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= From 9cadcd9deaeb899636e7f7e37eb38451a199e794 Mon Sep 17 00:00:00 2001 From: pavel-raykov Date: Tue, 17 Feb 2026 18:37:08 +0100 Subject: [PATCH 11/11] Minor. --- core/scripts/go.sum | 13 ++++--------- deployment/go.sum | 13 ++++--------- go.mod | 14 +++++++------- go.sum | 10 ---------- integration-tests/go.sum | 13 ++++--------- integration-tests/load/go.sum | 13 ++++--------- system-tests/lib/go.sum | 13 ++++--------- system-tests/tests/go.sum | 13 ++++--------- 8 files changed, 31 insertions(+), 71 deletions(-) diff --git a/core/scripts/go.sum b/core/scripts/go.sum index f533a427f13..060e39f75f1 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1612,12 +1612,9 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1:e/L0oKHTwXjqIf66vw8NWYvXecCq5tybGwHm7YK9wuo= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4/go.mod h1:Zpvul9sTcZNAZOVzt5vBl1XZGNvQebFpnpn3/KOQvOQ= @@ -1627,8 +1624,7 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.11 h1:yBzjU0Cu8AcfuM858G github.com/smartcontractkit/chainlink-data-streams v0.1.11/go.mod h1:8rUcGhjeXBoTFx2MynWgXiBWzVSB+LXd9JR6m8y2FfQ= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 h1:wVGho+uL3UEqhzMtAXmtZDUQ14J1Fmm7PkqJDuJWd1c= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f h1:29dXt+8hnpSK42N/O+u9Wn3rH8ZTeLYAj7jhbdZvpnI= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= @@ -1654,8 +1650,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0. github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= diff --git a/deployment/go.sum b/deployment/go.sum index e5fdb111c43..407634c0106 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1369,12 +1369,9 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1:e/L0oKHTwXjqIf66vw8NWYvXecCq5tybGwHm7YK9wuo= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= @@ -1384,8 +1381,7 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.11 h1:yBzjU0Cu8AcfuM858G github.com/smartcontractkit/chainlink-data-streams v0.1.11/go.mod h1:8rUcGhjeXBoTFx2MynWgXiBWzVSB+LXd9JR6m8y2FfQ= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 h1:wVGho+uL3UEqhzMtAXmtZDUQ14J1Fmm7PkqJDuJWd1c= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f h1:29dXt+8hnpSK42N/O+u9Wn3rH8ZTeLYAj7jhbdZvpnI= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= @@ -1411,8 +1407,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0. github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= diff --git a/go.mod b/go.mod index 3f33072d564..bc26c8676e8 100644 --- a/go.mod +++ b/go.mod @@ -6,17 +6,13 @@ require ( github.com/BurntSushi/toml v1.5.0 github.com/Depado/ginprom v1.8.0 github.com/Masterminds/semver/v3 v3.4.0 - github.com/NethermindEth/juno v0.12.5 - github.com/NethermindEth/starknet.go v0.8.0 github.com/andybalholm/brotli v1.2.0 github.com/aptos-labs/aptos-go-sdk v1.11.0 github.com/avast/retry-go/v4 v4.6.1 - github.com/btcsuite/btcd/btcec/v2 v2.3.4 github.com/buraksezer/consistent v0.10.0 github.com/cespare/xxhash/v2 v2.3.0 github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.2 github.com/coreos/go-oidc/v3 v3.11.0 - github.com/cosmos/cosmos-sdk v0.50.14 github.com/danielkov/gin-helmet v0.0.0-20171108135313-1387e224435e github.com/deckarep/golang-set/v2 v2.6.0 github.com/dominikbraun/graph v0.23.0 @@ -50,7 +46,6 @@ require ( github.com/hashicorp/go-envparse v0.1.0 github.com/hashicorp/go-plugin v1.7.0 github.com/hashicorp/go-retryablehttp v0.7.7 - github.com/hdevalence/ed25519consensus v0.2.0 github.com/holiman/uint256 v1.3.2 github.com/imdario/mergo v0.3.16 github.com/jackc/pgconn v1.14.3 @@ -129,8 +124,6 @@ require ( github.com/unrolled/secure v1.13.0 github.com/urfave/cli v1.22.14 github.com/wk8/go-ordered-map/v2 v2.1.8 - github.com/xssnick/tonutils-go v1.14.1 - go.dedis.ch/fixbuf v1.0.3 go.dedis.ch/kyber/v3 v3.1.0 go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.49.0 go.opentelemetry.io/otel v1.39.0 @@ -174,6 +167,8 @@ require ( github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/NethermindEth/juno v0.12.5 // indirect + github.com/NethermindEth/starknet.go v0.8.0 // indirect github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect github.com/VictoriaMetrics/fastcache v1.13.0 // indirect github.com/XSAM/otelsql v0.37.0 // indirect @@ -190,6 +185,7 @@ require ( github.com/blendle/zapdriver v1.3.1 // indirect github.com/block-vision/sui-go-sdk v1.1.4 // indirect github.com/btcsuite/btcd v0.24.2 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/btcsuite/btcd/btcutil v1.1.6 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect @@ -217,6 +213,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.1.1 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect + github.com/cosmos/cosmos-sdk v0.50.14 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogoproto v1.7.0 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect @@ -293,6 +290,7 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/yamux v0.1.2 // indirect github.com/hasura/go-graphql-client v0.14.5 // indirect + github.com/hdevalence/ed25519consensus v0.2.0 // indirect github.com/holiman/billy v0.0.0-20250707135307-f2f9b9aae7db // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/huin/goupnp v1.3.0 // indirect @@ -393,11 +391,13 @@ require ( github.com/valyala/fastjson v1.6.4 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect + github.com/xssnick/tonutils-go v1.14.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect github.com/zksync-sdk/zksync2-go v1.1.1-0.20250620124214-2c742ee399c6 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect + go.dedis.ch/fixbuf v1.0.3 // indirect go.dedis.ch/protobuf v1.0.11 // indirect go.etcd.io/bbolt v1.4.2 // indirect go.mongodb.org/mongo-driver v1.17.2 // indirect diff --git a/go.sum b/go.sum index 970d864aa74..e87b1138561 100644 --- a/go.sum +++ b/go.sum @@ -1183,14 +1183,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250 github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1:e/L0oKHTwXjqIf66vw8NWYvXecCq5tybGwHm7YK9wuo= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47 h1:5N85Xb0EHgdovqvI4J95Wh3EEgobhxFu8NwY9XVKbbE= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= @@ -1199,8 +1193,6 @@ github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-2025121515250 github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340/go.mod h1:P/0OSXUlFaxxD4B/P6HWbxYtIRmmWGDJAvanq19879c= github.com/smartcontractkit/chainlink-data-streams v0.1.11 h1:yBzjU0Cu8AcfuM858G4xcQIulfNQkPfpUs5FDxX9UaY= github.com/smartcontractkit/chainlink-data-streams v0.1.11/go.mod h1:8rUcGhjeXBoTFx2MynWgXiBWzVSB+LXd9JR6m8y2FfQ= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f h1:29dXt+8hnpSK42N/O+u9Wn3rH8ZTeLYAj7jhbdZvpnI= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= @@ -1227,8 +1219,6 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0. github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 7dd5667ca30..348aec08321 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1613,12 +1613,9 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1:e/L0oKHTwXjqIf66vw8NWYvXecCq5tybGwHm7YK9wuo= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= @@ -1628,8 +1625,7 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.11 h1:yBzjU0Cu8AcfuM858G github.com/smartcontractkit/chainlink-data-streams v0.1.11/go.mod h1:8rUcGhjeXBoTFx2MynWgXiBWzVSB+LXd9JR6m8y2FfQ= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 h1:wVGho+uL3UEqhzMtAXmtZDUQ14J1Fmm7PkqJDuJWd1c= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f h1:29dXt+8hnpSK42N/O+u9Wn3rH8ZTeLYAj7jhbdZvpnI= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= @@ -1655,8 +1651,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0. github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index d992feb05a2..12bd3fb3a33 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1591,12 +1591,9 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1:e/L0oKHTwXjqIf66vw8NWYvXecCq5tybGwHm7YK9wuo= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= @@ -1606,8 +1603,7 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.11 h1:yBzjU0Cu8AcfuM858G github.com/smartcontractkit/chainlink-data-streams v0.1.11/go.mod h1:8rUcGhjeXBoTFx2MynWgXiBWzVSB+LXd9JR6m8y2FfQ= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 h1:wVGho+uL3UEqhzMtAXmtZDUQ14J1Fmm7PkqJDuJWd1c= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f h1:29dXt+8hnpSK42N/O+u9Wn3rH8ZTeLYAj7jhbdZvpnI= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= @@ -1633,8 +1629,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0. github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= diff --git a/system-tests/lib/go.sum b/system-tests/lib/go.sum index 9a084b81be3..f0e2f89f89e 100644 --- a/system-tests/lib/go.sum +++ b/system-tests/lib/go.sum @@ -1568,12 +1568,9 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1:e/L0oKHTwXjqIf66vw8NWYvXecCq5tybGwHm7YK9wuo= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= @@ -1583,8 +1580,7 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.11 h1:yBzjU0Cu8AcfuM858G github.com/smartcontractkit/chainlink-data-streams v0.1.11/go.mod h1:8rUcGhjeXBoTFx2MynWgXiBWzVSB+LXd9JR6m8y2FfQ= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 h1:wVGho+uL3UEqhzMtAXmtZDUQ14J1Fmm7PkqJDuJWd1c= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f h1:29dXt+8hnpSK42N/O+u9Wn3rH8ZTeLYAj7jhbdZvpnI= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= @@ -1610,8 +1606,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0. github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= diff --git a/system-tests/tests/go.sum b/system-tests/tests/go.sum index c9e2421df21..bbadc475e40 100644 --- a/system-tests/tests/go.sum +++ b/system-tests/tests/go.sum @@ -1777,12 +1777,9 @@ github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c84 github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260129103204-4c8453dd8139/go.mod h1:gUbichNQBqk+fBF2aV40ZkzFmAJ8SygH6DEPd3cJkQE= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856 h1:e/L0oKHTwXjqIf66vw8NWYvXecCq5tybGwHm7YK9wuo= github.com/smartcontractkit/chainlink-ccv v0.0.0-20260210123725-95a6e7788856/go.mod h1:wLN3X89JoiWr951CX+lALwmDirEm1KzP0n+gGFblwxw= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9 h1:dWqd2lOW3GbwtgZEeDSDI1b1X175MPOlCU6GDQQVBjk= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260211140822-b833b412cdd9/go.mod h1:SMegDBf3KDs2tuKApmTRyO2xQthMu3gV2J+IuHEs0Y0= -github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260215162157-381c8da90f47/go.mod h1:H9zHzcUWeZImeuZh4PkjMAqOhO0WeG9+OMWtxONMCZA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4 h1:NOUsjsMzNecbjiPWUQGlRSRAutEvCFrqqyETDJeh5q4= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20251211140724-319861e514c4/go.mod h1:Zpvul9sTcZNAZOVzt5vBl1XZGNvQebFpnpn3/KOQvOQ= @@ -1792,8 +1789,7 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.11 h1:yBzjU0Cu8AcfuM858G github.com/smartcontractkit/chainlink-data-streams v0.1.11/go.mod h1:8rUcGhjeXBoTFx2MynWgXiBWzVSB+LXd9JR6m8y2FfQ= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6 h1:wVGho+uL3UEqhzMtAXmtZDUQ14J1Fmm7PkqJDuJWd1c= github.com/smartcontractkit/chainlink-deployments-framework v0.80.1-0.20260209182815-b296b7df28a6/go.mod h1:0EzSyjHDLYSNqo3Bp9lSQs53CTaGbXHB5ovCa6BoOOM= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848 h1:B2ns2U3nZs8Wk0coMobIzO0ZI8/BmPLJzki/DHZfPEo= -github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217091030-daa23bfb6848/go.mod h1:L5v6d4KEG8+WkxBE34WhjC4AsDzSB6fqF5WpeSyGJKw= +github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f h1:29dXt+8hnpSK42N/O+u9Wn3rH8ZTeLYAj7jhbdZvpnI= github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260217171105-755485c4e00f/go.mod h1:vf3/QOdXKTaNzrD2h2wzklHk+MvDC+J0kKmqdIz4www= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3 h1:V22ITnWmgBAyxH+VVVo1jxm/LeJ3jcVMCVYB+zLN5mU= github.com/smartcontractkit/chainlink-evm/contracts/cre/gobindings v0.0.0-20260107191744-4b93f62cffe3/go.mod h1:u5vhpPHVUdGUni9o00MBu2aKPE0Q2DRoipAGPYD01e0= @@ -1819,8 +1815,7 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0. github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE=