-
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-4573 Changesets ccip 1.5 #15588
Merged
+1,815
−159
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
ded3f4c
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG b41bebe
just start
AnieeG 91bbfe5
placeholders
AnieeG 9a29a00
state
AnieeG a4bebba
change
AnieeG 86d3947
updates
AnieeG 4a143bf
updates
AnieeG 7aaa0ef
all updates
AnieeG c4ab875
change
AnieeG 774c933
include views
AnieeG aabba80
comments
AnieeG 24dd0c9
progress so far
AnieeG 74063c9
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 9b85a7b
add test
AnieeG cb923b0
more updates
AnieeG 6bb2a6d
updates
AnieeG 8d2ea2a
changes
AnieeG 669fba6
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 5861532
updates
AnieeG 572fe53
formatting
AnieeG 37ac6e9
fix crib
AnieeG edd1ef1
fix more tests
AnieeG ea81972
lint fix
AnieeG 599bb5c
comments
AnieeG 4669024
fix format
AnieeG c119985
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG b76b6fc
multichain
AnieeG 88301f3
fix lint
AnieeG 4032b96
merge with develop
AnieeG 347a775
fix lint
AnieeG 207a6bc
change func name
AnieeG d64279b
review comments
AnieeG 08d138c
lint fix
AnieeG 514aefc
removed legacyjobclient
AnieeG cd17fe1
review comments
AnieeG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,13 @@ package integrationtesthelpers | |
|
||
import ( | ||
"bytes" | ||
"crypto/sha256" | ||
"fmt" | ||
"text/template" | ||
"time" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/google/uuid" | ||
"github.com/lib/pq" | ||
|
||
"github.com/smartcontractkit/chainlink-common/pkg/types" | ||
|
@@ -28,6 +30,7 @@ type OCR2TaskJobSpec struct { | |
ForwardingAllowed bool `toml:"forwardingAllowed"` | ||
OCR2OracleSpec job.OCR2OracleSpec | ||
ObservationSource string `toml:"observationSource"` // List of commands for the Chainlink node | ||
ExternalJobID string `toml:"externalJobID"` | ||
} | ||
|
||
// Type returns the type of the job | ||
|
@@ -39,9 +42,14 @@ func (o *OCR2TaskJobSpec) String() (string, error) { | |
if o.OCR2OracleSpec.FeedID != nil { | ||
feedID = o.OCR2OracleSpec.FeedID.Hex() | ||
} | ||
externalID, err := ExternalJobID(o.Name) | ||
if err != nil { | ||
return "", err | ||
} | ||
specWrap := struct { | ||
Name string | ||
JobType string | ||
ExternalJobID string | ||
MaxTaskDuration string | ||
ForwardingAllowed bool | ||
ContractID string | ||
|
@@ -62,6 +70,7 @@ func (o *OCR2TaskJobSpec) String() (string, error) { | |
}{ | ||
Name: o.Name, | ||
JobType: o.JobType, | ||
ExternalJobID: externalID, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is required for JD to propose the job, without ExternalJobID it's throwing error |
||
ForwardingAllowed: o.ForwardingAllowed, | ||
MaxTaskDuration: o.MaxTaskDuration, | ||
ContractID: o.OCR2OracleSpec.ContractID, | ||
|
@@ -82,6 +91,7 @@ func (o *OCR2TaskJobSpec) String() (string, error) { | |
ocr2TemplateString := ` | ||
type = "{{ .JobType }}" | ||
name = "{{.Name}}" | ||
externalJobID = "{{.ExternalJobID}}" | ||
forwardingAllowed = {{.ForwardingAllowed}} | ||
{{if .MaxTaskDuration}} | ||
maxTaskDuration = "{{ .MaxTaskDuration }}" {{end}} | ||
|
@@ -332,3 +342,18 @@ func (c *CCIPIntegrationTestHarness) NewCCIPJobSpecParams(tokenPricesUSDPipeline | |
USDCAttestationAPI: usdcAttestationAPI, | ||
} | ||
} | ||
|
||
func ExternalJobID(jobName string) (string, error) { | ||
in := []byte(jobName) | ||
sha256Hash := sha256.New() | ||
sha256Hash.Write(in) | ||
in = sha256Hash.Sum(nil)[:16] | ||
// tag as valid UUID v4 https://github.com/google/uuid/blob/0f11ee6918f41a04c201eceeadf612a377bc7fbc/version4.go#L53-L54 | ||
in[6] = (in[6] & 0x0f) | 0x40 // Version 4 | ||
in[8] = (in[8] & 0x3f) | 0x80 // Variant is 10 | ||
id, err := uuid.FromBytes(in) | ||
if err != nil { | ||
return "", err | ||
} | ||
return id.String(), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is this exclusively for tests / JD? So no need to port it to the fork and it won't break the fork if it does get ported?
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.
it won't break it. Exclusively for JD. without externaljobId it's throwing error that it's missing, which does not happen through node api job creation