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

Move KeySpecific field #9694

Merged
merged 7 commits into from
Jul 10, 2023

Conversation

george-dorin
Copy link
Contributor

@george-dorin george-dorin commented Jun 22, 2023

  • Move KeySpecificMaxGasPriceWei into GasEstimator
  • Rename KeySpecificMaxGasPriceWei to KeySpecificMaxPrice to better match the config name

@github-actions
Copy link
Contributor

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

@george-dorin george-dorin marked this pull request as ready for review June 23, 2023 16:25
@cedric-cordenier
Copy link
Contributor

@george-dorin Is moving it into GasEstimator correct? According to the docs, there's this:

[[EVM.KeySpecific]]
Key = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example
GasEstimator.PriceMax = '79 gwei' # Example

Which suggests that we should have cfg.EVM().KeySpecific().GasEstimator().PriceMax() or similar (KeySpecific().GasEstimatorPriceMax()?)

blockDelay *uint16
transactionsMaxInFlight *uint32
}

func (g *gasEstimatorConfig) KeySpecificMaxPrice(addr gethcommon.Address) *assets.Wei {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should consider naming this a little differently?

Suggested change
func (g *gasEstimatorConfig) KeySpecificMaxPrice(addr gethcommon.Address) *assets.Wei {
func (g *gasEstimatorConfig) MaxPriceKey(addr gethcommon.Address) *assets.Wei {
Suggested change
func (g *gasEstimatorConfig) KeySpecificMaxPrice(addr gethcommon.Address) *assets.Wei {
func (g *gasEstimatorConfig) MaxPriceByKey(addr gethcommon.Address) *assets.Wei {
Suggested change
func (g *gasEstimatorConfig) KeySpecificMaxPrice(addr gethcommon.Address) *assets.Wei {
func (g *gasEstimatorConfig) MaxPriceForKey(addr gethcommon.Address) *assets.Wei {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that makes more sense, renamed in b6cfd04

@jmank88
Copy link
Contributor

jmank88 commented Jun 23, 2023

@george-dorin Is moving it into GasEstimator correct? According to the docs, there's this:

[[EVM.KeySpecific]]
Key = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example
GasEstimator.PriceMax = '79 gwei' # Example

Which suggests that we should have cfg.EVM().KeySpecific().GasEstimator().PriceMax() or similar (KeySpecific().GasEstimatorPriceMax()?)

Oh I think it get's weird because we don't just look up the field directly, we fallback to default and also constraint a bound?

@george-dorin
Copy link
Contributor Author

@george-dorin Is moving it into GasEstimator correct? According to the docs, there's this:

[[EVM.KeySpecific]]
Key = '0x2a3e23c6f242F5345320814aC8a1b4E58707D292' # Example
GasEstimator.PriceMax = '79 gwei' # Example

Which suggests that we should have cfg.EVM().KeySpecific().GasEstimator().PriceMax() or similar (KeySpecific().GasEstimatorPriceMax()?)

Oh I think it get's weird because we don't just look up the field directly, we fallback to default and also constraint a bound?

Yeah, this field is sort of odd because of the fallback, placing it in the gasEstimator makes the most sense and leads to a much cleaner implementation.

@cedric-cordenier
Copy link
Contributor

@george-dorin Makes sense! In that case, should we change the Config structure to reflect this, i.e. move KeySpecific under GasEstimator? (This is probably out of scope for this PR, but if we want to do this maybe we can put it on the backlog)

@george-dorin
Copy link
Contributor Author

@george-dorin Makes sense! In that case, should we change the Config structure to reflect this, i.e. move KeySpecific under GasEstimator? (This is probably out of scope for this PR, but if we want to do this maybe we can put it on the backlog)

Yes, we could definitely do this, will make a ticket

@cl-sonarqube-production
Copy link

@george-dorin george-dorin added this pull request to the merge queue Jul 10, 2023
Merged via the queue into develop with commit ea29e8f Jul 10, 2023
95 checks passed
@george-dorin george-dorin deleted the chore/BCF-2340_move_key_specific_gas_estimator branch July 10, 2023 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants