-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[loader] Global caches for execution #15192
Merged
Merged
Conversation
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
⏱️ 23h 36m total CI duration on this PR
|
This was referenced Nov 5, 2024
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @georgemitenkov and the rest of your teammates on Graphite |
22 tasks
georgemitenkov
changed the title
[refactoring] Move explicit sync wrapper to aptos-types
[loader] Global caches for execution
Nov 5, 2024
georgemitenkov
added
CICD:run-execution-performance-test
Run execution performance test
CICD:run-execution-performance-full-test
Run execution performance test (full version)
labels
Nov 5, 2024
georgemitenkov
force-pushed
the
george/parent-block-checks
branch
3 times, most recently
from
November 6, 2024 09:05
6ab79b7
to
813cb54
Compare
22 tasks
georgemitenkov
requested review from
msmouse,
lightmark,
grao1991,
gelash,
zekun000,
sasha8,
danielxiangzl,
davidiw,
wrwg and
vgao1996
as code owners
November 6, 2024 09:19
georgemitenkov
removed request for
davidiw,
lightmark,
sasha8,
vgao1996,
wrwg and
danielxiangzl
November 6, 2024 09:19
- Fixed a bug where on successful marking as executing we were re-creating environment - Removed optional manager in BlockAptosVM, instead a new instance can be provided - Removed clean state, instead manager is initialized to Done(None) and optional values need to be provided.
…ash values throughout
georgemitenkov
force-pushed
the
george/parent-block-checks
branch
from
November 13, 2024 22:54
1a54836
to
4f1b9f9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CICD:run-e2e-tests
when this label is present github actions will run all land-blocking e2e tests from the PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors code caching logic (both L1 and L2) in block executor (Block-STM), and implements a code cache manager for global (L2) caches. Also small cleanups of code around (see below).
Detailed list of changes:
Introduced test-only
MockStateView
inaptos-types
that can be re-used across tests. Hence, there are some additional changes aroundMockVM
and some unit tests.Introduced test-only
MockExtension
inmove-vm-types
to mock extension stored in cached entries. This is better than()
because we can search it by name and implement trait bounds for it in the future.Split
WithBytes
trait intoWithSize
andWithBytes
so that we can query size and bytes separately. This allows us to mock sized entries in global module cache, to test things easily.Removed version from
ModuleCode
, and instead introducedVersionedModuleCode
that has the version. This allows to store versioned code in Block-STM caches, but use non-versioned variant in global caches. For storage, a "default" version is used, that perfectly aligns withOption<TxnIndex>
. As a result, had to changeSync/UnsyncModuleCache
APIs, tests, etc.Renamed
ImmutableModuleCache
toGlobalModuleCache
for clarity. Removed ugly versioning from there. Added size tracking (in bytes) for serialised modules.Implemented Aptos framework prefetching in case the global module caches are empty.
Introduced
BlockExecutorModuleCacheLocalConfig
inaptos-types
which is stored inBlockExecutorLocalConfig
and stores info about module caches. Added a few default constructors to make code cleaner and less verbose, also in some other places. This way, any module caching logic can be based on this config.Introduced a
GlobalModuleCacheManager
struct which is stored inAptosVMBlockExecutor
and contains global module cache + environment. can be inREADY
,EXECUTING
andDONE
states. Users can perform state transitions.BlockAptosVM
now takes additional optionalGlobalModuleCacheManager
. If not set, empty caches are used.BlockAptosVM
transitions the manager fromREADY
toEXECUTING
state for block execution, and fromEXECUTING
toDONE
when finished.DONE
toREADY
is added to the actual block executor.(NEW) Propagated parent/current block hashes throughout and down to
execute_block
APIs. We can clean up a bit later to avoid uglyNone
s.How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist