forked from smartcontractkit/chainlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multi-chain fixes (smartcontractkit#14077)
* ocr2: Shouldn't require "publicKey" under the multi-chain codepath * ocr2: Use parent ocrKeyBundleID for publicKey when using multi-chain
- Loading branch information
Showing
7 changed files
with
5 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
juelsPerFeeCoinSource = """ | ||
ds1 [type=bridge name=voter_turnout]; | ||
|
@@ -105,7 +104,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
juelsPerFeeCoinSource = """ | ||
ds1 [type=bridge name=voter_turnout]; | ||
|
@@ -150,7 +148,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
|
@@ -174,7 +171,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
|
@@ -200,7 +196,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
|
@@ -226,7 +221,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
|
@@ -253,7 +247,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
|
@@ -279,7 +272,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
|
@@ -303,7 +295,6 @@ chainID = 1337 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
|
@@ -344,7 +335,6 @@ answer1 [type=median index=0]; | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
juelsPerFeeCoinSource = """ | ||
ds1 [type=bridge name=voter_turnout]; | ||
|
@@ -383,7 +373,6 @@ answer1 [type=median index=0]; | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
juelsPerFeeCoinSource = """ | ||
-> | ||
|
@@ -415,7 +404,6 @@ answer1 [type=median index=0]; | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
juelsPerFeeCoinSource = """ | ||
ds1 [type=bridge name=voter_turnout]; | ||
|
@@ -429,46 +417,6 @@ chainID = 1337 | |
require.Contains(t, err.Error(), "no such relay blerg supported") | ||
}, | ||
}, | ||
{ | ||
name: "Generic public onchain signing strategy with no public key", | ||
toml: ` | ||
type = "offchainreporting2" | ||
pluginType = "plugin" | ||
schemaVersion = 1 | ||
relay = "evm" | ||
contractID = "0x613a38AC1659769640aaE063C651F48E0250454C" | ||
p2pPeerID = "12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq" | ||
p2pv2Bootstrappers = [ | ||
"[email protected]:5001", | ||
] | ||
ocrKeyBundleID = "73e8966a78ca09bb912e9565cfb79fbe8a6048fab1f0cf49b18047c3895e0447" | ||
monitoringEndpoint = "chain.link:4321" | ||
transmitterID = "0xF67D0290337bca0847005C7ffD1BC75BA9AAE6e4" | ||
observationTimeout = "10s" | ||
observationSource = """ | ||
ds1 [type=bridge name=voter_turnout]; | ||
ds1_parse [type=jsonparse path="one,two"]; | ||
ds1_multiply [type=multiply times=1.23]; | ||
ds1 -> ds1_parse -> ds1_multiply -> answer1; | ||
answer1 [type=median index=0]; | ||
""" | ||
[relayConfig] | ||
chainID = 1337 | ||
[onchainSigningStrategy] | ||
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "" | ||
[pluginConfig] | ||
pluginName = "median" | ||
telemetryType = "median" | ||
OCRVersion=2 | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
require.Error(t, err) | ||
require.Contains(t, err.Error(), "must provide public key for the onchain signing strategy") | ||
}, | ||
}, | ||
{ | ||
name: "Generic plugin config validation - nothing provided", | ||
toml: ` | ||
|
@@ -493,7 +441,6 @@ chainID = 4 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
`, | ||
|
@@ -525,7 +472,6 @@ chainID = 4 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
PluginName="some random name" | ||
|
@@ -559,7 +505,6 @@ chainID = 4 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
PluginName="some random name" | ||
|
@@ -594,7 +539,6 @@ chainID = 4 | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
[pluginConfig] | ||
PluginName="some random name" | ||
|
@@ -712,7 +656,6 @@ func TestOCR2OnchainSigningStrategy_Unmarshal(t *testing.T) { | |
strategyName = "single-chain" | ||
[onchainSigningStrategy.config] | ||
evm = "08d14c6eed757414d72055d28de6caf06535806c6a14e450f3a2f1c854420e17" | ||
publicKey = "0x1234567890123456789012345678901234567890" | ||
` | ||
oss := &envelope2{} | ||
tree, err := toml.Load(payload) | ||
|
@@ -725,12 +668,9 @@ publicKey = "0x1234567890123456789012345678901234567890" | |
err = json.Unmarshal(b, oss) | ||
require.NoError(t, err) | ||
|
||
pk, err := oss.OnchainSigningStrategy.PublicKey() | ||
require.NoError(t, err) | ||
kbID, err := oss.OnchainSigningStrategy.KeyBundleID("evm") | ||
require.NoError(t, err) | ||
|
||
assert.False(t, oss.OnchainSigningStrategy.IsMultiChain()) | ||
assert.Equal(t, "0x1234567890123456789012345678901234567890", pk) | ||
assert.Equal(t, "08d14c6eed757414d72055d28de6caf06535806c6a14e450f3a2f1c854420e17", kbID) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters