Commit graph

7 commits

Author SHA1 Message Date
Manav Darji
1d1f00cbe7
eth: fix multiple checkpoint fetch logic (#465)
* fix: handle checkpoint ordering

* create checkpoint verifier, add unit tests

* fix: remove mutex

* address comment for default checkpoint verifier

Co-authored-by: Evgeny Danienko <6655321@bk.ru>
2022-08-11 16:00:33 +03:00
Manav Darji
c44693706a
RFC35/Common Ancestor: Modifying the forkchoice rule (#425)
* initial

* update

* fix: add validator to NewBlockchain function calls

* handle past chain reorg

* fix: only check with last checkpoint

* rm logs

* add: handle future chain import case

* fix: handle single block case

* add unit tests for past and future chain

* modularise forker tests

* minor fixes

* add: overlapping chain test case, minor fixes

* minor fixes

* add: isolated unit test for IsValidChain

* add more test case for IsValidChain

* fix: use index for header time

* add: fetch last N checkpoints in first run

* fix: change checkpoint count to int64

* fix: handle edge case

* fix: handle no checkpoint case separately

* fix: consider offset for future chain calculation

* re-write test case for split chain

* fix: typo

* add: split chain properties test

* separate reorg checks, validate chain before inserting

* fix: handle err incase of invalid chain

* fix: use error from whitelist service

* split chain property tests

* remove duplicate test cases

* cleanup

* clean up

* fix linters

* fix: fetch checkpoint count bug, add tests

* fix more linters

* fix: handle nil chain validator in downloader

* fix: mock bor tests

Co-authored-by: Evgeny Danienko <6655321@bk.ru>
2022-07-15 10:37:35 +05:30
Evgeny Danilenko
3c42bfc633
add context to Fetch* methods (#445)
* add context

* fix mocks

* fixes after CR

* fixes

* fix

* Linters
2022-07-13 09:07:32 +03:00
Manav Darji
8255d194ae minor fixes and enhancements 2022-06-02 16:34:46 +05:30
Evgeny Danienko
89fadee71e dont panic 2022-05-19 14:38:49 +03:00
Evgeny Danienko
fb46dd8cdf minor fixes 2022-05-19 10:23:34 +03:00
Manav Darji
cc7c5b3fd9 initial implementation for common ancestor approach 2022-05-02 16:57:02 +05:30