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

feat: eip-1559 fixed gas prices #925

Merged
merged 8 commits into from
Aug 21, 2023
Merged

feat: eip-1559 fixed gas prices #925

merged 8 commits into from
Aug 21, 2023

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Aug 15, 2023

What this PR resolves

Resolves #924

How it resolves it

  • Adds 2 new fields to GasPrice model:
    • maxFeePerGas (in Wei)
    • maxPriorityFeePerGas (in Wei)
  • new serializer for fixed EIP-1559 gas price
  • migration

@schmanu schmanu requested a review from a team as a code owner August 15, 2023 13:21
@github-actions
Copy link

github-actions bot commented Aug 15, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@schmanu
Copy link
Member Author

schmanu commented Aug 15, 2023

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Aug 15, 2023
@coveralls
Copy link

coveralls commented Aug 15, 2023

Pull Request Test Coverage Report for Build 5927002806

  • 102 of 102 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 99.887%

Totals Coverage Status
Change from base Build 5857593264: 0.07%
Covered Lines: 4436
Relevant Lines: 4441

💛 - Coveralls

@fmrsabino fmrsabino added the in review Someone is reviewing this Pull Request label Aug 16, 2023
Copy link
Contributor

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

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

I'd add a test from "view" perspective – if a a fixed1559 gas price is set, how is it rendered in the response.

Comment on lines 169 to 171
exactly_one_variant = reduce(
xor, [fixed_wei_defined, fixed1559_defined, oracle_defined]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't work as it is since True XOR True XOR True becomes False XOR True which becomes True and that won't match with "exactly one variant".

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like:

exactly_one_variant = [fixed_wei_defined, fixed1559_defined, oracle_defined].count(True) == 1

wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops I missed that one. Your suggestions sounds good. I will change it to that :)

@fmrsabino fmrsabino removed the in review Someone is reviewing this Pull Request label Aug 16, 2023
@schmanu schmanu requested a review from fmrsabino August 17, 2023 07:53
Comment on lines 178 to 185
"oracle_uri": "An oracle uri, fixed gas price or maxFeePerGas and maxPriorityFeePerGas should be \
provided (but not multiple)",
"fixed_wei_value": "An oracle uri, fixed gas price or maxFeePerGas and maxPriorityFeePerGas \
should be provided (but not multiple)",
"max_fee_per_gas": "An oracle uri, fixed gas price or maxFeePerGas and maxPriorityFeePerGas \
should be provided (but not multiple)",
"max_priority_fee_per_gas": "An oracle uri, fixed gas price or maxFeePerGas and \
maxPriorityFeePerGas should be provided (but not multiple)",
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: the error detail can be extracted to a variable and referenced (seems to be the same for very field).

@schmanu schmanu requested a review from fmrsabino August 21, 2023 14:09
Copy link
Contributor

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

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

🚀

@schmanu schmanu merged commit 9e86912 into main Aug 21, 2023
@schmanu schmanu deleted the feat/eip1559-gasprice-model branch August 21, 2023 15:24
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixed gas price settings for EIP-1559
3 participants