Skip to content

(feat): re-enable snap sync#2077

Merged
manav2401 merged 16 commits intodevelopfrom
re-enable-snap-sync
Mar 2, 2026
Merged

(feat): re-enable snap sync#2077
manav2401 merged 16 commits intodevelopfrom
re-enable-snap-sync

Conversation

@manav2401
Copy link
Copy Markdown
Member

Description

This PR re-enables snap sync in bor and does the following changes.

  • Remove changes which would force bor to use full sync
  • Allow --syncmode=snap flag to be set
  • Adds a filter in downloader which would avoid syncing receipts from eth/68 peers as bor receipts are only served in eth/69.
  • Adds a test to validate the same.
  • Uncomment all snap sync related tests which were skipped earlier

A small refactor is being done to add a kind() method in all downloader queues to make comparison easy instead of using reflect.TypeOf in every iteration.

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.17%. Comparing base (46e2631) to head (6659f27).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
eth/sync.go 23.52% 10 Missing and 3 partials ⚠️
eth/handler.go 12.50% 5 Missing and 2 partials ⚠️
eth/downloader/bor_fetchers_concurrent.go 78.57% 2 Missing and 1 partial ⚠️
...th/downloader/bor_fetchers_concurrent_witnesses.go 0.00% 1 Missing ⚠️
internal/cli/server/config.go 50.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2077      +/-   ##
===========================================
+ Coverage    50.87%   51.17%   +0.29%     
===========================================
  Files          878      878              
  Lines       152469   152499      +30     
===========================================
+ Hits         77564    78035     +471     
+ Misses       69809    69357     -452     
- Partials      5096     5107      +11     
Files with missing lines Coverage Δ
eth/downloader/bor_fetchers_concurrent_bodies.go 76.74% <100.00%> (+0.55%) ⬆️
eth/downloader/bor_fetchers_concurrent_headers.go 72.22% <100.00%> (+0.79%) ⬆️
eth/downloader/bor_fetchers_concurrent_receipts.go 70.83% <100.00%> (+62.32%) ⬆️
eth/protocols/eth/handlers.go 49.55% <100.00%> (-0.10%) ⬇️
internal/cli/server/flags.go 100.00% <100.00%> (ø)
...th/downloader/bor_fetchers_concurrent_witnesses.go 0.00% <0.00%> (ø)
internal/cli/server/config.go 63.77% <50.00%> (+0.05%) ⬆️
eth/downloader/bor_fetchers_concurrent.go 53.59% <78.57%> (+3.08%) ⬆️
eth/handler.go 63.47% <12.50%> (-0.60%) ⬇️
eth/sync.go 47.56% <23.52%> (+2.99%) ⬆️

... and 28 files with indirect coverage changes

Files with missing lines Coverage Δ
eth/downloader/bor_fetchers_concurrent_bodies.go 76.74% <100.00%> (+0.55%) ⬆️
eth/downloader/bor_fetchers_concurrent_headers.go 72.22% <100.00%> (+0.79%) ⬆️
eth/downloader/bor_fetchers_concurrent_receipts.go 70.83% <100.00%> (+62.32%) ⬆️
eth/protocols/eth/handlers.go 49.55% <100.00%> (-0.10%) ⬇️
internal/cli/server/flags.go 100.00% <100.00%> (ø)
...th/downloader/bor_fetchers_concurrent_witnesses.go 0.00% <0.00%> (ø)
internal/cli/server/config.go 63.77% <50.00%> (+0.05%) ⬆️
eth/downloader/bor_fetchers_concurrent.go 53.59% <78.57%> (+3.08%) ⬆️
eth/handler.go 63.47% <12.50%> (-0.60%) ⬇️
eth/sync.go 47.56% <23.52%> (+2.99%) ⬆️

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cffls
Copy link
Copy Markdown
Contributor

cffls commented Feb 23, 2026

Looks good! Would be great if you can add a node with snap sync mode enabled to e2e and verify basic things in the test.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

@lucca30 lucca30 left a comment

Choose a reason for hiding this comment

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

lgtm

@manav2401 manav2401 merged commit 5f5ec38 into develop Mar 2, 2026
19 of 20 checks passed
@manav2401 manav2401 deleted the re-enable-snap-sync branch March 2, 2026 13:55
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