Skip to content

Commit af7bb4d

Browse files
x3c41abkonturtomaka
authored
Added support for renew and index host function (#2189)
* added new host functions with no-op implementation * changed the order * Update lib/src/executor/host/functions.rs Co-authored-by: Branislav Kontur <bkontur@gmail.com> * changed the order * Update lib/src/executor/host/functions.rs Co-authored-by: Branislav Kontur <bkontur@gmail.com> * moved 2 new signatures to the end * Update lib/src/executor/host.rs * Update lib/src/executor/host.rs * Add CHANGELOG entry --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
1 parent 33d34fb commit af7bb4d

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

lib/src/executor/host.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,6 +2290,22 @@ impl ReadyToRun {
22902290
},
22912291
}
22922292
}
2293+
HostFunction::ext_transaction_index_index_version_1 => {
2294+
// TODO: this is currently a no-op; because not all the parameters are verified, this might lead to consensus issues
2295+
let _tx_ptr = expect_pointer_size_raw!(0);
2296+
HostVm::ReadyToRun(ReadyToRun {
2297+
inner: self.inner,
2298+
resume_value: None,
2299+
})
2300+
}
2301+
HostFunction::ext_transaction_index_renew_version_1 => {
2302+
// TODO: this is currently a no-op; because not all the parameters are verified, this might lead to consensus issues
2303+
let _tx_ptr = expect_pointer_size_raw!(0);
2304+
HostVm::ReadyToRun(ReadyToRun {
2305+
inner: self.inner,
2306+
resume_value: None,
2307+
})
2308+
}
22932309
}
22942310
}
22952311
}

lib/src/executor/host/functions.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ host_functions! {
156156
ext_logging_log_version_1,
157157
ext_logging_max_level_version_1,
158158
ext_panic_handler_abort_on_panic_version_1,
159+
ext_transaction_index_index_version_1,
160+
ext_transaction_index_renew_version_1,
159161
}
160162

161163
impl HostFunction {
@@ -456,6 +458,12 @@ impl HostFunction {
456458
HostFunction::ext_panic_handler_abort_on_panic_version_1 => {
457459
crate::signature!((vm::ValueType::I64) => ())
458460
}
461+
HostFunction::ext_transaction_index_index_version_1 => {
462+
crate::signature!((vm::ValueType::I32, vm::ValueType::I32, vm::ValueType::I32) => ())
463+
}
464+
HostFunction::ext_transaction_index_renew_version_1 => {
465+
crate::signature!((vm::ValueType::I32, vm::ValueType::I32) => ())
466+
}
459467
}
460468
}
461469
}

wasm-node/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Added
6+
7+
- Add support for the `ext_transaction_index_index_version_1` and `ext_transaction_index_renew_version_1` host functions as no-op. ([#2189](https://github.com/smol-dot/smoldot/pull/2189))
8+
59
## 2.0.39 - 2025-09-15
610

711
### Fixed

0 commit comments

Comments
 (0)