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

fix(relayer): save block by chain id #379

Merged
merged 16 commits into from
Dec 7, 2022
Merged

fix(relayer): save block by chain id #379

merged 16 commits into from
Dec 7, 2022

Conversation

cyberhorsey
Copy link
Contributor

@cyberhorsey cyberhorsey commented Dec 5, 2022

This PR fixes two issues:

  1. Saving a block to the database should first check if a block height exists for that chain_id. Presently, it does not check fo chain_id, so now this can run synchronizing between both blocks.
  2. Subscribe mode should not persist blocks saved to the database, in case you start it up in subscribe mode, but then still want to continue previously on the same database indexing the past in a separate instance fo the relayer.
  3. Near-identical batch handling methods for when there are no events remaining have been combined.

@codecov
Copy link

codecov bot commented Dec 6, 2022

Codecov Report

Merging #379 (90c64a9) into main (04702db) will decrease coverage by 0.29%.
The diff coverage is 50.90%.

@@            Coverage Diff             @@
##             main     #379      +/-   ##
==========================================
- Coverage   64.30%   64.00%   -0.30%     
==========================================
  Files          90       89       -1     
  Lines        2524     2492      -32     
  Branches      292      292              
==========================================
- Hits         1623     1595      -28     
- Misses        829      830       +1     
+ Partials       72       67       -5     
Flag Coverage Δ *Carryforward flag
bridge-ui 100.00% <ø> (ø) Carriedforward from 1abacd5
protocol 59.00% <ø> (ø) Carriedforward from 1abacd5
relayer 68.15% <50.90%> (-0.59%) ⬇️
ui 100.00% <ø> (ø) Carriedforward from 1abacd5

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
packages/relayer/indexer/subscribe.go 82.75% <ø> (-3.73%) ⬇️
packages/relayer/indexer/filter_then_subscribe.go 20.25% <15.38%> (+0.25%) ⬆️
packages/relayer/indexer/service.go 75.00% <28.57%> (-4.32%) ⬇️
...er/indexer/set_initial_processing_block_by_mode.go 80.00% <60.00%> (-8.89%) ⬇️
packages/relayer/indexer/handle_event.go 50.00% <68.75%> (ø)
packages/relayer/cli/cli.go 61.18% <100.00%> (+0.16%) ⬆️
...kages/relayer/indexer/handle_no_events_in_batch.go 66.66% <100.00%> (-7.25%) ⬇️
packages/relayer/repo/block.go 76.92% <100.00%> (ø)
... and 1 more

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

@vercel
Copy link

vercel bot commented Dec 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
bridge-ui ✅ Ready (Inspect) Visit Preview Dec 6, 2022 at 6:29PM (UTC)
1 Ignored Deployment
Name Status Preview Updated
website ⬜️ Ignored (Inspect) Dec 6, 2022 at 6:29PM (UTC)

dantaik
dantaik previously approved these changes Dec 6, 2022
…ing on waitgroup completion, simply processing block as hash was unused
@dantaik dantaik merged commit 608e3e3 into main Dec 7, 2022
@dantaik dantaik deleted the save_block_fix branch December 7, 2022 09:51
@github-actions github-actions bot mentioned this pull request Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants