Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client: use same Cache Setup for normal and executeBlocks-triggered Execution #3063

Merged
merged 9 commits into from
Sep 28, 2023

Conversation

holgerd77
Copy link
Member

@holgerd77 holgerd77 commented Sep 27, 2023

This PR aligns the cache setup for the client for "normal" execution along sync or standalone and re-execution with the --executeBlocks flag so that the StateManager and trie cache setups match the cache setup announced by client CLI, react on cache flag usage (especially trie cache) and generally allows for better cache behavior debugging (so that --executeBlocks "mimics" the normal execution behavior and not somewhat behaves differently).

Implementation is done by getting generally more flexible (with additional shallowCopy() method options), so that we but also users in general can choose if they want to have their shallow copy for rather short term or long term use.

For trie I additionally generally generalized the options take in by using an options dict which replaces the plain keyPrefix parameter (still possible since not yet released). Then we can eventually add other options too there.

Open for review. 🙂

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #3063 (4d48796) into master (6062850) will increase coverage by 1.07%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.78% <ø> (ø)
blockchain 92.61% <ø> (ø)
client 87.77% <100.00%> (?)
common 98.19% <100.00%> (ø)
ethash ∅ <ø> (∅)
evm 71.87% <ø> (ø)
rlp ∅ <ø> (∅)
statemanager 90.17% <100.00%> (+0.04%) ⬆️
trie 90.42% <100.00%> (+0.07%) ⬆️
tx 96.36% <ø> (?)
util 86.97% <ø> (ø)
vm 76.21% <100.00%> (?)

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

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

Small nits but looks great overall.

@holgerd77
Copy link
Member Author

@acolytec3 thanks for the review 🙏, ok, have updated!

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

Left a couple of more comments on the docs. Feel free to take or leave them.

One more general question, do we ever actually copy the cache values over? I don't see that option anywhere in the code and our docs seem to indicate it's possible to do a copy where the state of the cache is actually preserved.

@holgerd77
Copy link
Member Author

@acolytec3 ok, updated 🙂, ready for re-review!

Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

LGTM

@jochem-brouwer jochem-brouwer merged commit 0aaad28 into master Sep 28, 2023
@jochem-brouwer jochem-brouwer deleted the trie-more-generalized-shallow-copy-opts branch September 28, 2023 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants