-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remaining fixes and cleanup from feature/in-memory-db
We were unable to finish these before open-sourcing. Fixes: - Update payload statuses of finalized blocks in Store::set_block_ancestor_payload_statuses. - Restrict Store::latest_archivable_index to valid blocks to prevent blocks from getting lost when archiving. Rely on the fix in Store::set_block_ancestor_payload_statuses to make binary search possible. The contents of Context.payload_statuses no longer have to be submitted before Context.extra_blocks. Snapshot tests pass either way, though some behavior is different behind the scenes. Submitting payload statuses afterwards prevents archiving, making all blocks remain in memory. - Revert unnecessary changes in grandine-snapshot-tests and http_api::context. Mainnet blocks do not have to be treated as valid. It made sense, but it was a workaround to prevent archived blocks from being lost. The bug in Store that caused that is now fixed. - Limit the Storage case of Controller::preprocessed_state_post_block to max_empty_slots. - Make in-memory mode apply to all databases. Some databases were always persistent due to a mistake during the rewrite to the enum-based design. There were 2 in runtime::run_after_genesis and 1 in grandine::Context::run. Cleanup: - Remove justified block check from Store::unload_old_states. Document why it's neither necessary nor sufficient. - Simplify and finish documenting test does_not_unload_states_that_may_become_anchors. Block 4 was unnecessary. The last block (previously block 6, now block 4) triggers unloading too. It must be at the start of an epoch because unloading is only done when the head is in that position. Block 2 was also unnecessary. The next block (previously block 3, now block 2) must be in epoch 2 or later to make its attestations count. This is not an obstacle in a real network. If block 2 is removed, block 1 can be moved into epoch 2 as well. No slots have to be empty in that case. - Move PayloadStatus from fork_choice_store::misc to types::nonstandard. The change was already made but reverted when feature/deneb3 was merged into integration. - Rename StoreConfig::minimal to aggressive and document it. The new name is unambiguous and fits better. StoreConfig::aggressive sets only one field to a non-default value and the value is not truly minimal. - Abandon idea to poison WaitGroup and revert partial implementation of it. Tests in fork_choice_control that make the mutator panic sometimes hang. The hanging makes it hard to tell if the tests failed and necessitates killing them manually. The poisoning was intended to make them reliably panic instead of hanging. Reimplementing WaitGroup to poison the mutex inside seemed to work at first, but it's still unreliable. - Remove pointless calls to Store::is_slot_finalized. - Remove Snapshot::state_before_or_at_slot. It was only called by the Controller method of the same name. - Replace Bytes in database with Arc<[u8]> and document why. - Use Connection::pragma_update for remaining pragmas. Documentation improvements: - Move comment about nomenclature to the root of fork_choice_store and define unloading in it. A glossary does not belong near Store::archive_finalized. That may have been the right place when the only distinction was between pruning and archiving. The doc comment for the crate is a better place for it. - Document SQLite's treatment of invalid values more accurately.
- Loading branch information
1 parent
cc27cd2
commit 47e697d
Showing
28 changed files
with
408 additions
and
414 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule eth2_libp2p
updated
4 files
+41 −39 | src/discovery/enr.rs | |
+9 −29 | src/discovery/mod.rs | |
+2 −2 | src/service/mod.rs | |
+7 −13 | src/service/utils.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.