Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

ccip loopp - migrate to relayer types#489

Merged
dimkouv merged 36 commits intoccip-developfrom
dk/ccip-loop-types
Feb 15, 2024
Merged

ccip loopp - migrate to relayer types#489
dimkouv merged 36 commits intoccip-developfrom
dk/ccip-loop-types

Conversation

@dimkouv
Copy link
Contributor

@dimkouv dimkouv commented Feb 8, 2024

Since we are migrating to the LOOPP architecture we want to start using primitive types in the core ccip logic.

  1. Uses the generic types that are defined under chainlink-common
  2. Misc refactoring (evm addresses to strings, etc..)
  3. Move the interfaces that are exposed to the plugin under chainlink-common. For example the Router interface is not moved since the plugin does not use it directly.

NOTE: Duplicated the types at "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/cciptypes" which should be replaced by "github.com/smartcontractkit/chainlink-common/pkg/types/cciptypes" after smartcontractkit/chainlink-common#330 is merged.

Copy link
Contributor

@roman-kashitsyn roman-kashitsyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, LGTM.
It would be very helpful to include more background in the PR description. For example, the following points aren’t obvious:

  1. Why do we replace structured addresses with raw strings.
  2. Why do we move some (but not all?) internal CCIP interfaces to the cciptypes package.
  3. Why we don’t use the GasPrice alias anymore.

// the fields below are initially empty and populated on demand
destPriceRegReader: nil,
destPriceRegAddr: common.Address{},
destPriceRegAddr: "",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we have an empty cciptypes.Address instead for consistency (even if the result is the same)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a type alias so it's either empty string or cciptypes.Address("") which is the more verbose version.
I believe it's ok with an empty string

}
return common.HexToAddress(string(a)), nil
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have a fromEVM(..) method then, allowing to build an Address from an EVMAddress instead of having string conversions everytime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@makramkd
Copy link
Contributor

Added some comments on the chainlink-common PR, I think changes there will affect this PR right?

@makramkd
Copy link
Contributor

makramkd commented Feb 14, 2024

@dimkouv would it be simpler to point to the chainlink-common branch that you have your changes on instead of duplicating the types here? Once that PR gets merged you can update here w/ the new main branch of chainlink-common.

@dimkouv dimkouv closed this Feb 15, 2024
asoliman92 pushed a commit that referenced this pull request Jul 31, 2024
Since we are migrating to the LOOPP architecture we want to start using
primitive types in the core ccip logic.

1. Uses the generic types that are defined under chainlink-common
2. Misc refactoring (evm addresses to strings, etc..)
3. Move the interfaces that are exposed to the plugin under
chainlink-common. For example the `Router interface` is not moved since
the plugin does not use it directly.

NOTE: Duplicated the types at
`"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/cciptypes"`
which should be replaced by
`"github.com/smartcontractkit/chainlink-common/pkg/types/cciptypes"`
after smartcontractkit/chainlink-common#330 is
merged.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants