feat(proxyd): track consensus for {safe,finalized} blocks and rewrite tags#5794
feat(proxyd): track consensus for {safe,finalized} blocks and rewrite tags#5794OptimismBot merged 14 commits intodevelopfrom
Conversation
|
✅ Deploy Preview for opstack-docs canceled.
|
aabdb03 to
5975683
Compare
|
Hey @felipe-op! This PR has merge conflicts. Please fix them before continuing review. |
5975683 to
750edbf
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #5794 +/- ##
===========================================
- Coverage 42.27% 39.70% -2.57%
===========================================
Files 464 306 -158
Lines 30078 25417 -4661
Branches 876 0 -876
===========================================
- Hits 12714 10091 -2623
+ Misses 16362 14372 -1990
+ Partials 1002 954 -48
Flags with carried forward coverage won't be shown. Click here to find out more. |
b03e193 to
6aa40d4
Compare
|
This PR has been added to the merge queue, and will be merged soon. |
|
This PR is next in line to be merged, and will be merged as soon as checks pass. |
1 similar comment
|
This PR is next in line to be merged, and will be merged as soon as checks pass. |
Description
This change adds the ability to track
finalizedandsafeblock tags within a backend group. It uses the same consensus poller mechanism, and converge to the lowest block.Those tags are not used to form a consensus, only to maintain a consistent view from client perspective.
It shallowly check the values for sanity, i.e. tag values should never decrease, and
finalized<=safe<=latest. In case of an unexpected scenario, we ban the backend and try to re-establish the consensus. If all backends are observing the same reorg, all of them will be banned and we'll stop serving traffic temporarily.Note this is a very rare event and we are trying to prevent overreacting to a bad node.
Re-establishing the consensus may result in
safeorfinalizedto drop in the same way a backend would do if such reorg would be observed.Tests
Added tests to cover new cases
Invariants
Additional context
This is part of the project Consensus Aware RPC Proxy: https://www.notion.so/oplabs/Consensus-Aware-RPC-Proxy-0138e029af814e4cbca2740c7888e02d
Metadata
https://linear.app/optimism/issue/INF-246/add-safe-and-finalized-blocks-to-consensus-proxyd
TODOs