Skip to content

Commit 67eb487

Browse files
committed
Merge branch 'main' of github.com:smartcontractkit/chainlink-common into branch-out
2 parents 7be1a26 + c188380 commit 67eb487

File tree

28 files changed

+2206
-170
lines changed

28 files changed

+2206
-170
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
/keystore @smartcontractkit/prodsec-public @smartcontractkit/foundations
1111
/pkg/beholder/ @smartcontractkit/data-tooling
12+
/pkg/capabilities/v2/actions/confidentialhttp @smartcontractkit/privacy
1213
/pkg/capabilities/v2/chain-capabilities @smartcontractkit/keystone @smartcontractkit/capabilities-team @smartcontractkit/bix-framework
1314
/pkg/chains/evm @smartcontractkit/bix-framework
1415
/pkg/chipingress/ @smartcontractkit/data-tooling
@@ -21,4 +22,4 @@
2122
/pkg/types/ccipocr3 @smartcontractkit/ccip-offchain
2223
/pkg/values/ @smartcontractkit/keystone @smartcontractkit/capabilities-team
2324
/pkg/workflows/ @smartcontractkit/keystone
24-
/pkg/storage/ @smartcontractkit/dev-services
25+
/pkg/storage/ @smartcontractkit/dev-services

go.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ flowchart LR
99
chainlink-common --> chainlink-protos/billing/go
1010
chainlink-common --> chainlink-protos/cre/go
1111
chainlink-common --> chainlink-protos/linking-service/go
12+
chainlink-common --> chainlink-protos/node-platform
1213
chainlink-common --> chainlink-protos/storage-service
1314
chainlink-common --> freeport
1415
chainlink-common --> grpc-proxy
@@ -28,6 +29,8 @@ flowchart LR
2829
click chainlink-protos/cre/go href "https://github.com/smartcontractkit/chainlink-protos"
2930
chainlink-protos/linking-service/go
3031
click chainlink-protos/linking-service/go href "https://github.com/smartcontractkit/chainlink-protos"
32+
chainlink-protos/node-platform
33+
click chainlink-protos/node-platform href "https://github.com/smartcontractkit/chainlink-protos"
3134
chainlink-protos/storage-service
3235
click chainlink-protos/storage-service href "https://github.com/smartcontractkit/chainlink-protos"
3336
chainlink-protos/workflows/go
@@ -52,6 +55,7 @@ flowchart LR
5255
chainlink-protos/billing/go
5356
chainlink-protos/cre/go
5457
chainlink-protos/linking-service/go
58+
chainlink-protos/node-platform
5559
chainlink-protos/storage-service
5660
chainlink-protos/workflows/go
5761
end

