Conversation
* 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
…ain into mrsmkl/long-repair
trianglesphere
left a comment
There was a problem hiding this comment.
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.
|
Looks like some test cases are quite flaky, I'll check if it's the same in the master. Example: |
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. |
trianglesphere
left a comment
There was a problem hiding this comment.
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.
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
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.
Description
Cherry-picked this:
ethereum/go-ethereum#21409
Other changes
Made some changes to get
SetHeadworking 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