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

eth/downloader: fix rollback issue on short chains #21472

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Aug 21, 2020

In 8cbdc86#diff-c2fa15e758e986688c646459d8970a50R1501-R1504 , the rollback mechanism was changed, from beign a slice of hashes to being a number.
The change also cause a regression, if the number is smaller than fsHeaderSafetyNet, then the rollback will be 0, and the sethead won't happen. This causes some spurious test failures,

[user@work go-ethereum]$ go test ./eth/downloader/ -run InvalidHeaderRollback 
--- FAIL: TestInvalidHeaderRollback63Fast (2.39s)
    downloader_test.go:1047: rollback head mismatch: have 384, want at most 192
--- FAIL: TestInvalidHeaderRollback65Light (3.23s)
    downloader_test.go:1047: rollback head mismatch: have 960, want at most 192
FAIL
FAIL    github.com/ethereum/go-ethereum/eth/downloader  6.513s

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM

@karalabe karalabe added this to the 1.9.20 milestone Aug 21, 2020
@karalabe karalabe merged commit b68929c into ethereum:master Aug 21, 2020
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.

2 participants