go.mod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ require (
4141
github.com/smartcontractkit/chain-selectors v1.0.89
4242
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10
4343
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4
44-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260204211151-e87a8bf189b0
44+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe
4545
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b
46+
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b
4647
github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0
47-
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260106052706-6dd937cb5ec6
48+
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260205231316-3b9c600dd791
4849
github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e
4950
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7
5051
github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,16 @@ github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9
332332
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY=
333333
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4 h1:GCzrxDWn3b7jFfEA+WiYRi8CKoegsayiDoJBCjYkneE=
334334
github.com/smartcontractkit/chainlink-protos/billing/go v0.0.0-20251024234028-0988426d98f4/go.mod h1:HHGeDUpAsPa0pmOx7wrByCitjQ0mbUxf0R9v+g67uCA=
335-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260204211151-e87a8bf189b0 h1:+/0xWigvOxFLghyivyxiUCYGcky/7i8IxfGTdTeaXFg=
336-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260204211151-e87a8bf189b0/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8=
335+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ=
336+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8=
337337
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM=
338338
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY=
339+
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8=
340+
github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b/go.mod h1:dkR2uYg9XYJuT1JASkPzWE51jjFkVb86P7a/yXe5/GM=
339341
github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0 h1:B7itmjy+CMJ26elVw/cAJqqhBQ3Xa/mBYWK0/rQ5MuI=
340342
github.com/smartcontractkit/chainlink-protos/storage-service v0.3.0/go.mod h1:h6kqaGajbNRrezm56zhx03p0mVmmA2xxj7E/M4ytLUA=
341-
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260106052706-6dd937cb5ec6 h1:BXMylId1EoFxuAy++JRifxUF+P/I7v5BEBh0wECtrEM=
342-
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260106052706-6dd937cb5ec6/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc=
343+
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260205231316-3b9c600dd791 h1:S+yHuhcny3AKOhCekMQa65uUeR/p9rGrUIb8eifkSTY=
344+
github.com/smartcontractkit/chainlink-protos/workflows/go v0.0.0-20260205231316-3b9c600dd791/go.mod h1:GTpDgyK0OObf7jpch6p8N281KxN92wbB8serZhU9yRc=
343345
github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e h1:Hv9Mww35LrufCdM9wtS9yVi/rEWGI1UnjHbcKKU0nVY=
344346
github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e/go.mod h1:T4zH9R8R8lVWKfU7tUvYz2o2jMv1OpGCdpY2j2QZXzU=
345347
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=

keystore/corekeys/chaintype.go

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
package corekeys
2+
3+
import (
4+
"fmt"
5+
"slices"
6+
"strings"
7+
)
8+
9+
// ChainType denotes the chain or network to work with
10+
type ChainType string
11+
12+
const (
13+
// EVM for Ethereum or other chains supporting the EVM
14+
EVM ChainType = "evm"
15+
// Cosmos for the Cosmos chain
16+
Cosmos ChainType = "cosmos"
17+
// Solana for the Solana chain
18+
Solana ChainType = "solana"
19+
// StarkNet for the StarkNet chain
20+
StarkNet ChainType = "starknet"
21+
// Aptos for the Aptos chain
22+
Aptos ChainType = "aptos"
23+
// Tron for the Tron chain
24+
Tron ChainType = "tron"
25+
// TON for the TON chain
26+
TON ChainType = "ton"
27+
// Sui for the Sui chain
28+
Sui ChainType = "sui"
29+
// Offchain is used by the MultichainKeyringAdapter when we are signing for offchain (eg. for DKG).
30+
Offchain ChainType = "offchain"
31+
)
32+
33+
type ChainTypes []ChainType
34+
35+
func (c ChainTypes) String() (out string) {
36+
var sb strings.Builder
37+
for i, chain := range c {
38+
if i != 0 {
39+
sb.WriteString(", ")
40+
}
41+
sb.WriteString(string(chain))
42+
}
43+
return sb.String()
44+
}
45+
46+
func NewChainType(typ uint8) (ChainType, error) {
47+
switch typ {
48+
case 1:
49+
return EVM, nil
50+
case 2:
51+
return Solana, nil
52+
case 3:
53+
return Cosmos, nil
54+
case 4:
55+
return StarkNet, nil
56+
case 5:
57+
return Aptos, nil
58+
case 6:
59+
return Tron, nil
60+
case 7:
61+
return TON, nil
62+
case 8:
63+
return Sui, nil
64+
case 9:
65+
return Offchain, nil
66+
default:
67+
return "", fmt.Errorf("unexpected chaintype.ChainType: %#v", typ)
68+
}
69+
}
70+
71+
func (c ChainType) Type() (uint8, error) {
72+
switch c {
73+
case EVM:
74+
return 1, nil
75+
case Solana:
76+
return 2, nil
77+
case Cosmos:
78+
return 3, nil
79+
case StarkNet:
80+
return 4, nil
81+
case Aptos:
82+
return 5, nil
83+
case Tron:
84+
return 6, nil
85+
case TON:
86+
return 7, nil
87+
case Sui:
88+
return 8, nil
89+
case Offchain:
90+
return 9, nil
91+
default:
92+
return 0, fmt.Errorf("unexpected chaintype.ChainType: %#v", c)
93+
}
94+
}
95+
96+
// SupportedChainTypes contain all chains that are supported
97+
var SupportedChainTypes = ChainTypes{EVM, Cosmos, Solana, StarkNet, Aptos, Tron, TON, Sui}
98+
99+
// ErrInvalidChainType is an error to indicate an unsupported chain type
100+
var ErrInvalidChainType error
101+
102+
func init() {
103+
supported := make([]string, 0, len(SupportedChainTypes))
104+
for _, chainType := range SupportedChainTypes {
105+
supported = append(supported, fmt.Sprintf(`"%s"`, chainType))
106+
}
107+
ErrInvalidChainType = fmt.Errorf("valid types include: [%s]", strings.Join(supported, ", "))
108+
}
109+
110+
// IsSupportedChainType checks to see if the chain is supported
111+
func IsSupportedChainType(chainType ChainType) bool {
112+
return slices.Contains(SupportedChainTypes, chainType)
113+
}
114+
115+
// NewErrInvalidChainType returns an error wrapping ErrInvalidChainType for an unsupported chain
116+
func NewErrInvalidChainType(chainType ChainType) error {
117+
return fmt.Errorf(`%w: unknown chain type "%s"`, ErrInvalidChainType, chainType)
118+
}

keystore/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ require (
4141
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4242
github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.1 // indirect
4343
github.com/cloudevents/sdk-go/v2 v2.16.1 // indirect
44-
github.com/consensys/gnark-crypto v0.18.0 // indirect
44+
github.com/consensys/gnark-crypto v0.18.1 // indirect
4545
github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect
4646
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
4747
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect

keystore/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ github.com/cloudevents/sdk-go/v2 v2.16.1 h1:G91iUdqvl88BZ1GYYr9vScTj5zzXSyEuqbfE
6262
github.com/cloudevents/sdk-go/v2 v2.16.1/go.mod h1:v/kVOaWjNfbvc6tkhhlkhvLapj8Aa8kvXiH5GiOHCKI=
6363
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
6464
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
65-
github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0=
66-
github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c=
65+
github.com/consensys/gnark-crypto v0.18.1 h1:RyLV6UhPRoYYzaFnPQA4qK3DyuDgkTgskDdoGqFt3fI=
66+
github.com/consensys/gnark-crypto v0.18.1/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c=
6767
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
6868
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
6969
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=

pkg/capabilities/errors/error_serialization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func DeserializeErrorFromString(errorMsg string) Error {
1515
parts := strings.SplitN(errorMsg, errorMessageSeparator, 4)
1616

1717
if len(parts) < 4 {
18-
// To maintain backwards compatability with messages from remote nodes on an older code version, create an error
18+
// To maintain backwards compatibility with messages from remote nodes on an older code version, create an error
1919
// with the full message and default to private system error with an unknown error code.
2020
return NewError(errors.New(errorMsg), VisibilityPrivate, OriginSystem, Unknown)
2121
}

0 commit comments

Comments
 (0)