mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 21:08:32 +00:00
Make eth1 caching work with fast synced node (#709)
* Add functions to get deposit_count and deposit_root from deposit cache
* Fetch deposit root and deposit count from cache
* Fix bugs
* Add test
* Compare deposit_count between the caching and http eth1 blocks
* Revert "Compare deposit_count between the caching and http eth1 blocks"
This reverts commit e3d0325ae6.
* Fetch deposit cache using binary search instead of linear search
* BlockCache waits till DepositCache is in sync
* Truncate required_blocks in block_cache upto latest_processed_block in deposit cache
* Clean up
* Handled getting deposit count before deploying deposit contract
* More cleanup
* Remove calls to http get deposit/count
* Fix block cache tests
* Minor changes
* Fix bootnode ports
* Address some of Paul's comments
* Optimize `get_deposit_root` by caching `DepositDataTree`
* Fix comments and minor changes
* Change eth1 default config parameters
* Use `Vec` instead of `HashMap` to store `deposit_roots`
* Minor renaming
This commit is contained in:
committed by
Paul Hauner
parent
251aea645c
commit
74b327b50d
@@ -8,6 +8,16 @@ pub struct DepositUpdater {
|
||||
pub last_processed_block: Option<u64>,
|
||||
}
|
||||
|
||||
impl DepositUpdater {
|
||||
pub fn new(deposit_contract_deploy_block: u64) -> Self {
|
||||
let cache = DepositCache::new(deposit_contract_deploy_block);
|
||||
DepositUpdater {
|
||||
cache,
|
||||
last_processed_block: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Inner {
|
||||
pub block_cache: RwLock<BlockCache>,
|
||||
|
||||
Reference in New Issue
Block a user