Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

fix(driver): Handle reorg #216

Merged
merged 34 commits into from
May 16, 2023
Merged

fix(driver): Handle reorg #216

merged 34 commits into from
May 16, 2023

Conversation

cyberhorsey
Copy link
Contributor

@cyberhorsey cyberhorsey commented May 10, 2023

We need to handle reorg when an event is removed, previously we were just skipped, but instead we should rewind the chain.

This is very hard to test in the code without generating some mocks and refactoring how our tests work for this, but I think this is at least closer to a solution. Unsure if the spot at where I am handlign the reorg makes sense.

Closes #201 (hopefully ;))

@cyberhorsey cyberhorsey marked this pull request as draft May 10, 2023 19:22
@cyberhorsey cyberhorsey changed the title fix(block_batch_iterator): Handle reorg fix(driver): Handle reorg May 10, 2023
@cyberhorsey cyberhorsey marked this pull request as ready for review May 10, 2023 21:34
@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Merging #216 (a9151c7) into main (c6ea860) will decrease coverage by 2.19%.
The diff coverage is 19.51%.

❗ Current head a9151c7 differs from pull request most recent head 2d3c747. Consider uploading reports for the commit 2d3c747 to get more accurate results

@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
- Coverage   52.85%   50.67%   -2.19%     
==========================================
  Files          36       36              
  Lines        3415     3576     +161     
==========================================
+ Hits         1805     1812       +7     
- Misses       1372     1525     +153     
- Partials      238      239       +1     
Impacted Files Coverage Δ
driver/chain_syncer/chain_syncer.go 38.14% <0.00%> (ø)
driver/chain_syncer/calldata/syncer.go 35.18% <8.16%> (-16.61%) ⬇️
driver/state/l1_current.go 22.00% <22.22%> (-1.00%) ⬇️
pkg/chain_iterator/block_batch_iterator.go 53.92% <61.53%> (+1.67%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cyberhorsey cyberhorsey marked this pull request as draft May 11, 2023 02:19
@cyberhorsey cyberhorsey marked this pull request as ready for review May 12, 2023 03:27
driver/chain_syncer/calldata/syncer.go Outdated Show resolved Hide resolved
driver/chain_syncer/calldata/syncer.go Show resolved Hide resolved
driver/chain_syncer/calldata/syncer.go Outdated Show resolved Hide resolved
@davidtaikocha davidtaikocha enabled auto-merge (squash) May 16, 2023 17:40
@davidtaikocha davidtaikocha enabled auto-merge (squash) May 16, 2023 17:55
@davidtaikocha davidtaikocha merged commit fc2ec63 into main May 16, 2023
@davidtaikocha davidtaikocha deleted the handle_reorg branch May 16, 2023 18:01
vhjiang pushed a commit to taikoverse/taiko-degen-client that referenced this pull request Jul 1, 2023
Co-authored-by: David <david@taiko.xyz>
Co-authored-by: Roger <50648015+RogerLamTd@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review driver's reorg handling logic
3 participants