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

Chain repair fixes #1163

Merged
merged 16 commits into from
Oct 15, 2020
Merged

Chain repair fixes #1163

merged 16 commits into from
Oct 15, 2020

Conversation

mrsmkl
Copy link
Contributor

@mrsmkl mrsmkl commented Sep 21, 2020

Description

Cherry-picked this:
ethereum/go-ethereum#21409

Other changes

Made some changes to get SetHead working in lightest mode. Also doesn't start bloom indexer in lightest mode.

Tested

Did some sync tests in addition to new unit tests.

Related issues

Backwards compatibility

karalabe and others added 7 commits September 14, 2020 14:01
* core: define and test chain reparation cornercases

* core: write up a variety of set-head tests

* core, eth: unify chain rollbacks, handle all the cases

* core: make linter smile

* core: remove commented out legacy code

* core, eth/downloader: fix review comments

* core: revert a removed recovery mechanism
Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

There's a couple small changes, and then the larger question of what to do with the tests. As noted, I think that removing tests with a side chain that's longer than the canonical chain could be valid, but I'd like more a little more though on that.

Once tests are figured out I think that this PR is good to go. It syncs with main net just fine in several modes.

consensus/istanbul/backend/engine.go Outdated Show resolved Hide resolved
p2p/discv5/node_test.go Outdated Show resolved Hide resolved
core/blockchain_sethead_test.go Show resolved Hide resolved
Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

LGTM

@mrsmkl
Copy link
Contributor Author

mrsmkl commented Oct 14, 2020

Looks like some test cases are quite flaky, I'll check if it's the same in the master. Example:

--- FAIL: TestInvalidHeaderRollback65Light (4.94s)
    downloader_test.go:961: rollback head mismatch: have 1920, want at most 192

@trianglesphere
Copy link
Contributor

Looks like some test cases are quite flaky, I'll check if it's the same in the master. Example:

--- FAIL: TestInvalidHeaderRollback65Light (4.94s)
    downloader_test.go:961: rollback head mismatch: have 1920, want at most 192

Unfortunately this seems to be a new flaky test. On my machine I don't find them to be that flaky, but I don't love adding new flaky tests.

Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

Change look good. One interesting thing that upstream has started to introduce is wrapped errors which might be good to introduce to the parts we've added.

@mrsmkl mrsmkl merged commit bc2dce4 into master Oct 15, 2020
@mrsmkl mrsmkl deleted the mrsmkl/long-repair branch October 15, 2020 22:55
oneeman pushed a commit that referenced this pull request Nov 25, 2020
Note: These changes overwrote the changes in eth/sync.go which we had made in #1163 (which were an adapted cherry-pick of a later chain repair commit from upstream).  In the next commit I will apply the corresponding changes changes from the upstream chain repair commit, which are now directly applicable without having to be tweaked.

Conflicts:
	eth/backend.go
	eth/handler.go
	eth/sync.go
oneeman pushed a commit that referenced this pull request Nov 25, 2020
For #1163, these changes had to be adapted because we had an older version of the `eth/sync.go`.  The commit before this one merged in the upstream changes that were missing, and which overwrote the adapted chain repair fix changes.  So this commit reapplies those changes from the upstream chain repair fix commit, since they now apply as is without any issues.
@oneeman oneeman mentioned this pull request Dec 2, 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.

gap (#2151176) in the chain between ancients and leveldb
4 participants