2f456ff9eb
## Issue Addressed Fix a bug introduced by #3696. The bug is not expected to occur frequently, so releasing this PR is non-urgent. ## Proposed Changes * Add a variant to `StoreOp` that allows a raw KV operation to be passed around. * Return to using `self.store.do_atomically` rather than `self.store.hot_db.do_atomically`. This streamlines the write back into a single call and makes our auto-revert work again. * Prevent `import_block_update_shuffling_cache` from failing block import. This is an outstanding bug from before v3.4.0 which may have contributed to some random unexplained database corruption. ## Additional Info In #3696 I split the database write into two calls, one to convert the `StoreOp`s to `KeyValueStoreOp`s and one to write them. This had the unfortunate side-effect of damaging our atomicity guarantees in case of a write error. If the first call failed, we would be left with the block in fork choice but not on-disk (or the snapshot cache), which would prevent us from processing any descendant blocks. On `unstable` the first call is very unlikely to fail unless the disk is full, but on `tree-states` the conversion is more involved and a user reported database corruption after it failed in a way that should have been recoverable. Additionally, as @emhane observed, #3696 also inadvertently removed the import of the new block into the block cache. Although this seems like it could have negatively impacted performance, there are several mitigating factors: - For regular block processing we should almost always load the parent block (and state) from the snapshot cache. - We often load blinded blocks, which bypass the block cache anyway. - Metrics show no noticeable increase in the block cache miss rate with v3.4.0. However, I expect the block cache _will_ be useful again in `tree-states`, so it is restored to use by this PR. |
||
---|---|---|
.. | ||
attestation_verification | ||
schema_change | ||
attestation_rewards.rs | ||
attestation_verification.rs | ||
attester_cache.rs | ||
beacon_block_reward.rs | ||
beacon_chain.rs | ||
beacon_fork_choice_store.rs | ||
beacon_proposer_cache.rs | ||
beacon_snapshot.rs | ||
block_reward.rs | ||
block_times_cache.rs | ||
block_verification.rs | ||
builder.rs | ||
canonical_head.rs | ||
chain_config.rs | ||
early_attester_cache.rs | ||
errors.rs | ||
eth1_chain.rs | ||
eth1_finalization_cache.rs | ||
events.rs | ||
execution_payload.rs | ||
fork_choice_signal.rs | ||
fork_revert.rs | ||
head_tracker.rs | ||
historical_blocks.rs | ||
lib.rs | ||
light_client_finality_update_verification.rs | ||
light_client_optimistic_update_verification.rs | ||
merge_readiness.rs | ||
metrics.rs | ||
migrate.rs | ||
naive_aggregation_pool.rs | ||
observed_aggregates.rs | ||
observed_attesters.rs | ||
observed_block_producers.rs | ||
observed_operations.rs | ||
otb_verification_service.rs | ||
persisted_beacon_chain.rs | ||
persisted_fork_choice.rs | ||
pre_finalization_cache.rs | ||
proposer_prep_service.rs | ||
schema_change.rs | ||
shuffling_cache.rs | ||
snapshot_cache.rs | ||
state_advance_timer.rs | ||
sync_committee_rewards.rs | ||
sync_committee_verification.rs | ||
test_utils.rs | ||
timeout_rw_lock.rs | ||
validator_monitor.rs | ||
validator_pubkey_cache.rs |