Skip to content
Open
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
5 changes: 4 additions & 1 deletion deployment/cre/jobs/propose_evm_cap.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ type OverrideDefaultCfg struct {
DeltaStage time.Duration `json:"deltaStage" yaml:"deltaStage,omitempty"`
// ReceiverGasMinimum is the minimum amount of gas that the receiver contract must get to process the forwarder report.
// This is the default value used when the user doesn't specify a gas limit when invoking WriteReport.
ReceiverGasMinimum uint64 `json:"receiverGasMinimum,omitempty" yaml:"receiverGasMinimum,omitempty"`
ReceiverGasMinimum uint64 `json:"receiverGasMinimum,omitempty" yaml:"receiverGasMinimum,omitempty"`
// ForwarderGasOverheadMargin is the safety margin, on top of the forwarder's internal gas reservation,
// used to estimate the receiver gas budget from the transmission gas limit. 0 uses the capability default.
ForwarderGasOverheadMargin uint64 `json:"forwarderGasOverheadMargin,omitempty" yaml:"forwarderGasOverheadMargin,omitempty"`
NodeAddress string `json:"nodeAddress,omitempty" yaml:"nodeAddress,omitempty"`
ObservationPollerWorkersCount uint `json:"observationPollerWorkersCount,omitempty" yaml:"observationPollerWorkersCount,omitempty"`
ObservationPollPeriod time.Duration `json:"observationPollPeriod,omitempty" yaml:"observationPollPeriod,omitempty"`
Expand Down
11 changes: 11 additions & 0 deletions deployment/cre/jobs/propose_evm_cap_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jobs_test

import (
"encoding/json"
"fmt"
"strconv"
"strings"
Expand Down Expand Up @@ -535,3 +536,13 @@ func TestProposeStandardCapabilityJob_ReusesUUIDWithLegacyNameFormat(t *testing.
}
assert.True(t, hasLegacyFormat, "should find job with legacy name format (evm-capabilities-v2) when UUIDs are reused")
}

func TestOverrideDefaultCfg_ForwarderGasOverheadMargin_JSON(t *testing.T) {
enc, err := json.Marshal(jobs.OverrideDefaultCfg{ForwarderGasOverheadMargin: 150_000})
require.NoError(t, err)
assert.Contains(t, string(enc), `"forwarderGasOverheadMargin":150000`)

enc, err = json.Marshal(jobs.OverrideDefaultCfg{})
require.NoError(t, err)
assert.NotContains(t, string(enc), "forwarderGasOverheadMargin", "zero must be omitted so the capability default applies")
}
Loading