ligth sync: download difflayer#2
Merged
unclezoro merged 4 commits intounclezoro:light_syncfrom Sep 2, 2021
Merged
Conversation
1781a17 to
cbd10bf
Compare
unclezoro
reviewed
Sep 2, 2021
eth/downloader/downloader.go
Outdated
| } | ||
| } | ||
|
|
||
| func (d *Downloader) SetBodyFetchHook(hook func(SyncMode, string, []*types.Header)) { |
unclezoro
reviewed
Sep 2, 2021
eth/downloader/downloader.go
Outdated
| receiptFetchHook func([]*types.Header) // Method to call upon starting a receipt fetch | ||
| chainInsertHook func([]*fetchResult) // Method to call upon inserting a chain of blocks (possibly in multiple invocations) | ||
| syncInitHook func(uint64, uint64) // Method to call upon initiating a new sync run | ||
| bodyFetchHook func(SyncMode, string, []*types.Header) // Method to call upon starting a block body fetch |
Owner
There was a problem hiding this comment.
this will break a lot of testcase
unclezoro
reviewed
Sep 2, 2021
eth/peerset.go
Outdated
| closed bool | ||
| } | ||
|
|
||
| func DiffBodiesFetchOption(peers *peerSet) downloader.DownloadOption { |
Owner
There was a problem hiding this comment.
it is not good to defineDiffBodiesFetchOption in peerSet.go
unclezoro
reviewed
Sep 2, 2021
eth/peer.go
Outdated
| *eth.Peer | ||
| snapExt *snapPeer // Satellite `snap` connection | ||
| diffExt *diffPeer | ||
| DiffExt *diffPeer |
added 3 commits
September 2, 2021 19:58
Signed-off-by: kyrie-yl <lei.y@binance.com>
Signed-off-by: kyrie-yl <lei.y@binance.com>
Signed-off-by: kyrie-yl <lei.y@binance.com>
unclezoro
reviewed
Sep 2, 2021
eth/downloader/downloader.go
Outdated
| func DiffBodiesFetchOption(peers IPeerSet) DownloadOption { | ||
| return func(dl *Downloader) *Downloader { | ||
| var hook = func(headers []*types.Header, options ...interface{}) { | ||
| if len(options) < 2 { |
unclezoro
reviewed
Sep 2, 2021
eth/peerset.go
Outdated
|
|
||
| import ( | ||
| "errors" | ||
| "github.com/ethereum/go-ethereum/eth/downloader" |
Signed-off-by: kyrie-yl <lei.y@binance.com>
c91de18 to
cd49920
Compare
unclezoro
pushed a commit
that referenced
this pull request
Sep 2, 2021
* ligth sync: download difflayer Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: fix according to the comments Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: update Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: fix accroding comments Signed-off-by: kyrie-yl <lei.y@binance.com> Co-authored-by: kyrie-yl <lei.y@binance.com>
unclezoro
pushed a commit
that referenced
this pull request
Sep 7, 2021
* ligth sync: download difflayer Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: fix according to the comments Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: update Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: fix accroding comments Signed-off-by: kyrie-yl <lei.y@binance.com> Co-authored-by: kyrie-yl <lei.y@binance.com>
unclezoro
added a commit
that referenced
this pull request
Oct 12, 2021
* implement block process part of light sync * add difflayer protocol * handle difflayer and refine light processor * add testcase for diff protocol * make it faster * allow validator to light sync * change into diff sync * ligth sync: download difflayer (#2) * ligth sync: download difflayer Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: fix according to the comments Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: update Signed-off-by: kyrie-yl <lei.y@binance.com> * download diff layer: fix accroding comments Signed-off-by: kyrie-yl <lei.y@binance.com> Co-authored-by: kyrie-yl <lei.y@binance.com> * update light sync to diff sync * raise the max diff limit * add switcher of snap protocol * fix test case * make commit concurrently * remove peer for diff cache when peer closed * consensus tuning * add test code * remove extra message * fix testcase and lint make diff block configable wait code write fix testcase resolve comments resolve comment * resolve comments * resolve comments * resolve comment * fix mistake Co-authored-by: kyrie-yl <83150977+kyrie-yl@users.noreply.github.com> Co-authored-by: kyrie-yl <lei.y@binance.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: kyrie-yl lei.y@binance.com