-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathton.patch
65 lines (60 loc) · 2.95 KB
/
ton.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From 5217414301d71fcd40363332d9d3a1defd2020a8 Mon Sep 17 00:00:00 2001
From: Steve Korshakov <korshakov.stepan@gmail.com>
Date: Fri, 14 Apr 2023 13:30:49 +0100
Subject: [PATCH 1/2] Avoid dumping stack for verbosity == 2, increase log max
size
---
crypto/block/transaction.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/crypto/block/transaction.cpp b/crypto/block/transaction.cpp
index fcabf0c09..fc481032a 100644
--- a/crypto/block/transaction.cpp
+++ b/crypto/block/transaction.cpp
@@ -1067,14 +1067,17 @@ bool Transaction::prepare_compute_phase(const ComputePhaseConfig& cfg) {
std::unique_ptr<StringLoggerTail> logger;
auto vm_log = vm::VmLog();
if (cfg.with_vm_log) {
- size_t log_max_size = cfg.vm_log_verbosity > 0 ? 1024 * 1024 : 256;
+ size_t log_max_size = cfg.vm_log_verbosity > 0 ? 1024 * 1024 * 1024 : 256;
logger = std::make_unique<StringLoggerTail>(log_max_size);
vm_log.log_interface = logger.get();
vm_log.log_options = td::LogOptions(VERBOSITY_NAME(DEBUG), true, false);
if (cfg.vm_log_verbosity > 1) {
vm_log.log_mask |= vm::VmLog::ExecLocation;
if (cfg.vm_log_verbosity > 2) {
- vm_log.log_mask |= vm::VmLog::DumpStack | vm::VmLog::GasRemaining;
+ vm_log.log_mask |= vm::VmLog::GasRemaining;
+ if (cfg.vm_log_verbosity > 3) {
+ // vm_log.log_mask |= vm::VmLog::DumpStack;
+ }
}
}
}
From e9b87e00c2959b6968156213aa39c484a6c9b4f1 Mon Sep 17 00:00:00 2001
From: Steve Korshakov <korshakov.stepan@gmail.com>
Date: Fri, 14 Apr 2023 13:55:40 +0100
Subject: [PATCH 2/2] Improve emulator performance and allow memory growth
---
emulator/CMakeLists.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/emulator/CMakeLists.txt b/emulator/CMakeLists.txt
index 4e67d32cc..d5ef3dfb9 100644
--- a/emulator/CMakeLists.txt
+++ b/emulator/CMakeLists.txt
@@ -44,13 +44,15 @@ if (USE_EMSCRIPTEN)
target_link_options(emulator-emscripten PRIVATE -sEXPORTED_FUNCTIONS=_emulate,_free,_run_get_method)
target_link_options(emulator-emscripten PRIVATE -sEXPORT_NAME=EmulatorModule)
target_link_options(emulator-emscripten PRIVATE -sERROR_ON_UNDEFINED_SYMBOLS=0)
- target_link_options(emulator-emscripten PRIVATE -Oz)
+ target_link_options(emulator-emscripten PRIVATE -O3)
target_link_options(emulator-emscripten PRIVATE -sIGNORE_MISSING_MAIN=1)
target_link_options(emulator-emscripten PRIVATE -sAUTO_NATIVE_LIBRARIES=0)
target_link_options(emulator-emscripten PRIVATE -sMODULARIZE=1)
target_link_options(emulator-emscripten PRIVATE -sENVIRONMENT=web)
target_link_options(emulator-emscripten PRIVATE -sFILESYSTEM=0)
target_link_options(emulator-emscripten PRIVATE -fexceptions)
+ target_link_options(emulator-emscripten PRIVATE -sALLOW_MEMORY_GROWTH=1)
+ target_link_options(emulator-emscripten PRIVATE -sALLOW_TABLE_GROWTH=1)
if (USE_EMSCRIPTEN_NO_WASM)
target_link_options(emulator-emscripten PRIVATE -sWASM=0)
endif()