-
Notifications
You must be signed in to change notification settings - Fork 316
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
feat: RUN-1038: Propagate execution mode (wasm64/32) to replica #1784
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in rs/test_utilities/state/src/lib.rs
LGTM
) | ||
} | ||
} | ||
|
||
impl ExecutionState { | ||
pub fn new_for_testing( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional simplification: Since we have a new_for_testing
function now, we could skip some of the arguments here and generate a default value in the function body. For some of these fields all the tests set them to some arbitrary value anyway. It definitely applies to canister_root
, but might also apply to some of the other fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Just left some style comments.
use ic_replicated_state::canister_state::execution_state::NextScheduledMethod; | ||
use ic_replicated_state::page_map::PageAllocatorFileDescriptor; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: merge the imports here and in other locations?
last_executed_round: ExecutionRound, | ||
next_scheduled_method: NextScheduledMethod, | ||
is_wasm64: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure we need to add the last_executed_round
and next_scheduled_method
arguments here? Maybe we could just default is_wasm64
to false
and keep the other arguments the same. Then we wouldn't need to introduce the for_testing
version and could remove some of the other changes in the PR.
When creating the execution state in wasm_executor.rs
we could mutate the field to get the correct value or just create this struct directly without using the new
method.
let mut test = if is_wasm64 { | ||
ExecutionTestBuilder::new().with_wasm64().build() | ||
} else { | ||
ExecutionTestBuilder::new().build() | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want the feature enabled even when testing the 32-bit memory, right? We want to show we properly detect 32-bit Wasms when the feature is enabled.
This PR adds functionality to make the replica aware of the Wasm32/Wasm64 execution mode of canisters. This will be used during the execution phase to track cycle consumption separately.
To have this, the canister execution state adds a
is_wasm64
flag. This flag is computed by the compiler sandbox the first time a canister is installed, or when it is upgraded.