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

Add sync mode p2p CLI flag #2186

Merged
merged 7 commits into from
Sep 30, 2024

Conversation

weiihann
Copy link
Contributor

Changes

  • Add the p2p-sync-mode flag which supports either snap or full sync mode (default is full)
  • Added Downloader component
    • The previous implementation includes the baseSyncer in the snapSyncer
    • This is too much of a coupling as both syncing mechanisms are different
    • We eventually need a method to switch between snapSync and baseSync, so a Downloader controls this syncing mechanism
    • Referenced this design from go-ethereum
  • A couple of refactorings

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (pnowosie/snap-sync-p2p@0455bf0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
node/node.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             pnowosie/snap-sync-p2p    #2186   +/-   ##
=========================================================
  Coverage                          ?   76.24%           
=========================================================
  Files                             ?      103           
  Lines                             ?     9557           
  Branches                          ?        0           
=========================================================
  Hits                              ?     7287           
  Misses                            ?     1612           
  Partials                          ?      658           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@pnowosie pnowosie left a comment

Choose a reason for hiding this comment

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

✅ Great work!

cmd/juno/juno.go Outdated Show resolved Hide resolved
p2p/modes.go Outdated Show resolved Hide resolved
p2p/snap_syncer.go Outdated Show resolved Hide resolved
@pnowosie pnowosie mentioned this pull request Sep 30, 2024
16 tasks
@weiihann weiihann force-pushed the weiihann/snap-sync-p2p/main branch from 9f11d7e to 220d93f Compare September 30, 2024 11:30
@weiihann weiihann merged commit 61a20c7 into pnowosie/snap-sync-p2p Sep 30, 2024
3 of 4 checks passed
@weiihann weiihann deleted the weiihann/snap-sync-p2p/main branch September 30, 2024 11:31
weiihann added a commit that referenced this pull request Oct 25, 2024
* Add sync mode p2p CLI flag

* Return struct instead of interface

* Change flag usage string

* Remove SnapServer interface

* Revert makefile

* Minor fixes

* Update docs
weiihann added a commit that referenced this pull request Oct 28, 2024
* Add sync mode p2p CLI flag

* Return struct instead of interface

* Change flag usage string

* Remove SnapServer interface

* Revert makefile

* Minor fixes

* Update docs
pnowosie pushed a commit that referenced this pull request Nov 21, 2024
**This is a squash batch of 23 commits:**

- Ashraf Basic snap algo .. Did something + #1925
- p2p client and looking at the syncService
- finishing p2p handler - question
- protobuf changes
- snap server implements handler methods directly
- fix snap server tests after refactor
- refactor syncer to loop over iterator, add client message handling
- p2p complete - no data exchange
- Managed to sync ~200MB data
- Fix: Trie iteration
- test describing how storage of big contracts are responded
- Storage ranges - fix unexpected contract change
- Tweak message size params, trim logs
- limit memory usage & verification
- verification bug fix
- Add sync mode p2p CLI flag (#2186)
- Return struct instead of interface
- Change flag usage string
- Remove SnapServer interface
- Revert makefile
- Minor fixes
- Update docs
- Less logs, verification fixed
- code improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants