-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add p2pv2_bootstrappers field to OCR1 job spec (#6754)
* peer_wrapper.go OCR1: P2PV2_BOOTSTRAPPERS no longer required at startup * services/ocr/delegate.go: Update validation of v1 & v2 bootstrap peers * Add p2pv2Bootstrappers field to OCR1 job spec - Add corresponding p2pv2_bootstrappers column to ocr_oracle_specs table - Update web / ui / presenter / resolver with new field - Update tests * Fix bug in develop branch which was causing several tests to fail with: ERROR: null value in column "p2pv2_bootstrappers" of relation "ocr_oracle_specs" violates not-null constraint (SQLSTATE 23502)
- Loading branch information
1 parent
c476fa8
commit 0d622c9
Showing
24 changed files
with
133 additions
and
28 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
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 |
---|---|---|
|
@@ -6,12 +6,13 @@ import ( | |
|
||
"github.com/ethereum/go-ethereum/common/hexutil" | ||
"github.com/manyminds/api2go/jsonapi" | ||
"github.com/smartcontractkit/chainlink/core/internal/testutils/configtest" | ||
"github.com/smartcontractkit/chainlink/core/internal/testutils/evmtest" | ||
"github.com/smartcontractkit/chainlink/core/services/job" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
"gopkg.in/guregu/null.v4" | ||
|
||
"github.com/smartcontractkit/chainlink/core/internal/testutils/configtest" | ||
"github.com/smartcontractkit/chainlink/core/internal/testutils/evmtest" | ||
"github.com/smartcontractkit/chainlink/core/services/job" | ||
) | ||
|
||
func TestValidateOracleSpec(t *testing.T) { | ||
|
@@ -155,7 +156,7 @@ observationSource = """ | |
}, | ||
}, | ||
{ | ||
name: "invalid peer address", | ||
name: "invalid v1 bootstrap peer address", | ||
toml: ` | ||
type = "offchainreporting" | ||
schemaVersion = 1 | ||
|
@@ -166,6 +167,26 @@ isBootstrapPeer = false | |
observationSource = """ | ||
blah | ||
""" | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
require.Error(t, err) | ||
}, | ||
}, | ||
{ | ||
name: "invalid v2 bootstrapper address", | ||
toml: ` | ||
type = "offchainreporting" | ||
schemaVersion = 1 | ||
contractAddress = "0x613a38AC1659769640aaE063C651F48E0250454C" | ||
p2pPeerID = "12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq" | ||
p2pBootstrapPeers = [ | ||
"/dns4/chain.link/tcp/1234/p2p/16Uiu2HAm58SP7UL8zsnpeuwHfytLocaqgnyaYKP8wu7qRdrixLju", | ||
] | ||
p2pv2Bootstrappers = ["invalid bootstrapper /#@ address"] | ||
isBootstrapPeer = false | ||
observationSource = """ | ||
blah | ||
""" | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
require.Error(t, err) | ||
|
@@ -179,6 +200,9 @@ schemaVersion = 1 | |
contractAddress = "0x613a38AC1659769640aaE063C651F48E0250454C" | ||
p2pPeerID = "12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq" | ||
p2pBootstrapPeers = ["/dns4/chain.link/tcp/1234/p2p/16Uiu2HAm58SP7UL8zsnpeuwHfytLocaqgnyaYKP8wu7qRdrixLju"] | ||
p2pv2Bootstrappers = [ | ||
"[email protected]:5001", | ||
] | ||
isBootstrapPeer = false | ||
blockchainTimeout = "0s" | ||
observationSource = """ | ||
|
@@ -197,6 +221,9 @@ schemaVersion = 1 | |
contractAddress = "0x613a38AC1659769640aaE063C651F48E0250454C" | ||
p2pPeerID = "12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq" | ||
p2pBootstrapPeers = ["/dns4/chain.link/tcp/1234/p2p/16Uiu2HAm58SP7UL8zsnpeuwHfytLocaqgnyaYKP8wu7qRdrixLju"] | ||
p2pv2Bootstrappers = [ | ||
"[email protected]:5001", | ||
] | ||
isBootstrapPeer = false | ||
databaseTimeout = "0s" | ||
observationSource = """ | ||
|
@@ -269,11 +296,12 @@ schemaVersion = 1 | |
contractAddress = "0x613a38AC1659769640aaE063C651F48E0250454C" | ||
p2pPeerID = "12D3KooWHfYFQ8hGttAYbMCevQVESEQhzJAqFZokMVtom8bNxwGq" | ||
p2pBootstrapPeers = [] | ||
p2pv2Bootstrappers = [] | ||
isBootstrapPeer = true | ||
monitoringEndpoint = "\t/fd\2ff )(*&^%$#@" | ||
`, | ||
assertion: func(t *testing.T, os job.Job, err error) { | ||
require.EqualError(t, err, "toml error on load: (8, 23): invalid escape sequence: \\2") | ||
require.EqualError(t, err, "toml error on load: (9, 23): invalid escape sequence: \\2") | ||
}, | ||
}, | ||
{ | ||
|
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
7 changes: 7 additions & 0 deletions
7
core/store/migrate/migrations/0127_add_ocr1_p2pv2Bootstrappers.sql
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- +goose Up | ||
ALTER TABLE ocr_oracle_specs | ||
ADD COLUMN p2pv2_bootstrappers text[] NOT NULL DEFAULT '{}'; | ||
|
||
-- +goose Down | ||
ALTER TABLE ocr_oracle_specs | ||
DROP COLUMN p2pv2_bootstrappers; |
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
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
Oops, something went wrong.