Skip to content

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

Merged
karalabe merged 1 commit into
ethereum:masterfrom
holiman:fix_dltest_fail
Aug 21, 2020
Merged

eth/downloader: fix rollback issue on short chains#21472
karalabe merged 1 commit into
ethereum:masterfrom
holiman:fix_dltest_fail

Conversation

@holiman
Copy link
Copy Markdown
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
Copy Markdown
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