Skip to content

Commit c448d8d

Browse files
Convert conf http to DON runtime (#260)
* Initial change: convert conf http to DON runtime * update go mods to latest sha * bump go mods --------- Co-authored-by: Prashant Yadav <prashant.yadav@smartcontract.com>
1 parent 6611b73 commit c448d8d

5 files changed

Lines changed: 36 additions & 42 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/smartcontractkit/chain-selectors v1.0.91
2727
github.com/smartcontractkit/chainlink-common v0.9.6-0.20260206011444-ed1fb0284e5d
2828
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251222115927-36a18321243c
29-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260206000552-087e235a7963
29+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260211172625-dff40e83b3c9
3030
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260106052706-6dd937cb5ec6
3131
github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.3
3232
github.com/smartcontractkit/chainlink/deployment v0.0.0-20260109210342-7c60a208545f

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,8 +1135,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.
11351135
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g=
11361136
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ=
11371137
github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ=
1138-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260206000552-087e235a7963 h1:DCLvEn4KkFzYbK/AYl4vJmf6EHaskPYvGDGdd0kOma0=
1139-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260206000552-087e235a7963/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8=
1138+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260211172625-dff40e83b3c9 h1:tp3AN+zX8dboiugE005O3rY/HBWKmSdN9LhNbZGhNWY=
1139+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260211172625-dff40e83b3c9/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8=
11401140
github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4=
11411141
github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE=
11421142
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM=

test/test_project/por_workflow/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ go 1.25.3
55
require (
66
github.com/ethereum/go-ethereum v1.16.4
77
github.com/shopspring/decimal v1.4.0
8-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260209203401-a488315d180f
8+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260211172625-dff40e83b3c9
99
github.com/smartcontractkit/cre-sdk-go v1.1.3
1010
github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/evm v1.0.0-beta.0
11-
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/confidentialhttp v0.0.0-20260210160211-a76237545074
11+
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/confidentialhttp v0.0.0-20260211203328-1f3721436119
1212
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/http v1.0.0-beta.0
1313
github.com/smartcontractkit/cre-sdk-go/capabilities/scheduler/cron v1.0.0-beta.0
1414
google.golang.org/protobuf v1.36.8

test/test_project/por_workflow/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1
173173
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
174174
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
175175
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
176-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260209203401-a488315d180f h1:YBpKK0O7IcbkMyhPRXxA4HGh9OYt+N5Qicx28z8NMvE=
177-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260209203401-a488315d180f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8=
176+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260211172625-dff40e83b3c9 h1:tp3AN+zX8dboiugE005O3rY/HBWKmSdN9LhNbZGhNWY=
177+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260211172625-dff40e83b3c9/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8=
178178
github.com/smartcontractkit/cre-sdk-go v1.1.3 h1:uNtAuLAgJbe4I5ThuI627opA0ruopMvVCdbhIefyUIE=
179179
github.com/smartcontractkit/cre-sdk-go v1.1.3/go.mod h1:sgiRyHUiPcxp1e/EMnaJ+ddMFL4MbE3UMZ2MORAAS9U=
180180
github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/evm v1.0.0-beta.0 h1:t2bzRHnqkyxvcrJKSsKPmCGLMjGO97ESgrtLCnTIEQw=
181181
github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/evm v1.0.0-beta.0/go.mod h1:VVJ4mvA7wOU1Ic5b/vTaBMHEUysyxd0gdPPXkAu8CmY=
182-
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/confidentialhttp v0.0.0-20260210160211-a76237545074 h1:7YRF8i27mvt6zNaylOrWFteMbGdOTyzY7piT0APippA=
183-
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/confidentialhttp v0.0.0-20260210160211-a76237545074/go.mod h1:U+r6lxSMrOfl9RTo9FWGCNQoDIptN6scEzBlRq0P2Ao=
182+
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/confidentialhttp v0.0.0-20260211203328-1f3721436119 h1:P69M59tBeLevOldspLxedrYNyAu+vtaD6wnpWwhstxM=
183+
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/confidentialhttp v0.0.0-20260211203328-1f3721436119/go.mod h1:KOn3NK4AbtvuMs2oKlNRxL2fACSuuGI114xPqO5igtQ=
184184
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/http v1.0.0-beta.0 h1:E3S3Uk4O2/cEJtgh+mDhakK3HFcDI2zeqJIsTxUWeS8=
185185
github.com/smartcontractkit/cre-sdk-go/capabilities/networking/http v1.0.0-beta.0/go.mod h1:M83m3FsM1uqVu06OO58mKUSZJjjH8OGJsmvFpFlRDxI=
186186
github.com/smartcontractkit/cre-sdk-go/capabilities/scheduler/cron v1.0.0-beta.0 h1:Tui4xQVln7Qtk3CgjBRgDfihgEaAJy2t2MofghiGIDA=

test/test_project/por_workflow/main.go

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -105,40 +105,34 @@ func doPOR(config *Config, runtime cre.Runtime, runTime time.Time) (string, erro
105105

106106
logger.Info("ReserveInfo", "reserveInfo", reserveInfo)
107107

108-
porResp, err := cre.RunInNodeMode(*config, runtime,
109-
func(config Config, nodeRuntime cre.NodeRuntime) (PORResponse, error) {
110-
confHttpClient := confidentialhttp.Client{}
111-
confOutput, err := confHttpClient.SendRequest(nodeRuntime, &confidentialhttp.ConfidentialHTTPRequest{
112-
Request: &confidentialhttp.HTTPRequest{
113-
Url: config.URL,
114-
Method: "GET",
115-
MultiHeaders: map[string]*confidentialhttp.HeaderValues{
116-
"Authorization": {
117-
Values: []string{"Basic {{.API_KEY}}"},
118-
},
119-
},
120-
EncryptOutput: true,
108+
confHttpClient := confidentialhttp.Client{}
109+
confOutput, err := confHttpClient.SendRequest(runtime, &confidentialhttp.ConfidentialHTTPRequest{
110+
Request: &confidentialhttp.HTTPRequest{
111+
Url: config.URL,
112+
Method: "GET",
113+
MultiHeaders: map[string]*confidentialhttp.HeaderValues{
114+
"Authorization": {
115+
Values: []string{"Basic {{.API_KEY}}"},
121116
},
122-
VaultDonSecrets: []*confidentialhttp.SecretIdentifier{
123-
{
124-
Key: "API_KEY",
125-
},
126-
},
127-
}).Await()
128-
if err != nil {
129-
logger.Error("error fetching conf por", "err", err)
130-
return PORResponse{}, err
131-
}
132-
logger.Info("Conf POR response", "response", confOutput)
133-
134-
porResp := &PORResponse{}
135-
if err = json.Unmarshal(confOutput.Body, porResp); err != nil {
136-
return PORResponse{}, err
137-
}
138-
139-
return *porResp, nil
140-
}, cre.ConsensusIdenticalAggregation[PORResponse](),
141-
).Await()
117+
},
118+
EncryptOutput: true,
119+
},
120+
VaultDonSecrets: []*confidentialhttp.SecretIdentifier{
121+
{
122+
Key: "API_KEY",
123+
},
124+
},
125+
}).Await()
126+
if err != nil {
127+
logger.Error("error fetching conf por", "err", err)
128+
return "", err
129+
}
130+
logger.Info("Conf POR response", "response", confOutput)
131+
132+
porResp := &PORResponse{}
133+
if err = json.Unmarshal(confOutput.Body, porResp); err != nil {
134+
return "", err
135+
}
142136

143137
if porResp.Ripcord {
144138
return "", errors.New("ripcord is true")

0 commit comments

Comments
 (0)