Skip to content

Commit

Permalink
Add some comment
Browse files Browse the repository at this point in the history
  • Loading branch information
iamyulong committed Oct 25, 2024
1 parent cd5999b commit 659229d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion radix-engine-tests/tests/vm/wasm_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use radix_engine_tests::common::PackageLoader;
use scrypto_test::prelude::*;

#[test]
fn test_crate_buffers_within_limits() {
fn test_create_buffers_within_limits() {
// Arrange
let mut ledger = LedgerSimulatorBuilder::new().build();
let package = ledger.publish_package_simple(PackageLoader::get("wasm_limits"));
Expand Down
3 changes: 3 additions & 0 deletions radix-engine/src/vm/wasm_runtime/scrypto_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ impl<'y, Y: SystemApi<RuntimeError>> WasmRuntime for ScryptoRuntime<'y, Y> {

let max_number_of_buffers = match self.scrypto_vm_version {
ScryptoVmVersion::V1_0 | ScryptoVmVersion::V1_1 => 32,
// Practically speaking, there is little gain of keeping multiple buffers open before
// [multi-value](https://github.com/WebAssembly/multi-value/blob/master/proposals/multi-value/Overview.md) is supported and used.
// We reduce it to `4` so that the amount of memory that a transaction can consume is reduced, which is beneficial for parallel execution.
ScryptoVmVersion::V1_2 => 4,
};
if self.buffers.len() >= max_number_of_buffers {
Expand Down

0 comments on commit 659229d

Please sign in to comment.