Skip to content

Commit

Permalink
[CAPPL-60] Use new EncoderFactory interface in ocr3 capability (#14492)
Browse files Browse the repository at this point in the history
* [CAPPL-60] Use new EncoderFactory interface in ocr3 capability

* Common bump

* Add RMNRemote in the chain reader definition (#14588)

* Update contract_reader.go and go.mod

- Add rmn_remote package to contract_reader.go
- Update chainlink-ccip version in go.mod

* changeset

* Use main branch commit

* introducing logs

* use most recent commit

* solana: add compute unit limit functionality (#14576)

* solana: add compute unit limit functionality

* fix test: solana node CLI

* fix: e2e test artifact upload to container

* retry build with fresh commit

* changeset

* bump solana to merged commit

* Common bump

* go.mod bump

---------

Co-authored-by: Cedric Cordenier <[email protected]>
Co-authored-by: nogo <[email protected]>
Co-authored-by: Aaron Lu <[email protected]>
Co-authored-by: Silas Lenihan <[email protected]>
  • Loading branch information
5 people authored Sep 27, 2024
1 parent 86a9363 commit 7bbf4b2
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 16 deletions.
21 changes: 21 additions & 0 deletions core/capabilities/encoder_factory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package capabilities

import (
"fmt"

"github.com/smartcontractkit/chainlink-common/pkg/capabilities/consensus/ocr3/types"
"github.com/smartcontractkit/chainlink-common/pkg/logger"
"github.com/smartcontractkit/chainlink-common/pkg/values"
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm"
)

func NewEncoder(name string, config *values.Map, lggr logger.Logger) (types.Encoder, error) {
switch name {
case "EVM":
return evm.NewEVMEncoder(config)
// TODO: add a "no-op" encoder for users who only want to use dynamic ones?
// https://smartcontract-it.atlassian.net/browse/CAPPL-88
default:
return nil, fmt.Errorf("encoder %s not supported", name)
}
}
3 changes: 1 addition & 2 deletions core/capabilities/integration_tests/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key"
p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types"
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm"
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/v3/reportcodec"
"github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight"
)
Expand Down Expand Up @@ -153,7 +152,7 @@ func createDons(ctx context.Context, t *testing.T, lggr logger.Logger, reportsSi
requestTimeout := 10 * time.Minute
cfg := ocr3.Config{
Logger: lggr,
EncoderFactory: evm.NewEVMEncoder,
EncoderFactory: capabilities.NewEncoder,
AggregatorFactory: capabilities.NewAggregator,
RequestTimeout: &requestTimeout,
}
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/prometheus/client_golang v1.20.0
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-automation v1.0.4
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57
github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000
github.com/smartcontractkit/libocr v0.0.0-20240717100443-f6226e09bee7
github.com/spf13/cobra v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1083,8 +1083,8 @@ github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8um
github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5 h1:958op4dZQK46g4zk9gQTj0GLa2G+jbuj4oHAnneJ4PI=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5/go.mod h1:Q51RNKBrkqSJ0U2bwGQx4RL2X7c1qUL3NXVZF2kmCUA=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715 h1:6s5a5g62qvUiHSyknLLw9h8Y0FfdVEsNHc5o/Q/T9w4=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 h1:pRiTiFOkPEyvgG0hchcCSZzwUbwYydnZBu0QbVaRnVk=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ require (
github.com/smartcontractkit/chain-selectors v1.0.23
github.com/smartcontractkit/chainlink-automation v1.0.4
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926153211-84ed150bf0bc
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240910155501-42f20443189f
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,8 @@ github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8um
github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5 h1:958op4dZQK46g4zk9gQTj0GLa2G+jbuj4oHAnneJ4PI=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5/go.mod h1:Q51RNKBrkqSJ0U2bwGQx4RL2X7c1qUL3NXVZF2kmCUA=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715 h1:6s5a5g62qvUiHSyknLLw9h8Y0FfdVEsNHc5o/Q/T9w4=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926153211-84ed150bf0bc h1:MkdQaT7yADpOAdmIuFSHq6rUKOchqLc0bY+Qt3nrjG4=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240926153211-84ed150bf0bc/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q=
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require (
github.com/smartcontractkit/chain-selectors v1.0.23
github.com/smartcontractkit/chainlink-automation v1.0.4
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57
github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.0
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9
github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,8 @@ github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8um
github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5 h1:958op4dZQK46g4zk9gQTj0GLa2G+jbuj4oHAnneJ4PI=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5/go.mod h1:Q51RNKBrkqSJ0U2bwGQx4RL2X7c1qUL3NXVZF2kmCUA=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715 h1:6s5a5g62qvUiHSyknLLw9h8Y0FfdVEsNHc5o/Q/T9w4=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 h1:pRiTiFOkPEyvgG0hchcCSZzwUbwYydnZBu0QbVaRnVk=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q=
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 @@ -15,7 +15,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.33.0
github.com/slack-go/slack v0.12.2
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57
github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.9
github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.1
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.0
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 @@ -1399,8 +1399,8 @@ github.com/smartcontractkit/chainlink-automation v1.0.4 h1:iyW181JjKHLNMnDleI8um
github.com/smartcontractkit/chainlink-automation v1.0.4/go.mod h1:u4NbPZKJ5XiayfKHD/v3z3iflQWqvtdhj13jVZXj/cM=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5 h1:958op4dZQK46g4zk9gQTj0GLa2G+jbuj4oHAnneJ4PI=
github.com/smartcontractkit/chainlink-ccip v0.0.0-20240927145425-578a50b4d7c5/go.mod h1:Q51RNKBrkqSJ0U2bwGQx4RL2X7c1qUL3NXVZF2kmCUA=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715 h1:6s5a5g62qvUiHSyknLLw9h8Y0FfdVEsNHc5o/Q/T9w4=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240925150249-664dd5a59715/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57 h1:pRiTiFOkPEyvgG0hchcCSZzwUbwYydnZBu0QbVaRnVk=
github.com/smartcontractkit/chainlink-common v0.2.3-0.20240927162447-20630b333f57/go.mod h1:F6WUS6N4mP5ScwpwyTyAJc9/vjR+GXbMCRUOVekQi1g=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7 h1:lTGIOQYLk1Ufn++X/AvZnt6VOcuhste5yp+C157No/Q=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240911175228-daf2600bb7b7/go.mod h1:BMYE1vC/pGmdFSsOJdPrAA0/4gZ0Xo0SxTMdGspBtRo=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240916152957-433914114bd2 h1:yRk4ektpx/UxwarqAfgxUXLrsYXlaNeP1NOwzHGrK2Q=
Expand Down
3 changes: 1 addition & 2 deletions plugins/cmd/chainlink-ocr3-capability/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
ocr3rp "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins/ocr3"
"github.com/smartcontractkit/chainlink-common/pkg/types"
"github.com/smartcontractkit/chainlink/v2/core/capabilities"
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm"
)

const (
Expand All @@ -24,7 +23,7 @@ func main() {

c := ocr3.Config{
Logger: s.Logger,
EncoderFactory: evm.NewEVMEncoder,
EncoderFactory: capabilities.NewEncoder,
AggregatorFactory: capabilities.NewAggregator,
}
p := ocr3.NewOCR3(c)
Expand Down

0 comments on commit 7bbf4b2

Please sign in to comment.