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

Let snapshots stores the load_reservation_address #407

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

mohanson
Copy link
Collaborator

No description provided.

xxuejie
xxuejie previously approved these changes Feb 28, 2024
Copy link
Collaborator

@xxuejie xxuejie left a comment

Choose a reason for hiding this comment

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

A test might be better here.

@mohanson mohanson merged commit a83a0cc into nervosnetwork:develop Feb 28, 2024
11 checks passed
@mohanson mohanson deleted the snapshot branch February 28, 2024 05:02
mohanson added a commit to libraries/ckb-vm that referenced this pull request Feb 28, 2024
mohanson added a commit that referenced this pull request Feb 28, 2024
* Backport #407

* Fix build error
mohanson added a commit that referenced this pull request Mar 14, 2024
* backport: Backport "Add alternative snapshot design. (#345)"

* feat: Add alternative snapshot design.

This change adds a different snapshot design, that takes advantage of
a newly defined trait named `DataSource`. DataSource is modeled after
environmental data that would stay the same and most likely immutable
for the entire duration of a CKB-VM program's lifecycle. An example
could be the enclosing transaction (`ResolvedTransaction` in CKB's
term) for CKB's smart contracts. No matter where and when we are
running the smart contract, the enclosing transaction is always the
same. By exploiting this property, we can reduce the size of a
snapshot greatly: when a piece of data already exist in the
DataSource, we won't need to store the same data in the snapshot. As
long as we maintain enough information to locate them from the
DataSource, the snapshot can successfully be used to resume the full
running state of a CKB-VM Machine.

* test: Ensure resumed VM has the same register and memory data

* fix: Skip full memory comparison in chaos tests

* Let snapshots stores the load_reservation_address

---------

Co-authored-by: Xuejie Xiao <xxuejie@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants