Skip to content

Commit

Permalink
ks-478 aptos key bundle support (smartcontractkit#14803)
Browse files Browse the repository at this point in the history
* aptos key bundle support

* try something else

* debugging
  • Loading branch information
krehermann authored Oct 16, 2024
1 parent e2f06e0 commit 6275bd9
Show file tree
Hide file tree
Showing 6 changed files with 713 additions and 26 deletions.
7 changes: 5 additions & 2 deletions integration-tests/deployment/clo/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func NewDonEnv(t *testing.T, cfg DonEnvConfig) *deployment.Environment {
for _, nop := range cfg.Nops {
for _, node := range nop.Nodes {
for _, chain := range node.ChainConfigs {
if chain.Ocr1Config.IsBootstrap {
if chain.Ocr2Config.IsBootstrap {
t.Fatalf("Don nodes should not be bootstraps nop %s node %s chain %s", nop.ID, node.ID, chain.Network.ChainID)
}
}
Expand All @@ -47,13 +47,16 @@ func NewDonEnv(t *testing.T, cfg DonEnvConfig) *deployment.Environment {
return &out
}

func NewDonEnvWithMemoryChains(t *testing.T, cfg DonEnvConfig) *deployment.Environment {
func NewDonEnvWithMemoryChains(t *testing.T, cfg DonEnvConfig, ignore func(*models.NodeChainConfig) bool) *deployment.Environment {
e := NewDonEnv(t, cfg)
// overwrite the chains with memory chains
chains := make(map[uint64]struct{})
for _, nop := range cfg.Nops {
for _, node := range nop.Nodes {
for _, chain := range node.ChainConfigs {
if ignore(chain) {
continue
}
id, err := strconv.ParseUint(chain.Network.ChainID, 10, 64)
require.NoError(t, err, "failed to parse chain id to uint64")
chains[id] = struct{}{}
Expand Down
5 changes: 4 additions & 1 deletion integration-tests/deployment/clo/models/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

222 changes: 221 additions & 1 deletion integration-tests/deployment/clo/testdata/workflow_nodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,28 @@
"name": "Chainlink Sepolia Prod Keystone One 9",
"publicKey": "412dc6fe48ea4e34baaa77da2e3b032d39b938597b6f3d61fe7ed183a827a431",
"chainConfigs": [
{
"network": {
"id": "1401",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWBCMCCZZ8x57AXvJvpCujqhZzTjWXbReaRE8TxNr5dM4U",
"publicKey": "147d5cc651819b093cd2fdff9760f0f0f77b7ef7798d9e24fc6a350b7300e5d9"
},
"ocrKeyBundle": {
"bundleID": "d834cf7c830df7510228b33b138c018ff16b4eecf82273ed3bcd862bbbc046d4",
"configPublicKey": "6a1f37f06833c55ecf46233439ea6179a835bac6f2b2dee725b747c121813149",
"offchainPublicKey": "ff1144bbf648e6f76c58d0ce53a9a2cbe9a284d52db8691a714cac8e3a96b8b4",
"onchainSigningAddress": "4fa557850e4d5c21b3963c97414c1f37792700c4d3b8abdb904b765fd47e39bf"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down Expand Up @@ -103,6 +125,28 @@
"name": "Chainlink Sepolia Prod Keystone One 8",
"publicKey": "1141dd1e46797ced9b0fbad49115f18507f6f6e6e3cc86e7e5ba169e58645adc",
"chainConfigs": [
{
"network": {
"id": "1402",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWAUagqMycsro27kFznSQRHbhfCBLx8nKD4ptTiUGDe38c",
"publicKey": "09ca39cd924653c72fbb0e458b629c3efebdad3e29e7cd0b5760754d919ed829"
},
"ocrKeyBundle": {
"bundleID": "6726df46033038b724a4e6371807b6aa09efc829d0a3f7a5db4fd7df4b69fea7",
"configPublicKey": "0874e6cd5c8e651ab0ff564a474832ed9eaf2c5025b553f908d04921d9777d50",
"offchainPublicKey": "c791d2b9d3562f991af68ab7164a19734d551a9404d91c9571fdcdc5dcb237ca",
"onchainSigningAddress": "bddafb20cc50d89e0ae2f244908c27b1d639615d8186b28c357669de3359f208"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down Expand Up @@ -191,6 +235,28 @@
"name": "Chainlink Sepolia Prod Keystone One 7",
"publicKey": "b473091fe1d4dbbc26ad71c67b4432f8f4280e06bab5e2122a92f4ab8b6ff2f5",
"chainConfigs": [
{
"network": {
"id": "1403",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWQMCj73V5xmCd6C5VsJr7rbFG2TF9LwVcLiiBqXps9MgC",
"publicKey": "d7e9f2252b09edf0802a65b60bc9956691747894cb3ab9fefd072adf742eb9f1"
},
"ocrKeyBundle": {
"bundleID": "14082da0f33b4cec842bc1e1002e617a194ed4a81105603bd6c1edf784aa3743",
"configPublicKey": "209eea27e73b0ecc1c49b3ea274e4a18a1f5ed62fd79f443f0b5b9cc6019356e",
"offchainPublicKey": "cf0684a0e59399fe9b92cfc740d9696f925e78ee7d0273947e5f7b830070eaaa",
"onchainSigningAddress": "96dc85670c49caa986de4ad288e680e9afb0f5491160dcbb4868ca718e194fc8"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down Expand Up @@ -279,6 +345,28 @@
"name": "Chainlink Sepolia Prod Keystone One 6",
"publicKey": "75ac63fc97a31e31168084e0de8ccd2bea90059b609d962f3e43fc296cdba28d",
"chainConfigs": [
{
"network": {
"id": "1404",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWNJ8de3PUURZ2oucrVTpnRTqNBTUYwHLQjK9LzN3E6Mfn",
"publicKey": "b96933429b1a81c811e1195389d7733e936b03e8086e75ea1fa92c61564b6c31"
},
"ocrKeyBundle": {
"bundleID": "b419e9e3f1256aa2907a1a396bdf27ba5002a30eee440ab96cb60369429ce277",
"configPublicKey": "3ae1a1c713e4ad63f67191fd93620c9eebe44e1d5f3264036ec0fbcd59cf9664",
"offchainPublicKey": "6fc8c3fb55b39577abbab20028bee93d1d6d8a888dd298354b95d4af3ccb6009",
"onchainSigningAddress": "4a94c75cb9fe8b1fba86fd4b71ad130943281fdefad10216c46eb2285d60950f"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down Expand Up @@ -367,6 +455,28 @@
"name": "Chainlink Sepolia Prod Keystone One 5",
"publicKey": "4542f4fd2ed150c8c976b39802fe3d994aec3ac94fd11e7817f693b1c9a1dabb",
"chainConfigs": [
{
"network": {
"id": "14005",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWR8d5kbZb7YiQWKpT1J1PfMqNaGAmb4jBFx9DWag4hpSZ",
"publicKey": "e38c9f2760db006f070e9cc1bc1c2269ad033751adaa85d022fb760cbc5b5ef6"
},
"ocrKeyBundle": {
"bundleID": "44b5f46bfbb04d0984469298ec43c350ec6b2cd4556b18265ebac1b6cc329c7c",
"configPublicKey": "263bee0d09d90e0e618c4cdd630d1437f7377f2d544df57f39ddd47984970555",
"offchainPublicKey": "11674b98849d8e070ac69d37c284b3091fcd374913f52b2b83ce2d9a4a4e0213",
"onchainSigningAddress": "425d1354a7b8180252a221040c718cac0ba0251c7efe31a2acefbba578dc2153"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down Expand Up @@ -455,6 +565,28 @@
"name": "Chainlink Sepolia Prod Keystone One 4",
"publicKey": "07e0ffc57b6263604df517b94bd986169451a3c90600a855bb19212dc575de54",
"chainConfigs": [
{
"network": {
"id": "1406",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWHqR1w26yHatTSZQW3xbRct9SxWzVj9X4SpU916Hy8jYg",
"publicKey": "77224be9d052343b1d17156a1e463625c0d746468d4f5a44cddd452365b1d4ed"
},
"ocrKeyBundle": {
"bundleID": "b1ab478c1322bc4f8227be50898a8044efc70cf0156ec53cf132119db7e94dea",
"configPublicKey": "96ae354418e50dcd5b3dae62e8f0bc911bbce7f761220837aacdaa6f82bd0f29",
"offchainPublicKey": "b34bb49788541de8b6cfb321799a41927a391a4eb135c74f6cb14eec0531ee6f",
"onchainSigningAddress": "1221e131ef21014a6a99ed22376eb869746a3b5e30fd202cf79e44efaeb8c5c2"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down Expand Up @@ -541,9 +673,31 @@
"nodes": [
{
"id": "786",
"name": "\tChainlink Sepolia Prod Keystone One 3",
"name": "Chainlink Sepolia Prod Keystone One 3",
"publicKey": "487901e0c0a9d3c66e7cfc50f3a9e3cdbfdf1b0107273d73d94a91d278545516",
"chainConfigs": [
{
"network": {
"id": "1417",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWCcVLytqinD8xMn27NvomcQhj2mqMVzyGemz6oPwv1SMT",
"publicKey": "298834a041a056df58c839cb53d99b78558693042e54dff238f504f16d18d4b6"
},
"ocrKeyBundle": {
"bundleID": "5811a96a0c3b5f5b52973eee10e5771cf5953d37d5616ea71f7ae76f09f6e332",
"configPublicKey": "a7f3435bfbaabebd1572142ff1aec9ed98758d9bb098f1fcc77262fcae7f4171",
"offchainPublicKey": "886044b333af681ab4bf3be663122524ece9725e110ac2a64cda8526cad6983e",
"onchainSigningAddress": "046faf34ebfe42510251e6098bc34fa3dd5f2de38ac07e47f2d1b34ac770639f"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down Expand Up @@ -661,6 +815,28 @@
"plugins": {}
}
},
{
"network": {
"id": "1408",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWGDmBKZ7B3PynGrvfHTJMEecpjfHts9YK5NWk8oJuxcAo",
"publicKey": "5f247f61a6d5bfdd1d5064db0bd25fe443648133c6131975edb23481424e3d9c"
},
"ocrKeyBundle": {
"bundleID": "e57c608a899d80e510913d2c7ef55758ee81e9eb73eb531003af1564307fd133",
"configPublicKey": "412a4bed6b064c17168871d28dbb965cc0a898f7b19eb3fa7cd01d3e3d10b66c",
"offchainPublicKey": "450aa794c87198a595761a8c18f0f1590046c8092960036638d002256af95254",
"onchainSigningAddress": "ba20d3da9b07663f1e8039081a514649fd61a48be2d241bc63537ee47d028fcd"
},
"plugins": {}
}
},
{
"network": {
"id": "129",
Expand Down Expand Up @@ -722,6 +898,28 @@
"name": "Chainlink Sepolia Prod Keystone One 1",
"publicKey": "28b91143ec9111796a7d63e14c1cf6bb01b4ed59667ab54f5bc72ebe49c881be",
"chainConfigs": [
{
"network": {
"id": "1409",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWCbDiL7sP9BVby5KaZqPpaVP1RBokoa9ShzH5WhkYX46v",
"publicKey": "2934f31f278e5c60618f85861bd6add54a4525d79a642019bdc87d75d26372c3"
},
"ocrKeyBundle": {
"bundleID": "4b6418b8ab88ea1244c3c48eb5f4c86f9f0301aebffcac4fcfac5cdfb7cf6933",
"configPublicKey": "a38dbe521643479d78ab5477cae78161a5de0030c95098e3fbb09add6aca9508",
"offchainPublicKey": "7718dcbf40173dbd876720aa64028a6b18bf9a87543fc83a549515c4937962e3",
"onchainSigningAddress": "247d0189f65f58be83a4e7d87ff338aaf8956e9acb9fcc783f34f9edc29d1b40"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down Expand Up @@ -811,6 +1009,28 @@
"name": "Chainlink Sepolia Prod Keystone One 0",
"publicKey": "403b72f0b1b3b5f5a91bcfedb7f28599767502a04b5b7e067fcf3782e23eeb9c",
"chainConfigs": [
{
"network": {
"id": "1411",
"chainID": "2",
"chainType": "APTOS",
"name": "APTOS TEST"
},
"ocr2Config": {
"enabled": true,
"p2pKeyBundle": {
"peerID": "p2p_12D3KooWMWUKdoAc2ruZf9f55p7NVFj7AFiPm67xjQ8BZBwkqyYv",
"publicKey": "adb6bf005cdb23f21e11b82d66b9f62628c2939640ed93028bf0dad3923c5a8b"
},
"ocrKeyBundle": {
"bundleID": "b4504e84ea307cc2afffca0206bd4bf8e98acc5a03c9bd47b2456e3845a5d1fa",
"configPublicKey": "559ea4ee5774a31d97914a4220d6a47094ae8e2cf0806e80e1eacd851f3e6757",
"offchainPublicKey": "4ec55bbe76a6b1fdc885c59da85a8fe44cf06afe1e4719f0824a731937526c52",
"onchainSigningAddress": "b8834eaa062f0df4ccfe7832253920071ec14dc4f78b13ecdda10b824e2dd3b6"
},
"plugins": {}
}
},
{
"network": {
"id": "140",
Expand Down
13 changes: 9 additions & 4 deletions integration-tests/deployment/keystone/deploy_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package keystone_test

import (
"context"
"encoding/json"
"fmt"
"os"
Expand All @@ -13,6 +12,8 @@ import (

chainsel "github.com/smartcontractkit/chain-selectors"

"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"github.com/smartcontractkit/chainlink/integration-tests/deployment"
"github.com/smartcontractkit/chainlink/integration-tests/deployment/clo"
"github.com/smartcontractkit/chainlink/integration-tests/deployment/clo/models"
Expand Down Expand Up @@ -57,8 +58,7 @@ func TestDeploy(t *testing.T) {
MaxFaultyOracles: len(wfNops) / 3,
}

ctx := context.Background()

ctx := tests.Context(t)
// explicitly deploy the contracts
cs, err := keystone.DeployContracts(lggr, env, registryChainSel)
require.NoError(t, err)
Expand Down Expand Up @@ -157,12 +157,17 @@ func TestDeploy(t *testing.T) {

func makeMultiDonTestEnv(t *testing.T, lggr logger.Logger, dons []keystone.DonCapabilities) *deployment.Environment {
var donToEnv = make(map[string]*deployment.Environment)
// chain selector lib doesn't support chain id 2 and we don't use it in tests
// because it's not an evm chain
ignoreAptos := func(c *models.NodeChainConfig) bool {
return c.Network.ChainID == "2" // aptos chain
}
for _, don := range dons {
env := clo.NewDonEnvWithMemoryChains(t, clo.DonEnvConfig{
DonName: don.Name,
Nops: don.Nops,
Logger: lggr,
})
}, ignoreAptos)
donToEnv[don.Name] = env
}
menv := clo.NewTestEnv(t, lggr, donToEnv)
Expand Down
Loading

0 comments on commit 6275bd9

Please sign in to comment.