-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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-5315 ocr params defaults #16573
Merged
+413
−219
Merged
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
933413d
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 5ed5e5b
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 3e36954
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 5ef3f9d
changes
AnieeG 784dc6f
updates
AnieeG e45838c
fix lint
AnieeG a66ff67
fix pointer error
AnieeG 06b8a60
go import
AnieeG 9af0bc7
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 6538876
fix integration-in-memory pipeline
AnieeG 0907eef
another fix
AnieeG e45f218
revert
AnieeG e06a9c4
use test configs
AnieeG d2ead18
fox crib
AnieeG 7019de8
add required config
AnieeG 7c66510
all required config
AnieeG a6416e8
another try
AnieeG aa4c91b
more fixes
AnieeG 5a8a5c9
fixes
AnieeG 5ad49b4
CCIP-5315 Removing globally shared OCR params and relying on structs …
mateusz-sekara 6532652
Replacing with Mergo
mateusz-sekara 92cafea
Replacing with Mergo
mateusz-sekara bbfe4d4
Merge branch 'CCIP-5315-ocr-params' of github.com:smartcontractkit/ch…
AnieeG 4ed2d37
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 8429d89
go.mod
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
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 |
---|---|---|
|
@@ -74,7 +74,7 @@ jobs: | |
contents: read | ||
needs: changes | ||
if: github.event_name == 'pull_request' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') | ||
uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@bb2d725fba3a42858bcb91e816987ca7cd063488 | ||
uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@18ee2276811ff4ad56a2284590c9917bec33b748 | ||
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. it was using an obsolete commit which is why the workflow was not running at all for past few weeks |
||
with: | ||
workflow_name: Run CCIP Integration Tests For PR | ||
test_path: .github/integration-in-memory-tests.yml | ||
|
@@ -98,7 +98,7 @@ jobs: | |
contents: read | ||
needs: changes | ||
if: github.event_name == 'merge_group' && ( needs.changes.outputs.ccip_changes == 'true' || needs.changes.outputs.core_changes == 'true' || needs.changes.outputs.github_ci_changes == 'true') | ||
uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@d7f8e299e891eafa428a37b5e856d929232c6e18 | ||
uses: smartcontractkit/.github/.github/workflows/run-integration-tests.yml@18ee2276811ff4ad56a2284590c9917bec33b748 | ||
with: | ||
workflow_name: Run CCIP Integration Tests For Merge Queue | ||
test_path: .github/integration-in-memory-tests.yml | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package globals | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"dario.cat/mergo" | ||
|
||
"github.com/smartcontractkit/chainlink/deployment/common/types" | ||
) | ||
|
||
// Intention of this file is to be a single source of the truth for OCR3 parameters used by CCIP plugins. | ||
// | ||
// Assumptions: | ||
// - Although, some values are similar between Commit and Execute, we should keep them separate, because | ||
// these plugins have different requirements and characteristics. This way we can avoid misconfiguration | ||
// by accidentally changing parameter for one plugin while adjusting it for the other | ||
// - OCR3 parameters are chain agnostic and should be reused across different chains. There might be some use cases | ||
// for overrides to accommodate specific chain characteristics (e.g. Ethereum). | ||
// However, for most of the cases we should strive to rely on defaults under CommitOCRParams and ExecOCRParams. | ||
// This makes the testing process much easier and increase our confidence that the configuration is safe to use. | ||
// - The fewer overrides the better. Introducing new overrides should be done with caution and only if there's a strong | ||
// justification for it. Moreover, it requires detailed chaos / load testing to ensure that the new parameters are safe to use | ||
// and meet CCIP SLOs | ||
// - Single params must not be stored under const or exposed outside of this file to limit the risk of | ||
// accidental configuration or partial configuration | ||
// - MaxDurations should be set on the latencies observed on various environments using p99 OCR3 latencies | ||
// These values should be specific to the plugin type and should not depend on the chain family | ||
// or the environment in which plugin runs | ||
var ( | ||
// CommitOCRParams represents the default OCR3 parameters for all chains (beside Ethereum, see CommitOCRParamsForEthereum). | ||
// Most of the intervals here should be generic enough (and chain agnostic) to be reused across different chains. | ||
CommitOCRParams = types.OCRParameters{ | ||
DeltaProgress: 120 * time.Second, | ||
DeltaResend: 30 * time.Second, | ||
DeltaInitial: 20 * time.Second, | ||
DeltaRound: 15 * time.Second, | ||
DeltaGrace: 5 * time.Second, | ||
DeltaCertifiedCommitRequest: 10 * time.Second, | ||
// TransmissionDelayMultiplier overrides DeltaStage | ||
DeltaStage: 25 * time.Second, | ||
Rmax: 3, | ||
MaxDurationQuery: 7 * time.Second, | ||
MaxDurationObservation: 13 * time.Second, | ||
MaxDurationShouldAcceptAttestedReport: 5 * time.Second, | ||
MaxDurationShouldTransmitAcceptedReport: 10 * time.Second, | ||
} | ||
|
||
// CommitOCRParamsForEthereum represents a dedicated set of OCR3 parameters for Ethereum. | ||
// It's driven by the fact that Ethereum block time is slow (12 seconds) and chain is considered | ||
// more expensive to other EVM compatible chains | ||
CommitOCRParamsForEthereum = withOverrides( | ||
CommitOCRParams, | ||
types.OCRParameters{ | ||
DeltaRound: 90 * time.Second, | ||
DeltaStage: 60 * time.Second, | ||
}, | ||
) | ||
) | ||
|
||
var ( | ||
// ExecOCRParams represents the default OCR3 parameters for all chains (beside Ethereum, see ExecOCRParamsForEthereum). | ||
ExecOCRParams = types.OCRParameters{ | ||
DeltaProgress: 100 * time.Second, | ||
DeltaResend: 30 * time.Second, | ||
DeltaInitial: 20 * time.Second, | ||
DeltaRound: 15 * time.Second, | ||
DeltaGrace: 5 * time.Second, | ||
DeltaCertifiedCommitRequest: 10 * time.Second, | ||
// TransmissionDelayMultiplier overrides DeltaStage | ||
DeltaStage: 25 * time.Second, | ||
Rmax: 3, | ||
// MaxDurationQuery is set to very low value, because Execution plugin doesn't use Query | ||
MaxDurationQuery: 200 * time.Millisecond, | ||
MaxDurationObservation: 13 * time.Second, | ||
MaxDurationShouldAcceptAttestedReport: 5 * time.Second, | ||
MaxDurationShouldTransmitAcceptedReport: 10 * time.Second, | ||
} | ||
|
||
// ExecOCRParamsForEthereum represents a dedicated set of OCR3 parameters for Ethereum. | ||
// Similarly to Commit, it's here to accommodate Ethereum specific characteristics | ||
ExecOCRParamsForEthereum = withOverrides( | ||
ExecOCRParams, | ||
types.OCRParameters{ | ||
DeltaRound: 90 * time.Second, | ||
DeltaStage: 60 * time.Second, | ||
}, | ||
) | ||
) | ||
|
||
func withOverrides(base types.OCRParameters, overrides types.OCRParameters) types.OCRParameters { | ||
outcome := base | ||
if err := mergo.Merge(&outcome, overrides, mergo.WithOverride); err != nil { | ||
panic(fmt.Sprintf("error while building an OCR config %v", err)) | ||
} | ||
return outcome | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package globals | ||
|
||
import ( | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
"time" | ||
) | ||
|
||
func Test_MergeWithOverrides(t *testing.T) { | ||
assert.Equal(t, ExecOCRParams.DeltaProgress, ExecOCRParamsForEthereum.DeltaProgress) | ||
assert.Equal(t, ExecOCRParams.DeltaResend, ExecOCRParamsForEthereum.DeltaResend) | ||
assert.Equal(t, ExecOCRParams.DeltaInitial, ExecOCRParamsForEthereum.DeltaInitial) | ||
assert.Equal(t, ExecOCRParams.DeltaGrace, ExecOCRParamsForEthereum.DeltaGrace) | ||
assert.Equal(t, ExecOCRParams.DeltaCertifiedCommitRequest, ExecOCRParamsForEthereum.DeltaCertifiedCommitRequest) | ||
assert.Equal(t, ExecOCRParams.MaxDurationQuery, ExecOCRParamsForEthereum.MaxDurationQuery) | ||
assert.Equal(t, ExecOCRParams.MaxDurationObservation, ExecOCRParamsForEthereum.MaxDurationObservation) | ||
assert.Equal(t, ExecOCRParams.MaxDurationShouldAcceptAttestedReport, ExecOCRParamsForEthereum.MaxDurationShouldAcceptAttestedReport) | ||
assert.Equal(t, ExecOCRParams.MaxDurationShouldTransmitAcceptedReport, ExecOCRParamsForEthereum.MaxDurationShouldTransmitAcceptedReport) | ||
assert.Equal(t, ExecOCRParams.MaxDurationQuery, ExecOCRParamsForEthereum.MaxDurationQuery) | ||
|
||
assert.Equal(t, 90*time.Second, ExecOCRParamsForEthereum.DeltaRound) | ||
assert.Equal(t, 60*time.Second, ExecOCRParamsForEthereum.DeltaStage) | ||
assert.Equal(t, 200*time.Millisecond, ExecOCRParams.MaxDurationQuery) | ||
assert.Equal(t, 200*time.Millisecond, ExecOCRParamsForEthereum.MaxDurationQuery) | ||
} |
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.
no feeboosting anymore.