Skip to content
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

pluginconfig: remove boosting related configs #656

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions docs/billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

5 changes: 0 additions & 5 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
1 change: 0 additions & 1 deletion pluginconfig/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
16 changes: 0 additions & 16 deletions pluginconfig/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pluginconfig
import (
"encoding/json"
"errors"
"fmt"
"time"

commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config"
Expand All @@ -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"`
Expand Down Expand Up @@ -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 {
Expand All @@ -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")
}
Expand All @@ -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 {
Expand Down
36 changes: 1 addition & 35 deletions pluginconfig/execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -130,29 +110,16 @@ 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),
BatchingStrategyID: 0,
},
},
{
"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),
Expand All @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions pluginconfig/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func Test_TokenDataObserver_Unmarshall(t *testing.T) {
baseJSON := `{
%s
"batchGasLimit": 1,
"relativeBoostPerWaitHour": 1,
"inflightCacheExpiry": "1s",
"rootSnoozeTime": "1s",
"messageVisibilityInterval": "1s",
Expand Down Expand Up @@ -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),
Expand Down
Loading