ethereum-optimism / optimistic-specs

Optimistic: Bedrock, is a protocol that strives to be an extremely simple optimistic rollup that maintains 1:1 compatibility with Ethereum
MIT License
167 stars 35 forks source link

refactor: new messengers #421

Closed smartcontracts closed 2 years ago

smartcontracts commented 2 years ago

Implements the new messenger flow. This ensures that the messengers and bridges work in a backwards compatible way. The previous iteration of the messengers didn't take into account deposits that were in flight during the upgrade. This pull request has some major architectural changes so that the bridges now go through the messengers again. This allows for replayability in the bridges as well as gives the bridges replay protection.

A main feature of this PR is that the messenger and bridges now extend a base messenger or bridge contract to make the functionality basically the same on both L1 and L2. The previous iteration of the contracts made a distinction between the L1 and L2 sides of things. The previous APIs are persisted, but now there is a universal API that can be used on the bridges/messengers no matter which domain you are in.

Hardhat deploy scripts are added to the ops setup.

The bindings for the l2os and opnode are regenerated.

Deprecates:

Unblocks:

Closes:

codecov-commenter commented 2 years ago

Codecov Report

Merging #421 (5e37e47) into main (3a1f6ff) will increase coverage by 1.42%. The diff coverage is 7.14%.

@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   51.68%   53.10%   +1.42%     
==========================================
  Files          57       62       +5     
  Lines        5764     6498     +734     
==========================================
+ Hits         2979     3451     +472     
- Misses       2415     2608     +193     
- Partials      370      439      +69     
Impacted Files Coverage Δ
opnode/contracts/deposit/deposit_feed_raw.go 5.21% <0.00%> (ø)
l2os/bindings/l2oo/l2_output_oracle.go 8.60% <5.71%> (-0.29%) :arrow_down:
l2os/drivers/l2output/driver.go 67.24% <100.00%> (+0.18%) :arrow_up:
opnode/rollup/driver/state.go 71.23% <0.00%> (-5.36%) :arrow_down:
l2os/service.go 90.78% <0.00%> (-3.95%) :arrow_down:
opnode/rollup/driver/step.go 61.37% <0.00%> (-3.13%) :arrow_down:
opnode/node/node.go 60.00% <0.00%> (-1.71%) :arrow_down:
opnode/node/api.go 58.64% <0.00%> (-0.76%) :arrow_down:
opnode/p2p/config.go 7.83% <0.00%> (-0.18%) :arrow_down:
opnode/service.go 0.00% <0.00%> (ø)
... and 13 more

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 3a1f6ff...5e37e47. Read the comment docs.