-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CCIP Merge] Capabilities fix [CCIP-2943] #14048
[CCIP Merge] Capabilities fix [CCIP-2943] #14048
Conversation
afb93d7
to
b089224
Compare
7f010e1
to
7d44b17
Compare
b089224
to
23dea4c
Compare
capabilityLabelledName string, | ||
state registrysyncer.State, | ||
) (kcr.CapabilitiesRegistryCapabilityInfo, error) { | ||
capabilityID string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels less error prone to make this structured ID an actual structure rather than just a string
.
@cedric-cordenier wdyt? Maybe something like:
type CapabilityID struct {
Name string
Version string
}
func (cid CapabilityID) String() string {
// perhaps some semver regex validation using the semver package
return fmt.Sprintf("%s@%s", cid.Name, cid.Version)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I said a similar comment on call with @cedric-cordenier last week as well :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be a blocker for this PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm not against this 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asoliman92 can you create a ticket in the backlog for this if you're not going to do it in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Make application.go ready for adding more fixes
9cbff85
to
51e8ad9
Compare
213a58f
to
e35df28
Compare
We want to define and use the appropriate OCR offchain config for each plugin. Requires smartcontractkit/chainlink-ccip#36
core/capabilities/ccip/delegate.go
Outdated
@@ -99,6 +106,25 @@ func (d *Delegate) ServicesForSpec(ctx context.Context, spec job.Job) (services | |||
return nil, fmt.Errorf("failed to get all p2p keys: %w", err) | |||
} | |||
|
|||
cfg := d.capabilityConfig | |||
rid := cfg.ExternalRegistry().RelayID() | |||
registryAddress := cfg.ExternalRegistry().Address() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you can inline this
var defaultCapability = getCapability(ccipCapName, ccipCapVersion) | ||
var newCapability = getCapability(ccipCapName, ccipCapNewVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge these var decls into one var
decl
var p2pID1 = getP2PID(1) | ||
var p2pID2 = getP2PID(2) | ||
|
||
var defaultCapCfgs = map[string]registrysyncer.CapabilityConfiguration{ | ||
defaultCapability.ID: registrysyncer.CapabilityConfiguration{}, | ||
} | ||
var defaultRegistryDon = registrysyncer.DON{ | ||
DON: getDON(1, []ragep2ptypes.PeerID{p2pID1}, 0), | ||
CapabilityConfigurations: defaultCapCfgs, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge into one var decl at the top of the file for better organization
ccipreader "github.com/smartcontractkit/chainlink-ccip/pkg/reader" | ||
ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate import
@@ -46,6 +50,42 @@ type launcher struct { | |||
subServices []services.Service | |||
} | |||
|
|||
func unmarshalCapabilityConfig(data []byte) (capabilities.CapabilityConfiguration, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which capability config is this unmarshalling? Not CCIP right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not CCIP AFAIU. @cedric-cordenier right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is only unmarshaling the Keystone capability configs
@@ -17,6 +17,8 @@ import ( | |||
"go.uber.org/multierr" | |||
"go.uber.org/zap/zapcore" | |||
|
|||
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: group this with other chainlink/v2/ imports?
a58854b
to
c495985
Compare
Quality Gate passedIssues Measures |
ba0e8c5
into
ccip/capabilities-merge-clean
* [CCIP Merge] Add ccip capabilities directory [CCIP-2943] (#14044) * Add ccip capabilities directory * [CCIP Merge] Capabilities fix [CCIP-2943] (#14048) * Fix compilation for launcher, diff Make application.go ready for adding more fixes * Fix launcher tests * ks-409 fix the mock trigger to ensure events are sent (#14047) * Add ccip to job orm * Add capabilities directory under BUSL license * Prep to instantiate separate registrysyncer for CCIP * Move registrySyncer creation into ccip delegate * [chore] Change registrysyncer config to bytes * Fix launcher diff tests after changing structs in syncer * Fix linting * MAke simulated backend client work with chains other than 1337 * core/capabilities/ccip: use OCR offchain config (#1264) We want to define and use the appropriate OCR offchain config for each plugin. Requires smartcontractkit/chainlink-ccip#36 * Cleaning up * Add capabilities types to mockery --------- Co-authored-by: Cedric Cordenier <[email protected]> Co-authored-by: Matthew Pendrey <[email protected]> Co-authored-by: Makram <[email protected]> * make modgraph * Add changeset * Fix test with new TxMgr constructor --------- Co-authored-by: Cedric Cordenier <[email protected]> Co-authored-by: Matthew Pendrey <[email protected]> Co-authored-by: Makram <[email protected]>
Fixing ccip capabilities to be merged into chainlink