Skip to content

feat: add TreeState container type#5000

Merged
rakita merged 4 commits intomainfrom
matt/add-tree-state
Oct 12, 2023
Merged

feat: add TreeState container type#5000
rakita merged 4 commits intomainfrom
matt/add-tree-state

Conversation

@mattsse
Copy link
Collaborator

@mattsse mattsse commented Oct 12, 2023

this kicks off some improvements of the tree impl.

Ideally we want to get rid of the Arc<Lock<Tree>> and instead only lock when necessary.
this is only possible if we can isolate mutable access, this will eventually happen inside the TreeState.

To keep changes smol, this PR merely moves the mutable fields inside the new container type while keeping everything in place.

It will require a few more followups to push more logic inside the state

@mattsse mattsse added C-debt A clean up/refactor of existing code A-engine Related to the engine implementation labels Oct 12, 2023
@mattsse mattsse force-pushed the matt/add-tree-state branch from 8605d5a to 7b45714 Compare October 12, 2023 15:10
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #5000 (7b45714) into main (71ccd2a) will decrease coverage by 0.03%.
The diff coverage is 84.15%.

Impacted file tree graph

Files Coverage Δ
crates/blockchain-tree/src/state.rs 86.00% <86.00%> (ø)
crates/blockchain-tree/src/blockchain_tree.rs 84.15% <82.35%> (+0.15%) ⬆️

... and 6 files with indirect coverage changes

Flag Coverage Δ
integration-tests 15.85% <0.00%> (-0.02%) ⬇️
unit-tests 62.42% <84.15%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 30.61% <ø> (ø)
blockchain tree 80.81% <84.15%> (+0.17%) ⬆️
pipeline 88.37% <ø> (ø)
storage (db) 74.40% <ø> (ø)
trie 94.48% <ø> (ø)
txpool 48.20% <ø> (-0.48%) ⬇️
networking 76.45% <ø> (-0.02%) ⬇️
rpc 57.96% <ø> (+<0.01%) ⬆️
consensus 63.01% <ø> (ø)
revm 27.89% <ø> (ø)
payload builder 7.96% <ø> (ø)
primitives 86.32% <ø> (-0.01%) ⬇️

Copy link
Collaborator

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rakita rakita added this pull request to the merge queue Oct 12, 2023
Merged via the queue into main with commit 27a0a06 Oct 12, 2023
@rakita rakita deleted the matt/add-tree-state branch October 12, 2023 16:33
mattsse added a commit that referenced this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-engine Related to the engine implementation C-debt A clean up/refactor of existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants