Skip to content

Commit eb520b1

Browse files
committed
Also use gas from latest block when estimating on auto txs
1 parent 56b12a3 commit eb520b1

15 files changed

Lines changed: 38 additions & 16 deletions

rocketpool/node/defend-challenge-exit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func (t *defendChallengeExit) defendChallenge(rp *rocketpool.RocketPool, mp mega
207207
// Get the max fee
208208
maxFee := t.maxFee
209209
if maxFee == nil || maxFee.Uint64() == 0 {
210-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
210+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
211211
if err != nil {
212212
return err
213213
}

rocketpool/node/defend-pdao-props.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func (t *defendPdaoProps) defendProposal(prop defendableProposal) error {
256256
// Get the max fee
257257
maxFee := t.maxFee
258258
if maxFee == nil || maxFee.Uint64() == 0 {
259-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
259+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
260260
if err != nil {
261261
return err
262262
}

rocketpool/node/distribute-minipools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func (t *distributeMinipools) distributeMinipool(mpd *rpstate.NativeMinipoolDeta
242242
// Get the max fee
243243
maxFee := t.maxFee
244244
if maxFee == nil || maxFee.Uint64() == 0 {
245-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
245+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
246246
if err != nil {
247247
return false, err
248248
}

rocketpool/node/notify-final-balance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (t *notifyFinalBalance) createFinalBalanceProof(rp *rocketpool.RocketPool,
234234
// Get the max fee
235235
maxFee := t.maxFee
236236
if maxFee == nil || maxFee.Uint64() == 0 {
237-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
237+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
238238
if err != nil {
239239
return err
240240
}

rocketpool/node/notify-validator-exit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func (t *notifyValidatorExit) createExitProof(rp *rocketpool.RocketPool, beaconS
204204
// Get the max fee
205205
maxFee := t.maxFee
206206
if maxFee == nil || maxFee.Uint64() == 0 {
207-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
207+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
208208
if err != nil {
209209
return err
210210
}

rocketpool/node/prestake-megapool-validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func (t *prestakeMegapoolValidator) assignDeposit(callopts *bind.CallOpts) error
200200
// Get the max fee
201201
maxFee := t.maxFee
202202
if maxFee == nil || maxFee.Uint64() == 0 {
203-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
203+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
204204
if err != nil {
205205
return err
206206
}

rocketpool/node/provision-express-tickets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (t *provisionExpress) provisionExpress(nodeAddress common.Address) error {
157157
// Get the max fee
158158
maxFee := t.maxFee
159159
if maxFee == nil || maxFee.Uint64() == 0 {
160-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
160+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
161161
if err != nil {
162162
return err
163163
}

rocketpool/node/reduce-bonds.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func (t *reduceBonds) forceFeeDistribution() (bool, error) {
255255
// Get the max fee
256256
maxFee := t.maxFee
257257
if maxFee == nil || maxFee.Uint64() == 0 {
258-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
258+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
259259
if err != nil {
260260
return false, err
261261
}
@@ -365,7 +365,7 @@ func (t *reduceBonds) reduceBond(mpd *rpstate.NativeMinipoolDetails, windowStart
365365
// Get the max fee
366366
maxFee := t.maxFee
367367
if maxFee == nil || maxFee.Uint64() == 0 {
368-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
368+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
369369
if err != nil {
370370
return false, err
371371
}

rocketpool/node/stake-megapool-validator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func (t *stakeMegapoolValidator) stakeValidator(rp *rocketpool.RocketPool, beaco
215215
// Get the max fee
216216
maxFee := t.maxFee
217217
if maxFee == nil || maxFee.Uint64() == 0 {
218-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
218+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
219219
if err != nil {
220220
return err
221221
}

rocketpool/node/verify-pdao-props.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ func (t *verifyPdaoProps) submitChallenge(challenge challenge) error {
371371
// Get the max fee
372372
maxFee := t.maxFee
373373
if maxFee == nil || maxFee.Uint64() == 0 {
374-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
374+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
375375
if err != nil {
376376
return err
377377
}
@@ -427,7 +427,7 @@ func (t *verifyPdaoProps) submitDefeat(defeat defeat) error {
427427
// Get the max fee
428428
maxFee := t.maxFee
429429
if maxFee == nil || maxFee.Uint64() == 0 {
430-
maxFee, err = rpgas.GetHeadlessMaxFeeWei(t.cfg)
430+
maxFee, err = rpgas.GetHeadlessMaxFeeWeiWithLatestBlock(t.cfg, t.rp)
431431
if err != nil {
432432
return err
433433
}

0 commit comments

Comments
 (0)