From 956248cf1fa67b3e8db2876559b551e41be83a63 Mon Sep 17 00:00:00 2001 From: Makram Kamaleddine Date: Thu, 20 Oct 2022 17:28:58 +0200 Subject: [PATCH] chore: remove vrf maxGasPriceGwei job parameter This will be set by TOML config. --- core/services/job/job_orm_test.go | 4 -- core/services/job/models.go | 17 ------- core/services/job/orm.go | 2 - core/services/vrf/delegate.go | 39 ---------------- core/services/vrf/integration_v2_test.go | 27 +++++------ core/services/vrf/listener_v2.go | 23 ---------- core/services/vrf/validate_test.go | 46 ------------------- .../0145_remove_maxgaspricegwei_vrf.sql | 7 +++ core/testdata/testspecs/v2_specs.go | 8 +--- core/web/presenters/job.go | 2 - core/web/resolver/spec.go | 9 ---- core/web/resolver/spec_test.go | 6 +-- core/web/schema/type/spec.graphql | 1 - 13 files changed, 21 insertions(+), 170 deletions(-) create mode 100644 core/store/migrate/migrations/0145_remove_maxgaspricegwei_vrf.sql diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index 0f94df2f940..923219d54fe 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -355,7 +355,6 @@ func TestORM_CreateJob_VRFV2(t *testing.T) { ChunkSize: 25, BackoffInitialDelay: time.Minute, BackoffMaxDelay: time.Hour, - MaxGasPriceGWei: 100, }). Toml()) require.NoError(t, err) @@ -384,9 +383,6 @@ func TestORM_CreateJob_VRFV2(t *testing.T) { var chunkSize int require.NoError(t, db.Get(&chunkSize, `SELECT chunk_size FROM vrf_specs LIMIT 1`)) require.Equal(t, 25, chunkSize) - var maxGasPriceGWei uint32 - require.NoError(t, db.Get(&maxGasPriceGWei, `SELECT max_gas_price_gwei FROM vrf_specs LIMIT 1`)) - require.Equal(t, *jb.VRFSpec.MaxGasPriceGWei, maxGasPriceGWei) var fa pq.ByteaArray require.NoError(t, db.Get(&fa, `SELECT from_addresses FROM vrf_specs LIMIT 1`)) var actual []string diff --git a/core/services/job/models.go b/core/services/job/models.go index 9ba7791efd1..f5fd2b90adb 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -441,23 +441,6 @@ type VRFSpec struct { RequestedConfsDelay int64 `toml:"requestedConfsDelay"` // For v2 jobs. Optional, defaults to 0 if not provided. RequestTimeout time.Duration `toml:"requestTimeout"` // Optional, defaults to 24hr if not provided. - // MaxGasPriceGwei sets the maximum gas price in gwei on the addresses - // specified in VRFSpec.FromAddresses. - // - // This is optional. If this is not set, then the job will not attempt to set any - // key specific gas prices on the addresses specified in VRFSpec.FromAddresses, - // and as a result, will use any previously set key specific max gas price (i.e, set via CLI or REST API) - // or the global max gas price if a key-specific gas price is not set. - // - // This is essentially the "gas lane" gas price. - // - // This will end up overriding any previously set key-specific gas prices - // set via CLI and/or REST API. However, environment variables can end up - // taking precedence depending on their values relative to the key-specific prices. - // - // V2 only. - MaxGasPriceGWei *uint32 `toml:"maxGasPriceGWei" db:"max_gas_price_gwei"` - // ChunkSize is the number of pending VRF V2 requests to process in parallel. Optional, defaults // to 20 if not provided. ChunkSize uint32 `toml:"chunkSize"` diff --git a/core/services/job/orm.go b/core/services/job/orm.go index b721e7eb7c1..02793b3a057 100644 --- a/core/services/job/orm.go +++ b/core/services/job/orm.go @@ -315,14 +315,12 @@ func (o *orm) CreateJob(jb *Job, qopts ...pg.QOpt) error { evm_chain_id, from_addresses, poll_period, requested_confs_delay, request_timeout, chunk_size, batch_coordinator_address, batch_fulfillment_enabled, batch_fulfillment_gas_multiplier, backoff_initial_delay, backoff_max_delay, - max_gas_price_gwei, created_at, updated_at) VALUES ( :coordinator_address, :public_key, :min_incoming_confirmations, :evm_chain_id, :from_addresses, :poll_period, :requested_confs_delay, :request_timeout, :chunk_size, :batch_coordinator_address, :batch_fulfillment_enabled, :batch_fulfillment_gas_multiplier, :backoff_initial_delay, :backoff_max_delay, - :max_gas_price_gwei, NOW(), NOW()) RETURNING id;` diff --git a/core/services/vrf/delegate.go b/core/services/vrf/delegate.go index f24b4c3ad7e..2bfff0f7921 100644 --- a/core/services/vrf/delegate.go +++ b/core/services/vrf/delegate.go @@ -21,7 +21,6 @@ import ( "github.com/smartcontractkit/chainlink/core/logger" "github.com/smartcontractkit/chainlink/core/services/job" "github.com/smartcontractkit/chainlink/core/services/keystore" - "github.com/smartcontractkit/chainlink/core/services/keystore/keys/ethkey" "github.com/smartcontractkit/chainlink/core/services/pg" "github.com/smartcontractkit/chainlink/core/services/pipeline" "github.com/smartcontractkit/chainlink/core/utils" @@ -115,17 +114,6 @@ func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { lV1 := l.Named("VRFListener") lV2 := l.Named("VRFListenerV2") - // This is not a terminal error, but it isn't ideal. - // We can operate under these potentially degraded conditions, however. - err = setMaxGasPriceGWei( - toAddrSlice(jb.VRFSpec.FromAddresses), - jb.VRFSpec.MaxGasPriceGWei, - d.cc, - chain.ID()) - if err != nil { - l.With("err", err).Warn("unable to set max gas price gwei on from addresses, continuing anyway") - } - for _, task := range pl.Tasks { if _, ok := task.(*pipeline.VRFTaskV2); ok { linkEthFeedAddress, err := coordinatorV2.LINKETHFEED(nil) @@ -142,7 +130,6 @@ func (d *Delegate) ServicesForSpec(jb job.Job) ([]job.ServiceCtx, error) { lV2, chain.Client(), chain.ID(), - d.cc, chain.LogBroadcaster(), d.q, coordinatorV2, @@ -283,29 +270,3 @@ GROUP BY meta->'RequestID' } return counts, nil } - -// setMaxGasPriceGWei attempts to set the max gas price for each key in the fromAddresses slice -// of the VRF job spec to the given maxGasPriceGWei parameter. -// If maxGasPriceGWei is nil, this is a no-op. -func setMaxGasPriceGWei(fromAddresses []common.Address, maxGasPriceGWei *uint32, keyUpdater keyConfigUpdater, chainID *big.Int) error { - if maxGasPriceGWei == nil { - return nil - } - - for _, addr := range fromAddresses { - updater := evm.UpdateKeySpecificMaxGasPrice(addr, assets.GWei(int64(*maxGasPriceGWei))) - err := keyUpdater.UpdateConfig(chainID, updater) - if err != nil { - return errors.Wrap(err, "update key specific max gas price") - } - } - - return nil -} - -func toAddrSlice(addrs []ethkey.EIP55Address) (r []common.Address) { - for _, a := range addrs { - r = append(r, a.Address()) - } - return -} diff --git a/core/services/vrf/integration_v2_test.go b/core/services/vrf/integration_v2_test.go index de455fd3586..5e7cd15e080 100644 --- a/core/services/vrf/integration_v2_test.go +++ b/core/services/vrf/integration_v2_test.go @@ -315,7 +315,6 @@ func subscribeVRF( func createVRFJobs( t *testing.T, fromKeys [][]ethkey.KeyV2, - maxGasPricesGWei []int, app *cltest.TestApplication, uni coordinatorV2Universe, batchEnabled bool, @@ -343,7 +342,6 @@ func createVRFJobs( FromAddresses: keyStrs, BackoffInitialDelay: 10 * time.Millisecond, BackoffMaxDelay: time.Second, - MaxGasPriceGWei: maxGasPricesGWei[i], V2: true, }).Toml() jb, err := vrf.ValidatedVRFSpec(s) @@ -620,7 +618,7 @@ func TestVRFV2Integration_SingleConsumer_HappyPath_BatchFulfillment(t *testing.T require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job using key1 and key2 on the same gas lane. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, []int{10}, app, uni, true) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, app, uni, true) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() // Make some randomness requests. @@ -683,7 +681,7 @@ func TestVRFV2Integration_SingleConsumer_HappyPath_BatchFulfillment_BigGasCallba require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job using key1 and key2 on the same gas lane. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, []int{10}, app, uni, true) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, app, uni, true) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() // Make some randomness requests with low max gas callback limits. @@ -758,7 +756,7 @@ func TestVRFV2Integration_SingleConsumer_HappyPath(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job using key1 and key2 on the same gas lane. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1, key2}}, []int{10, 10}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1, key2}}, app, uni, false) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() // Make the first randomness request. @@ -839,7 +837,7 @@ func TestVRFV2Integration_SingleConsumer_EIP150_HappyPath(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, []int{10, 10}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, app, uni, false) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() // Make the first randomness request. @@ -889,7 +887,7 @@ func TestVRFV2Integration_SingleConsumer_EIP150_Revert(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, []int{10, 10}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, app, uni, false) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() // Make the first randomness request. @@ -955,7 +953,7 @@ func TestVRFV2Integration_SingleConsumer_Wrapper(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, []int{10, 10}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, app, uni, false) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() wrapper, _, consumer, consumerAddress := deployWrapper(t, uni, wrapperOverhead, coordinatorOverhead, keyHash, maxNumWords) @@ -1024,7 +1022,7 @@ func TestVRFV2Integration_Wrapper_High_Gas(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, []int{10, 10}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, app, uni, false) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() wrapper, _, consumer, consumerAddress := deployWrapper(t, uni, wrapperOverhead, coordinatorOverhead, keyHash, maxNumWords) @@ -1103,7 +1101,7 @@ func TestVRFV2Integration_SingleConsumer_NeedsBlockhashStore(t *testing.T) { }, assets.GWei(10).ToInt()) // Create VRF job. - vrfJobs := createVRFJobs(t, [][]ethkey.KeyV2{{vrfKey}}, []int{10}, app, uni, false) + vrfJobs := createVRFJobs(t, [][]ethkey.KeyV2{{vrfKey}}, app, uni, false) keyHash := vrfJobs[0].VRFSpec.PublicKey.MustHash() _ = createAndStartBHSJob( @@ -1192,7 +1190,7 @@ func TestVRFV2Integration_SingleConsumer_NeedsTopUp(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key}}, []int{1000}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key}}, app, uni, false) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() numWords := uint32(20) @@ -1256,7 +1254,7 @@ func TestVRFV2Integration_SingleConsumer_BigGasCallback_Sandwich(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, []int{100}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key1}}, app, uni, false) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() // Make some randomness requests, each one block apart, which contain a single low-gas request sandwiched between two high-gas requests. @@ -1356,7 +1354,7 @@ func TestVRFV2Integration_SingleConsumer_MultipleGasLanes(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) // Create VRF jobs. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{cheapKey}, {expensiveKey}}, []int{10, 1000}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{cheapKey}, {expensiveKey}}, app, uni, false) cheapHash := jbs[0].VRFSpec.PublicKey.MustHash() expensiveHash := jbs[1].VRFSpec.PublicKey.MustHash() @@ -1441,7 +1439,7 @@ func TestVRFV2Integration_SingleConsumer_AlwaysRevertingCallback_StillFulfilled( require.NoError(t, app.Start(testutils.Context(t))) // Create VRF job. - jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key}}, []int{10}, app, uni, false) + jbs := createVRFJobs(t, [][]ethkey.KeyV2{{key}}, app, uni, false) keyHash := jbs[0].VRFSpec.PublicKey.MustHash() // Make the randomness request. @@ -1636,7 +1634,6 @@ func TestIntegrationVRFV2(t *testing.T) { BatchCoordinatorAddress: uni.batchCoordinatorContractAddress.String(), MinIncomingConfirmations: incomingConfs, PublicKey: vrfkey.PublicKey.String(), - MaxGasPriceGWei: 10, FromAddresses: []string{keys[0].Address.String()}, V2: true, }).Toml() diff --git a/core/services/vrf/listener_v2.go b/core/services/vrf/listener_v2.go index 3a99bd7d62c..cdfc89178d4 100644 --- a/core/services/vrf/listener_v2.go +++ b/core/services/vrf/listener_v2.go @@ -21,7 +21,6 @@ import ( "golang.org/x/exp/slices" "github.com/smartcontractkit/chainlink/core/assets" - "github.com/smartcontractkit/chainlink/core/chains/evm" evmclient "github.com/smartcontractkit/chainlink/core/chains/evm/client" httypes "github.com/smartcontractkit/chainlink/core/chains/evm/headtracker/types" "github.com/smartcontractkit/chainlink/core/chains/evm/log" @@ -74,17 +73,11 @@ func (errBlockhashNotInStore) Error() string { return "Blockhash not in store" } -// keyConfigUpdater can update key-specific max gas prices for a given chain. -type keyConfigUpdater interface { - UpdateConfig(id *big.Int, updaters ...evm.ChainConfigUpdater) error -} - func newListenerV2( cfg Config, l logger.Logger, ethClient evmclient.Client, chainID *big.Int, - keyUpdater keyConfigUpdater, logBroadcaster log.Broadcaster, q pg.Q, coordinator vrf_coordinator_v2.VRFCoordinatorV2Interface, @@ -123,7 +116,6 @@ func newListenerV2( wg: &sync.WaitGroup{}, aggregator: aggregator, deduper: deduper, - keyUpdater: keyUpdater, } } @@ -159,9 +151,6 @@ type listenerV2 struct { logBroadcaster log.Broadcaster txm txmgr.TxManager - // to update key-specific max gas prices if job spec field is set. - keyUpdater keyConfigUpdater - coordinator vrf_coordinator_v2.VRFCoordinatorV2Interface batchCoordinator batch_vrf_coordinator_v2.BatchVRFCoordinatorV2Interface @@ -577,12 +566,6 @@ func (lsn *listenerV2) processRequestsPerSubBatch( } fromAddresses := lsn.fromAddresses() - err = setMaxGasPriceGWei(fromAddresses, lsn.job.VRFSpec.MaxGasPriceGWei, lsn.keyUpdater, lsn.chainID) - if err != nil { - l.Warnw("Couldn't set max gas price gwei on configured from addresses, processing anyway", - "err", err, "fromAddresses", fromAddresses) - } - fromAddress, err := lsn.gethks.GetRoundRobinAddress(lsn.chainID, fromAddresses...) if err != nil { l.Errorw("Couldn't get next from address", "err", err) @@ -735,12 +718,6 @@ func (lsn *listenerV2) processRequestsPerSub( } fromAddresses := lsn.fromAddresses() - err = setMaxGasPriceGWei(fromAddresses, lsn.job.VRFSpec.MaxGasPriceGWei, lsn.keyUpdater, lsn.chainID) - if err != nil { - l.Warnw("Couldn't set max gas price gwei on configured from addresses, processing anyway", - "err", err, "fromAddresses", fromAddresses) - } - fromAddress, err := lsn.gethks.GetRoundRobinAddress(lsn.chainID, fromAddresses...) if err != nil { l.Errorw("Couldn't get next from address", "err", err) diff --git a/core/services/vrf/validate_test.go b/core/services/vrf/validate_test.go index 0e785ff75c1..9a5f89ce718 100644 --- a/core/services/vrf/validate_test.go +++ b/core/services/vrf/validate_test.go @@ -29,7 +29,6 @@ requestTimeout = "168h" # 7 days chunkSize = 25 backoffInitialDelay = "1m" backoffMaxDelay = "2h" -maxGasPriceGWei = 200 observationSource = """ decode_log [type=ethabidecodelog abi="RandomnessRequest(bytes32 keyHash,uint256 seed,bytes32 indexed jobID,address sender,uint256 fee,bytes32 requestID)" @@ -55,7 +54,6 @@ decode_log->vrf->encode_tx->submit_tx assert.Equal(t, uint32(10), s.VRFSpec.MinIncomingConfirmations) assert.Equal(t, "0xB3b7874F13387D44a3398D298B075B7A3505D8d4", s.VRFSpec.CoordinatorAddress.String()) assert.Equal(t, "0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179800", s.VRFSpec.PublicKey.String()) - assert.Equal(t, uint32(200), *s.VRFSpec.MaxGasPriceGWei) require.Equal(t, 168*time.Hour, s.VRFSpec.RequestTimeout) require.Equal(t, time.Minute, s.VRFSpec.BackoffInitialDelay) require.Equal(t, 2*time.Hour, s.VRFSpec.BackoffMaxDelay) @@ -431,50 +429,6 @@ decode_log->vrf->encode_tx->submit_tx require.Error(t, err) }, }, - { - name: "max gas price gwei not provided", - toml: ` -type = "vrf" -schemaVersion = 1 -minIncomingConfirmations = 10 -publicKey = "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F8179800" -coordinatorAddress = "0xB3b7874F13387D44a3398D298B075B7A3505D8d4" -requestTimeout = "168h" # 7 days -chunkSize = 25 -backoffInitialDelay = "1m" -backoffMaxDelay = "2h" -observationSource = """ -decode_log [type=ethabidecodelog - abi="RandomnessRequest(bytes32 keyHash,uint256 seed,bytes32 indexed jobID,address sender,uint256 fee,bytes32 requestID)" - data="$(jobRun.logData)" - topics="$(jobRun.logTopics)"] -vrf [type=vrf - publicKey="$(jobSpec.publicKey)" - requestBlockHash="$(jobRun.logBlockHash)" - requestBlockNumber="$(jobRun.logBlockNumber)" - topics="$(jobRun.logTopics)"] -encode_tx [type=ethabiencode - abi="fulfillRandomnessRequest(bytes proof)" - data="{\\"proof\\": $(vrf)}"] -submit_tx [type=ethtx to="%s" - data="$(encode_tx)" - txMeta="{\\"requestTxHash\\": $(jobRun.logTxHash),\\"requestID\\": $(decode_log.requestID),\\"jobID\\": $(jobSpec.databaseID)}"] -decode_log->vrf->encode_tx->submit_tx -""" -`, - assertion: func(t *testing.T, s job.Job, err error) { - require.NoError(t, err) - require.NotNil(t, s.VRFSpec) - assert.Equal(t, uint32(10), s.VRFSpec.MinIncomingConfirmations) - assert.Equal(t, "0xB3b7874F13387D44a3398D298B075B7A3505D8d4", s.VRFSpec.CoordinatorAddress.String()) - assert.Equal(t, "0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179800", s.VRFSpec.PublicKey.String()) - assert.Nil(t, s.VRFSpec.MaxGasPriceGWei) - require.Equal(t, 168*time.Hour, s.VRFSpec.RequestTimeout) - require.Equal(t, time.Minute, s.VRFSpec.BackoffInitialDelay) - require.Equal(t, 2*time.Hour, s.VRFSpec.BackoffMaxDelay) - require.EqualValues(t, 25, s.VRFSpec.ChunkSize) - }, - }, } for _, tc := range tt { t.Run(tc.name, func(t *testing.T) { diff --git a/core/store/migrate/migrations/0145_remove_maxgaspricegwei_vrf.sql b/core/store/migrate/migrations/0145_remove_maxgaspricegwei_vrf.sql new file mode 100644 index 00000000000..c259a9e7c2a --- /dev/null +++ b/core/store/migrate/migrations/0145_remove_maxgaspricegwei_vrf.sql @@ -0,0 +1,7 @@ +-- +goose Up +ALTER TABLE vrf_specs DROP COLUMN "max_gas_price_gwei"; + +-- +goose Down +ALTER TABLE vrf_specs + ADD COLUMN "max_gas_price_gwei" BIGINT + CHECK (max_gas_price_gwei >= 0); diff --git a/core/testdata/testspecs/v2_specs.go b/core/testdata/testspecs/v2_specs.go index cea5e6c0897..0a12e0eac03 100644 --- a/core/testdata/testspecs/v2_specs.go +++ b/core/testdata/testspecs/v2_specs.go @@ -231,7 +231,6 @@ type VRFSpecParams struct { RequestTimeout time.Duration V2 bool ChunkSize int - MaxGasPriceGWei int BackoffInitialDelay time.Duration BackoffMaxDelay time.Duration } @@ -282,10 +281,6 @@ func GenerateVRFSpec(params VRFSpecParams) VRFSpec { if params.ChunkSize != 0 { chunkSize = params.ChunkSize } - maxGasPriceGWei := 200 - if params.MaxGasPriceGWei != 0 { - maxGasPriceGWei = params.MaxGasPriceGWei - } observationSource := fmt.Sprintf(` decode_log [type=ethabidecodelog abi="RandomnessRequest(bytes32 keyHash,uint256 seed,bytes32 indexed jobID,address sender,uint256 fee,bytes32 requestID)" @@ -351,7 +346,6 @@ publicKey = "%s" chunkSize = %d backoffInitialDelay = "%s" backoffMaxDelay = "%s" -maxGasPriceGWei = %d observationSource = """ %s """ @@ -360,7 +354,7 @@ observationSource = """ jobID, name, coordinatorAddress, batchCoordinatorAddress, params.BatchFulfillmentEnabled, strconv.FormatFloat(batchFulfillmentGasMultiplier, 'f', 2, 64), confirmations, params.RequestedConfsDelay, requestTimeout.String(), publicKey, chunkSize, - params.BackoffInitialDelay.String(), params.BackoffMaxDelay.String(), maxGasPriceGWei, observationSource) + params.BackoffInitialDelay.String(), params.BackoffMaxDelay.String(), observationSource) if len(params.FromAddresses) != 0 { var addresses []string for _, address := range params.FromAddresses { diff --git a/core/web/presenters/job.go b/core/web/presenters/job.go index c7aeafe5206..c4153135a05 100644 --- a/core/web/presenters/job.go +++ b/core/web/presenters/job.go @@ -293,7 +293,6 @@ type VRFSpec struct { RequestTimeout models.Duration `json:"requestTimeout"` BackoffInitialDelay models.Duration `json:"backoffInitialDelay"` BackoffMaxDelay models.Duration `json:"backoffMaxDelay"` - MaxGasPriceGWei *uint32 `json:"maxGasPriceGWei"` } func NewVRFSpec(spec *job.VRFSpec) *VRFSpec { @@ -312,7 +311,6 @@ func NewVRFSpec(spec *job.VRFSpec) *VRFSpec { RequestTimeout: models.MustMakeDuration(spec.RequestTimeout), BackoffInitialDelay: models.MustMakeDuration(spec.BackoffInitialDelay), BackoffMaxDelay: models.MustMakeDuration(spec.BackoffMaxDelay), - MaxGasPriceGWei: spec.MaxGasPriceGWei, } } diff --git a/core/web/resolver/spec.go b/core/web/resolver/spec.go index a404030bfe7..f59d2d4e572 100644 --- a/core/web/resolver/spec.go +++ b/core/web/resolver/spec.go @@ -698,15 +698,6 @@ func (r *VRFSpecResolver) BackoffMaxDelay() string { return r.spec.BackoffMaxDelay.String() } -// MaxGasPriceGWei resolves the spec's max gas price gwei. -func (r *VRFSpecResolver) MaxGasPriceGWei() *int32 { - if r.spec.MaxGasPriceGWei == nil { - return nil - } - maxGasPriceGWei := int32(*r.spec.MaxGasPriceGWei) - return &maxGasPriceGWei -} - type WebhookSpecResolver struct { spec job.WebhookSpec } diff --git a/core/web/resolver/spec_test.go b/core/web/resolver/spec_test.go index de4d1edc441..bd173e0d9e6 100644 --- a/core/web/resolver/spec_test.go +++ b/core/web/resolver/spec_test.go @@ -603,7 +603,6 @@ func TestResolver_VRFSpec(t *testing.T) { authenticated: true, before: func(f *gqlTestFramework) { f.App.On("JobORM").Return(f.Mocks.jobORM) - maxGasPriceGWei := uint32(200) f.Mocks.jobORM.On("FindJobWithoutSpecErrors", id).Return(job.Job{ Type: job.VRF, VRFSpec: &job.VRFSpec{ @@ -622,7 +621,6 @@ func TestResolver_VRFSpec(t *testing.T) { BatchFulfillmentGasMultiplier: 1, BackoffInitialDelay: time.Minute, BackoffMaxDelay: time.Hour, - MaxGasPriceGWei: &maxGasPriceGWei, }, }, nil) }, @@ -648,7 +646,6 @@ func TestResolver_VRFSpec(t *testing.T) { chunkSize backoffInitialDelay backoffMaxDelay - maxGasPriceGWei } } } @@ -674,8 +671,7 @@ func TestResolver_VRFSpec(t *testing.T) { "batchFulfillmentGasMultiplier": 1, "chunkSize": 25, "backoffInitialDelay": "1m0s", - "backoffMaxDelay": "1h0m0s", - "maxGasPriceGWei": 200 + "backoffMaxDelay": "1h0m0s" } } } diff --git a/core/web/schema/type/spec.graphql b/core/web/schema/type/spec.graphql index 7a566fd97b4..b23934da7f4 100644 --- a/core/web/schema/type/spec.graphql +++ b/core/web/schema/type/spec.graphql @@ -108,7 +108,6 @@ type VRFSpec { chunkSize: Int! backoffInitialDelay: String! backoffMaxDelay: String! - maxGasPriceGWei: Int } type WebhookSpec {