Skip to content

feat: gas oracle event#1190

Closed
tynes wants to merge 1 commit intoregenesis/0.5.0from
feat/gas-oracle-event
Closed

feat: gas oracle event#1190
tynes wants to merge 1 commit intoregenesis/0.5.0from
feat/gas-oracle-event

Conversation

@tynes
Copy link
Copy Markdown
Contributor

@tynes tynes commented Jun 29, 2021

Description
Previously the OVM_GasPriceOracle did not emit an event when the gas
price was updated. This is bad because it is hard to tell the historical
changes in the smart contract state. With this change, it should be
possible for a user to reconstruct the entire history of the changes in
L2 gas prices based on the append only log data structure of the set of
events.

The event is GasPriceUpdated(uint256,uint265) where the first value
is the old price and the second value is the new price.

The ABI is also updated, changing the gasPrice()(uint256) getter into
getGasPrice()(uint265) by making gasPrice be internal. Previously
it was public so a getter was autogenerated.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jun 29, 2021

🦋 Changeset detected

Latest commit: 56deb61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eth-optimism/contracts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 29, 2021

Codecov Report

Merging #1190 (a580e63) into regenesis/0.5.0 (cec71a4) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           regenesis/0.5.0    #1190      +/-   ##
===================================================
+ Coverage            86.18%   86.20%   +0.02%     
===================================================
  Files                   50       50              
  Lines                 1990     1993       +3     
  Branches               318      318              
===================================================
+ Hits                  1715     1718       +3     
  Misses                 275      275              
Impacted Files Coverage Δ
...tic-ethereum/OVM/predeploys/OVM_GasPriceOracle.sol 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cec71a4...a580e63. Read the comment docs.

@tynes tynes force-pushed the feat/gas-oracle-event branch 3 times, most recently from a580e63 to 2c05762 Compare June 30, 2021 16:05
Copy link
Copy Markdown
Contributor

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

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

Requesting one minor change but otherwise LGTM.

@tynes tynes force-pushed the feat/gas-oracle-event branch from 2c05762 to 56deb61 Compare June 30, 2021 20:12
Previously the `OVM_GasPriceOracle` did not emit an event when the gas
price was updated. This is bad because it is hard to tell the historical
changes in the smart contract state. With this change, it should be
possible for a user to reconstruct the entire history of the changes in
L2 gas prices based on the append only log data structure of the set of
events.

The event is `GasPriceUpdated(uint256,uint265)` where the first value
is the old price and the second value is the new price.

The ABI is also updated, changing the `gasPrice()(uint256)` getter into
`getGasPrice()(uint265)` by making `gasPrice` be internal. Previously
it was public so a getter was autogenerated.
Copy link
Copy Markdown
Contributor

@smartcontracts smartcontracts left a comment

Choose a reason for hiding this comment

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

LGTM

@tynes
Copy link
Copy Markdown
Contributor Author

tynes commented Aug 4, 2021

This will require an update to the gas-oracle and probably shouldn't be merged until that is complete. Its a very simple fix, just regenerating the bindings and updating a few method calls

@tynes tynes closed this Sep 1, 2021
@tynes tynes deleted the feat/gas-oracle-event branch November 4, 2021 20:30
theochap pushed a commit that referenced this pull request Dec 10, 2025
Co-authored-by: refcell <abigger87@gmail.com>
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.

4 participants