Skip to content

Commit

Permalink
revert chainlink-common change
Browse files Browse the repository at this point in the history
  • Loading branch information
makramkd committed Jun 24, 2024
1 parent 2cf2b46 commit 9f9615a
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 52 deletions.
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.17
github.com/smartcontractkit/chainlink-automation v1.0.3
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce
github.com/smartcontractkit/chainlink-vrf v0.0.0-20240222010609-cd67d123c772
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,8 @@ github.com/smartcontractkit/chain-selectors v1.0.17 h1:otOlYUnutS8oQBEAi9RLQICqZ
github.com/smartcontractkit/chain-selectors v1.0.17/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs=
github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb h1:R4OkRLPz6mZm8k7JFfLpQ9Ib/e1n1qcxg+hVxc0pKOk=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce h1:/CjY8L4lVJh9E8NKg3bdAgsxj+zKg9XYtXR71ZWWMXo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo=
Expand Down
59 changes: 20 additions & 39 deletions core/services/ccipcapability/oraclecreator/oraclecreator.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3types"
ocrtypes "github.com/smartcontractkit/libocr/offchainreporting2plus/types"

ccipocr3commit "github.com/smartcontractkit/ccipocr3/commit"
ccipocr3exec "github.com/smartcontractkit/ccipocr3/execute"
"github.com/smartcontractkit/chainlink-common/pkg/loop"
"github.com/smartcontractkit/chainlink-common/pkg/types"
cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"
Expand Down Expand Up @@ -84,7 +82,7 @@ func (o *oracleCreator) CreateCommitOracle(config cctypes.OCRConfig) (cctypes.CC
// this is so that we can use the msg hasher and report encoder from that dest chain relayer's provider.
providers := make(map[types.RelayID]types.CCIPOCR3CommitProvider)
contractReaders := make(map[cciptypes.ChainSelector]types.ContractReader)
contractWriters := make(map[cciptypes.ChainSelector]types.ChainWriter)
// contractWriters := make(map[cciptypes.ChainSelector]types.ChainWriter)
for relayID, relayer := range o.relayers {
provider, err := relayer.NewPluginProvider(context.Background(), types.RelayArgs{
ExternalJobID: o.externalJobID,
Expand Down Expand Up @@ -152,15 +150,15 @@ func (o *oracleCreator) CreateCommitOracle(config cctypes.OCRConfig) (cctypes.CC
}
onchainKeyring := ocrcommon.NewOCR3OnchainKeyringAdapter(keybundle)

reportCodec, err := destProvider.ReportCodec(context.Background())
if err != nil {
return nil, fmt.Errorf("failed to get report codec: %w", err)
}
// reportCodec, err := destProvider.ReportCodec(context.Background())
// if err != nil {
// return nil, fmt.Errorf("failed to get report codec: %w", err)
// }

msgHasher, err := destProvider.MsgHasher(context.Background())
if err != nil {
return nil, fmt.Errorf("failed to get message hasher: %w", err)
}
// msgHasher, err := destProvider.MsgHasher(context.Background())
// if err != nil {
// return nil, fmt.Errorf("failed to get message hasher: %w", err)
// }
oracleArgs := libocr3.OCR3OracleArgs[[]byte]{
BinaryNetworkEndpointFactory: o.peerWrapper.Peer2,
Database: o.db,
Expand Down Expand Up @@ -198,17 +196,7 @@ func (o *oracleCreator) CreateCommitOracle(config cctypes.OCRConfig) (cctypes.CC
OffchainConfigDigester: ocrimpls.NewConfigDigester(config.ConfigDigest()),
OffchainKeyring: keybundle,
OnchainKeyring: onchainKeyring,
ReportingPluginFactory: ccipocr3commit.NewPluginFactory(
contractReaders, // contract readers
contractWriters, // contract writers
cciptypes.ChainSelector(config.ChainSelector()), // dest chain selector
reportCodec, // dest chain report codec
msgHasher, // dest chain msg hasher
o.lggr.
Named("CCIPCommitPlugin").
Named(destRelayID.String()).
Named(hexutil.Encode(config.OfframpAddress())),
),
ReportingPluginFactory: nil, // TODO: set after fixing chainlink-common regression
}
oracle, err := libocr3.NewOracle(oracleArgs)
if err != nil {
Expand All @@ -223,7 +211,7 @@ func (o *oracleCreator) CreateExecOracle(config cctypes.OCRConfig) (cctypes.CCIP
// this is so that we can use the msg hasher and report encoder from that dest chain relayer's provider.
providers := make(map[types.RelayID]types.CCIPOCR3ExecuteProvider)
contractReaders := make(map[cciptypes.ChainSelector]types.ContractReader)
contractWriters := make(map[cciptypes.ChainSelector]types.ChainWriter)
// contractWriters := make(map[cciptypes.ChainSelector]types.ChainWriter)
for relayID, relayer := range o.relayers {
provider, err := relayer.NewPluginProvider(context.Background(), types.RelayArgs{
ExternalJobID: o.externalJobID,
Expand Down Expand Up @@ -291,15 +279,15 @@ func (o *oracleCreator) CreateExecOracle(config cctypes.OCRConfig) (cctypes.CCIP
}
onchainKeyring := ocrcommon.NewOCR3OnchainKeyringAdapter(keybundle)

reportCodec, err := destProvider.ReportCodec(context.Background())
if err != nil {
return nil, fmt.Errorf("failed to get report codec: %w", err)
}
// reportCodec, err := destProvider.ReportCodec(context.Background())
// if err != nil {
// return nil, fmt.Errorf("failed to get report codec: %w", err)
// }

msgHasher, err := destProvider.MsgHasher(context.Background())
if err != nil {
return nil, fmt.Errorf("failed to get message hasher: %w", err)
}
// msgHasher, err := destProvider.MsgHasher(context.Background())
// if err != nil {
// return nil, fmt.Errorf("failed to get message hasher: %w", err)
// }
oracleArgs := libocr3.OCR3OracleArgs[[]byte]{
BinaryNetworkEndpointFactory: o.peerWrapper.Peer2,
Database: o.db,
Expand Down Expand Up @@ -337,14 +325,7 @@ func (o *oracleCreator) CreateExecOracle(config cctypes.OCRConfig) (cctypes.CCIP
OffchainConfigDigester: ocrimpls.NewConfigDigester(config.ConfigDigest()),
OffchainKeyring: keybundle,
OnchainKeyring: onchainKeyring,
ReportingPluginFactory: ccipocr3exec.NewPluginFactory(
contractReaders,
contractWriters,
cciptypes.ChainSelector(config.ChainSelector()),
reportCodec,
msgHasher,
o.lggr.Named("CCIPExecPlugin").Named(destRelayID.String()).Named(hexutil.Encode(config.OfframpAddress())),
),
ReportingPluginFactory: nil, // TODO set after fixing chainlink-common regression
}
oracle, err := libocr3.NewOracle(oracleArgs)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.17
github.com/smartcontractkit/chainlink-automation v1.0.3
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917
Expand Down Expand Up @@ -290,7 +290,6 @@ require (
github.com/sethvargo/go-retry v0.2.4 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/ccipocr3 v0.0.0-00010101000000-000000000000 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1170,8 +1170,8 @@ github.com/smartcontractkit/chain-selectors v1.0.17 h1:otOlYUnutS8oQBEAi9RLQICqZ
github.com/smartcontractkit/chain-selectors v1.0.17/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs=
github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb h1:R4OkRLPz6mZm8k7JFfLpQ9Ib/e1n1qcxg+hVxc0pKOk=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce h1:/CjY8L4lVJh9E8NKg3bdAgsxj+zKg9XYtXR71ZWWMXo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/slack-go/slack v0.12.2
github.com/smartcontractkit/chain-selectors v1.0.17
github.com/smartcontractkit/chainlink-automation v1.0.3
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce
github.com/smartcontractkit/chainlink-testing-framework v1.31.0
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-00010101000000-000000000000
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1508,8 +1508,8 @@ github.com/smartcontractkit/chain-selectors v1.0.17 h1:otOlYUnutS8oQBEAi9RLQICqZ
github.com/smartcontractkit/chain-selectors v1.0.17/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs=
github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb h1:R4OkRLPz6mZm8k7JFfLpQ9Ib/e1n1qcxg+hVxc0pKOk=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce h1:/CjY8L4lVJh9E8NKg3bdAgsxj+zKg9XYtXR71ZWWMXo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/load/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/rs/zerolog v1.30.0
github.com/slack-go/slack v0.12.2
github.com/smartcontractkit/chainlink-automation v1.0.3
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce
github.com/smartcontractkit/chainlink-testing-framework v1.31.0
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240214231432-4ad5eb95178c
github.com/smartcontractkit/chainlink/v2 v2.9.0-beta0.0.20240216210048-da02459ddad8
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/load/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1498,8 +1498,8 @@ github.com/smartcontractkit/chain-selectors v1.0.17 h1:otOlYUnutS8oQBEAi9RLQICqZ
github.com/smartcontractkit/chain-selectors v1.0.17/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE=
github.com/smartcontractkit/chainlink-automation v1.0.3 h1:h/ijT0NiyV06VxYVgcNfsE3+8OEzT3Q0Z9au0z1BPWs=
github.com/smartcontractkit/chainlink-automation v1.0.3/go.mod h1:RjboV0Qd7YP+To+OrzHGXaxUxoSONveCoAK2TQ1INLU=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb h1:R4OkRLPz6mZm8k7JFfLpQ9Ib/e1n1qcxg+hVxc0pKOk=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240613201342-a855825f87bb/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce h1:/CjY8L4lVJh9E8NKg3bdAgsxj+zKg9XYtXR71ZWWMXo=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240607135320-c9bc0a2ac0ce/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d h1:5tgMC5Gi2UAOKZ+m28W8ubjLeR0pQCAcrz6eQ0rW510=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d/go.mod h1:0UNuO3nDt9MFsZPaHJBEUolxVkN0iC69j1ccDp95e8k=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 h1:xFSv8561jsLtF6gYZr/zW2z5qUUAkcFkApin2mnbYTo=
Expand Down

0 comments on commit 9f9615a

Please sign in to comment.