Skip to content

Commit 15ef228

Browse files
authored
update smoldot (AcalaNetwork#755)
* update smoldot * add storageProofSize option * remove storageProofSize cli * fix: avoid param modification
1 parent dc55b39 commit 15ef228

File tree

5 files changed

+53
-38
lines changed

5 files changed

+53
-38
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "vendor/smoldot"]
22
path = vendor/smoldot
3-
url = https://github.com/ermalkaleci/smoldot.git
3+
url = https://github.com/smol-dot/smoldot.git

executor/Cargo.lock

+32-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

executor/src/task.rs

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pub struct TaskCall {
6767
mock_signature_host: bool,
6868
allow_unresolved_imports: bool,
6969
runtime_log_level: u32,
70+
storage_proof_size: u64,
7071
}
7172

7273
#[derive(Serialize, Deserialize, Debug)]
@@ -142,6 +143,8 @@ pub async fn run_task(task: TaskCall, js: crate::JsCallback) -> Result<TaskRespo
142143
storage_main_trie_changes,
143144
max_log_level: task.runtime_log_level,
144145
calculate_trie_changes: false,
146+
storage_proof_size_behavior:
147+
runtime_call::StorageProofSizeBehavior::ConstantReturnValue(task.storage_proof_size),
145148
});
146149

147150
let mut vm = match vm {

packages/core/src/wasm-executor/index.ts

+16-12
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ export type RuntimeVersion = {
2222
stateVersion: number
2323
}
2424

25+
export type TaskCall = {
26+
wasm: HexString
27+
calls: [string, HexString[]][]
28+
mockSignatureHost: boolean
29+
allowUnresolvedImports: boolean
30+
runtimeLogLevel: number
31+
storageProofSize?: number
32+
}
33+
2534
export type RuntimeLog = {
2635
message: string
2736
level?: number
@@ -113,19 +122,14 @@ export const createProof = async (nodes: HexString[], updates: [HexString, HexSt
113122
return { trieRootHash, nodes: newNodes }
114123
}
115124

116-
export const runTask = async (
117-
task: {
118-
wasm: HexString
119-
calls: [string, HexString[]][]
120-
mockSignatureHost: boolean
121-
allowUnresolvedImports: boolean
122-
runtimeLogLevel: number
123-
},
124-
callback: JsCallback = emptyTaskHandler,
125-
) => {
125+
export const runTask = async (task: TaskCall, callback: JsCallback = emptyTaskHandler) => {
126+
const task2 = {
127+
...task,
128+
storageProofSize: task.storageProofSize ?? 0,
129+
}
126130
const worker = await getWorker()
127-
logger.trace(truncate(task), 'taskRun')
128-
const response = await worker.remote.runTask(task, Comlink.proxy(callback))
131+
logger.trace(truncate(task2), 'taskRun')
132+
const response = await worker.remote.runTask(task2, Comlink.proxy(callback))
129133
if ('Call' in response) {
130134
logger.trace(truncate(response.Call), 'taskResponse')
131135
} else {

vendor/smoldot

Submodule smoldot updated 43 files

0 commit comments

Comments
 (0)