-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a LayoutResolver to compute layout from VM types
- Move expensive_check_sui_conservation to node init - Expose a layout resolver based on a VM session - Decouple MoveResolver traits from Storage traits In some of the places where we want to use the layout resolver, we don't have access to all the information to implement `StorageView`, but we only need to use the `BackingPackageStore`. To support these cases, we need to provide a state view to `LinkageView` that can serve packages, and then shim the Module and Resource resolution functions. This requires that `LinkageView` no longer accept a reference parameter, but a value (so we can inject state into it) -- similar to the trick we pulled to allow `Session` to own a `LinkageView`. Then implementors (like `TemporaryStore`) that only need to be passed by reference can be passed by explicit reference, i.e. `LinkageView<'state, TemporaryStore>` becomes `LinkageView<&'state TemporaryStore>`. However, we cannot impose a `&'state S: StorageView` bound, because some APIs in `StorageView` require a mutable reference, so we needed to decouple the resolution traits (now `SuiResolver`) and the storage traits, to impose twin constraints: ``` fn ...<'state, S> where S: StorageView &'state S: SuiResolver ``` - Logging improvements - Bring `invariant_violation!` macro into `sui-types`. - Create a variant of it -- `make_invariant_violation!` -- that creates the error, but does not wrap it in a result of return it. - Add `format!` string support to these macros - Use this macro for invariant violations within conservation checking with extra context on what is failing (what stage, what type is involved) - Enable telemetry_subscription in the `move_package_upgrade_tests` to see the logs from authorities during tests. - (Temporary) Print the IDs of published/upgraded packages in the failing test, for context.
- Loading branch information
1 parent
3f576a0
commit 70e6a5a
Showing
34 changed files
with
1,166 additions
and
369 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
macro_rules! invariant_violation { | ||
($msg:expr) => {{ | ||
if cfg!(debug_assertions) { | ||
panic!("{}", $msg) | ||
} | ||
return Err(sui_types::error::ExecutionError::invariant_violation($msg).into()); | ||
}}; | ||
} | ||
|
||
macro_rules! assert_invariant { | ||
($cond:expr, $msg:expr) => {{ | ||
if !$cond { | ||
invariant_violation!($msg) | ||
} | ||
}}; | ||
} | ||
#[macro_use] | ||
extern crate sui_types; | ||
|
||
pub mod adapter; | ||
pub mod error; | ||
pub mod execution_engine; | ||
pub mod execution_mode; | ||
pub mod programmable_transactions; | ||
pub mod type_layout_resolver; |
Oops, something went wrong.