feat(sync): state transition indexes (#449)

* introduce state transitions and revert/modify block bodies table

* init refactor

* revamp transaction iteration based on bodies and add state transition mappings

* change expected return on empty db execution

* interim commit

* fix body downloader & stage

* refactor(bodies/dl): make fetch bodies fn more clear

* chore: disable unused vars/fns temporarily until exec is back

* chore: fmt

* test: fix tests

* use transitions in execution stage

* clarify empty unwind test

* remove last_tx_index fn

* rename fn and var names

* fix full block response comment

* rename fetcher`s get_block_body to get_block_bodies

* Update crates/stages/src/db.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* fmt

* fix index overlap check error

* uncomment eth chain command

* fix doc comment

* typos

* cleanup

* any_last_tx_index -> last_tx_index

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
This commit is contained in:
Roman Krasiuk
2022-12-16 18:37:49 +02:00
committed by GitHub
parent 345b2c35b9
commit daaf039fbf
27 changed files with 658 additions and 575 deletions

View File

@ -64,7 +64,7 @@ async fn test_get_body() {
mock_provider.add_block(block_hash, block.clone());
let res = fetch0.get_block_body(vec![block_hash]).await;
let res = fetch0.get_block_bodies(vec![block_hash]).await;
assert!(res.is_ok());
let blocks = res.unwrap().1;