From 69d7572b0b0d36979dd26501c93605e84be9d6d1 Mon Sep 17 00:00:00 2001 From: Makram Kamaleddine Date: Mon, 24 Feb 2025 19:21:24 +0200 Subject: [PATCH] pluginconfig: remove boosting related configs --- docs/billing.md | 7 ------- docs/configuration.md | 5 ----- pluginconfig/commit.go | 1 - pluginconfig/execute.go | 16 ---------------- pluginconfig/execute_test.go | 36 +----------------------------------- pluginconfig/token_test.go | 2 -- 6 files changed, 1 insertion(+), 66 deletions(-) diff --git a/docs/billing.md b/docs/billing.md index b01bfb1c3..52eaed19a 100644 --- a/docs/billing.md +++ b/docs/billing.md @@ -22,8 +22,6 @@ We have 2 plugins (Commit and Execute). Commit is the one responsible for reporting gas prices, and token prices that don't come from keystone. -Execute is responsible for [fee boosting](https://github.com/smartcontractkit/chainlink-ccip/blob/28a1b54783a0023e82f92833aa8379164e799bf2/docs/billing.md#fee-boosting) during the actual execution of messages. - ## Fee Structure To send a message from sourceChain to destinationChain we need to account for multiple fees. For more details [billing documentation](https://docs.chain.link/ccip/billing) @@ -78,9 +76,4 @@ For each round, these are the steps: One more thing that is done is to calculate the gas price in USD using the native token price from 1b. This is done to be able to calculate the fees in USD. For details on the calculation and the representation onchain please check the [code](https://github.com/smartcontractkit/chainlink-ccip/blob/5c54ab8396e3409cefef84dfa29d27920fc0ca46/commit/chainfee/outcome.go#L35-L81) with the comments. -## Fee Boosting - -Assigning inflight messages that were previously skipped due to being underpaid an increasing weight for execution as time passes - ## Aggregate Rate Limiting - diff --git a/docs/configuration.md b/docs/configuration.md index c634f7978..a1e3383e8 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -116,11 +116,6 @@ type ExecuteOffchainConfig struct { // EVM only. BatchGasLimit uint64 `json:"batchGasLimit"` - // RelativeBoostPerWaitHour indicates how much to increase (artificially) the fee paid on the source chain per hour - // of wait time, such that eventually the fee paid is greater than the execution cost, and we’ll execute it. - // For example: if set to 0.5, that means the fee paid is increased by 50% every hour the message has been waiting. - RelativeBoostPerWaitHour float64 `json:"relativeBoostPerWaitHour"` - // InflightCacheExpiry indicates how long we keep a report in the plugin cache before we expire it. // The caching prevents us from issuing another report while one is already in flight. InflightCacheExpiry commonconfig.Duration `json:"inflightCacheExpiry"` diff --git a/pluginconfig/commit.go b/pluginconfig/commit.go index 67abe7294..c85a15334 100644 --- a/pluginconfig/commit.go +++ b/pluginconfig/commit.go @@ -27,7 +27,6 @@ const ( defaultSignObservationPrefix = "chainlink ccip 1.6 rmn observation" defaultTransmissionDelayMultiplier = 30 * time.Second defaultInflightPriceCheckRetries = 5 - defaultRelativeBoostPerWaitHour = 0.2 // 20 percent defaultAsyncObserverSyncFreq = 5 * time.Second defaultAsyncObserverSyncTimeout = 10 * time.Second ) diff --git a/pluginconfig/execute.go b/pluginconfig/execute.go index 28719bab0..00035e9c4 100644 --- a/pluginconfig/execute.go +++ b/pluginconfig/execute.go @@ -3,7 +3,6 @@ package pluginconfig import ( "encoding/json" "errors" - "fmt" "time" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" @@ -18,11 +17,6 @@ type ExecuteOffchainConfig struct { // EVM only. BatchGasLimit uint64 `json:"batchGasLimit"` - // RelativeBoostPerWaitHour indicates how much to increase (artificially) the fee paid on the source chain per hour - // of wait time, such that eventually the fee paid is greater than the execution cost, and we’ll execute it. - // For example: if set to 0.5, that means the fee paid is increased by 50% every hour the message has been waiting. - RelativeBoostPerWaitHour float64 `json:"relativeBoostPerWaitHour"` - // InflightCacheExpiry indicates how long we keep a report in the plugin cache before we expire it. // The caching prevents us from issuing another report while one is already in flight. InflightCacheExpiry commonconfig.Duration `json:"inflightCacheExpiry"` @@ -61,9 +55,6 @@ func (e *ExecuteOffchainConfig) applyDefaults() { if e.TransmissionDelayMultiplier == 0 { e.TransmissionDelayMultiplier = defaultTransmissionDelayMultiplier } - if e.RelativeBoostPerWaitHour == 0 { - e.RelativeBoostPerWaitHour = defaultRelativeBoostPerWaitHour - } } func (e *ExecuteOffchainConfig) Validate() error { @@ -74,10 +65,6 @@ func (e *ExecuteOffchainConfig) Validate() error { return errors.New("BatchGasLimit not set") } - if e.RelativeBoostPerWaitHour == 0 { - return errors.New("RelativeBoostPerWaitHour not set") - } - if e.InflightCacheExpiry.Duration() == 0 { return errors.New("InflightCacheExpiry not set") } @@ -90,9 +77,6 @@ func (e *ExecuteOffchainConfig) Validate() error { return errors.New("MessageVisibilityInterval not set") } - if e.RelativeBoostPerWaitHour > 1 || e.RelativeBoostPerWaitHour < 0 { - return fmt.Errorf("RelativeBoostPerWaitHour must be <= 1 and >= 0, got: %f", e.RelativeBoostPerWaitHour) - } set := make(map[string]struct{}) for _, ob := range e.TokenDataObservers { if err := ob.Validate(); err != nil { diff --git a/pluginconfig/execute_test.go b/pluginconfig/execute_test.go index 443a9ea13..0f5af9a17 100644 --- a/pluginconfig/execute_test.go +++ b/pluginconfig/execute_test.go @@ -11,7 +11,6 @@ import ( func TestExecuteOffchainConfig_Validate(t *testing.T) { type fields struct { BatchGasLimit uint64 - RelativeBoostPerWaitHour float64 InflightCacheExpiry commonconfig.Duration RootSnoozeTime commonconfig.Duration MessageVisibilityInterval commonconfig.Duration @@ -26,7 +25,6 @@ func TestExecuteOffchainConfig_Validate(t *testing.T) { "valid", fields{ BatchGasLimit: 1, - RelativeBoostPerWaitHour: 1, InflightCacheExpiry: *commonconfig.MustNewDuration(1), RootSnoozeTime: *commonconfig.MustNewDuration(1), MessageVisibilityInterval: *commonconfig.MustNewDuration(1), @@ -38,19 +36,6 @@ func TestExecuteOffchainConfig_Validate(t *testing.T) { "invalid, BatchGasLimit not set", fields{ BatchGasLimit: 0, - RelativeBoostPerWaitHour: 1, - InflightCacheExpiry: *commonconfig.MustNewDuration(1), - RootSnoozeTime: *commonconfig.MustNewDuration(1), - MessageVisibilityInterval: *commonconfig.MustNewDuration(1), - BatchingStrategyID: 0, - }, - true, - }, - { - "invalid, RelativeBoostPerWaitHour not set", - fields{ - BatchGasLimit: 1, - RelativeBoostPerWaitHour: 0, InflightCacheExpiry: *commonconfig.MustNewDuration(1), RootSnoozeTime: *commonconfig.MustNewDuration(1), MessageVisibilityInterval: *commonconfig.MustNewDuration(1), @@ -62,7 +47,6 @@ func TestExecuteOffchainConfig_Validate(t *testing.T) { "invalid, InflightCacheExpiry not set", fields{ BatchGasLimit: 1, - RelativeBoostPerWaitHour: 1, InflightCacheExpiry: *commonconfig.MustNewDuration(0), RootSnoozeTime: *commonconfig.MustNewDuration(1), MessageVisibilityInterval: *commonconfig.MustNewDuration(1), @@ -74,7 +58,6 @@ func TestExecuteOffchainConfig_Validate(t *testing.T) { "invalid, RootSnoozeTime not set", fields{ BatchGasLimit: 1, - RelativeBoostPerWaitHour: 1, InflightCacheExpiry: *commonconfig.MustNewDuration(1), RootSnoozeTime: *commonconfig.MustNewDuration(0), MessageVisibilityInterval: *commonconfig.MustNewDuration(1), @@ -86,7 +69,6 @@ func TestExecuteOffchainConfig_Validate(t *testing.T) { "invalid, MessageVisibilityInterval not set", fields{ BatchGasLimit: 1, - RelativeBoostPerWaitHour: 1, InflightCacheExpiry: *commonconfig.MustNewDuration(1), RootSnoozeTime: *commonconfig.MustNewDuration(1), MessageVisibilityInterval: *commonconfig.MustNewDuration(0), @@ -99,7 +81,6 @@ func TestExecuteOffchainConfig_Validate(t *testing.T) { t.Run(tt.name, func(t *testing.T) { e := ExecuteOffchainConfig{ BatchGasLimit: tt.fields.BatchGasLimit, - RelativeBoostPerWaitHour: tt.fields.RelativeBoostPerWaitHour, InflightCacheExpiry: tt.fields.InflightCacheExpiry, RootSnoozeTime: tt.fields.RootSnoozeTime, MessageVisibilityInterval: tt.fields.MessageVisibilityInterval, @@ -115,7 +96,6 @@ func TestExecuteOffchainConfig_Validate(t *testing.T) { func TestExecuteOffchainConfig_EncodeDecode(t *testing.T) { type fields struct { BatchGasLimit uint64 - RelativeBoostPerWaitHour float64 InflightCacheExpiry commonconfig.Duration RootSnoozeTime commonconfig.Duration MessageVisibilityInterval commonconfig.Duration @@ -130,18 +110,6 @@ func TestExecuteOffchainConfig_EncodeDecode(t *testing.T) { "valid", fields{ BatchGasLimit: 1, - RelativeBoostPerWaitHour: 1, - InflightCacheExpiry: *commonconfig.MustNewDuration(1), - RootSnoozeTime: *commonconfig.MustNewDuration(1), - MessageVisibilityInterval: *commonconfig.MustNewDuration(1), - BatchingStrategyID: 0, - }, - }, - { - "valid, boost with decimal places", - fields{ - BatchGasLimit: 1, - RelativeBoostPerWaitHour: 1.523, InflightCacheExpiry: *commonconfig.MustNewDuration(1), RootSnoozeTime: *commonconfig.MustNewDuration(1), MessageVisibilityInterval: *commonconfig.MustNewDuration(1), @@ -149,10 +117,9 @@ func TestExecuteOffchainConfig_EncodeDecode(t *testing.T) { }, }, { - "valid, large gas limit, zero boost", + "valid, large gas limit", fields{ BatchGasLimit: 1 << 63, - RelativeBoostPerWaitHour: 0.0, InflightCacheExpiry: *commonconfig.MustNewDuration(1), RootSnoozeTime: *commonconfig.MustNewDuration(1), MessageVisibilityInterval: *commonconfig.MustNewDuration(1), @@ -164,7 +131,6 @@ func TestExecuteOffchainConfig_EncodeDecode(t *testing.T) { t.Run(tt.name, func(t *testing.T) { e := ExecuteOffchainConfig{ BatchGasLimit: tt.fields.BatchGasLimit, - RelativeBoostPerWaitHour: tt.fields.RelativeBoostPerWaitHour, InflightCacheExpiry: tt.fields.InflightCacheExpiry, RootSnoozeTime: tt.fields.RootSnoozeTime, MessageVisibilityInterval: tt.fields.MessageVisibilityInterval, diff --git a/pluginconfig/token_test.go b/pluginconfig/token_test.go index 185fa7e7b..ca9d44fa3 100644 --- a/pluginconfig/token_test.go +++ b/pluginconfig/token_test.go @@ -16,7 +16,6 @@ func Test_TokenDataObserver_Unmarshall(t *testing.T) { baseJSON := `{ %s "batchGasLimit": 1, - "relativeBoostPerWaitHour": 1, "inflightCacheExpiry": "1s", "rootSnoozeTime": "1s", "messageVisibilityInterval": "1s", @@ -167,7 +166,6 @@ func Test_TokenDataObserver_Validation(t *testing.T) { withBaseConfig := func(configs ...TokenDataObserverConfig) ExecuteOffchainConfig { return ExecuteOffchainConfig{ BatchGasLimit: 1, - RelativeBoostPerWaitHour: 1, InflightCacheExpiry: *commonconfig.MustNewDuration(1), RootSnoozeTime: *commonconfig.MustNewDuration(1), MessageVisibilityInterval: *commonconfig.MustNewDuration(1),