feat: rework manager api for cross-major calls - #7
Conversation
📝 WalkthroughWalkthroughThe executor replaces local host-function declarations with shared interfaces. It adds host handshake and nested-run RPCs, propagates nested permissions and execution limits, supports cross-executor ChangesNested execution and host integration
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CallContract
participant Host
participant NestedExecutor
participant ReplyDecoder
CallContract->>Host: resolve_callcontract_executor
CallContract->>Host: run_nested envelope
Host->>NestedExecutor: execute nested envelope
NestedExecutor-->>Host: nested reply
Host-->>CallContract: NestedRunReply
CallContract->>ReplyDecoder: validate and decode reply
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2c26539 to
4bfbdcb
Compare
* feat(sdk): call contracts of another major through the host ✨ * refactor(rt): bound recursion with a budget minted by the chain root ♻️ * refactor(exe): carry nested execution state as one explicit group ♻️ * fix(exe): fold the callee's small hash on the nested route 🐛🔒️ * feat(exe): refuse a crossing call while custom runners are loaded ✨ * feat(host): write caller-supplied hello bytes and drop notify_finished ✨ * fix(supervisor): load precompiled modules only for registry runners 🔒️ * fix(sdk): stop exporting nondet permission across the boundary 🐛
4bfbdcb to
e3e1ffa
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
executor/src/exe/run.rs (1)
125-133: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueThe nested
WRITE_STORAGEcheck can never be true.
check_nested_permissionsat Line 127 rejectsWRITE_STORAGE. So thecontains(WRITE_STORAGE)test at Lines 128-130 always yieldsfalse. The two statements state opposite intents, which makes the nested storage-write rule hard to read.Replace the lookup with the explicit constant, or drop
WRITE_STORAGEfromcheck_nested_permissionsif a nested run may ever write.♻️ Proposed clarification
let can_write_storage = match &execution_data.nested { Some(nested) => { check_nested_permissions(nested.permissions)?; - nested - .permissions - .contains(genvm_modules_interfaces::NestedPermissions::WRITE_STORAGE) + // `check_nested_permissions` rejects WRITE_STORAGE, so a nested run + // never writes storage. + false } None => args.permissions.contains('w'), };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@executor/src/exe/run.rs` around lines 125 - 133, Resolve the contradiction in the nested permission flow around can_write_storage and check_nested_permissions: use an explicit false result for nested WRITE_STORAGE access if nested writes remain disallowed, removing the unreachable permissions.contains(WRITE_STORAGE) lookup; otherwise update check_nested_permissions to permit it only if nested runs are intended to write. Preserve the existing top-level args.permissions behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@executor/src/host/mod.rs`:
- Around line 768-774: Update HostManager::flush_all to attempt flush() on every
host even when one fails, recording the first error while continuing through the
remaining hosts; return that recorded error only after the loop completes, or
Ok(()) when all flushes succeed.
---
Nitpick comments:
In `@executor/src/exe/run.rs`:
- Around line 125-133: Resolve the contradiction in the nested permission flow
around can_write_storage and check_nested_permissions: use an explicit false
result for nested WRITE_STORAGE access if nested writes remain disallowed,
removing the unreachable permissions.contains(WRITE_STORAGE) lookup; otherwise
update check_nested_permissions to permit it only if nested runs are intended to
write. Preserve the existing top-level args.permissions behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7e1d02bf-d3b2-46af-88d5-3ab6a7ff553b
⛔ Files ignored due to path filters (210)
executor/Cargo.lockis excluded by!**/*.lock,!**/*.lockexecutor/crates/common/Cargo.lockis excluded by!**/*.lock,!**/*.lockexecutor/crates/modules-interfaces/Cargo.lockis excluded by!**/*.lock,!**/*.locktests/integration/stable/agentic/wasi/environ_args/environ_args.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/agentic/wasi/hash_random/hash_random.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/agentic/wasi/id_repr/id_repr.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/agentic/wasi/set_order/set_order.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/agentic/wasi/wasi_clock/wasi_clock.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/agentic/wasi/wasi_random/wasi_random.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/bench/read_tree_map.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/bench/read_tree_map.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/call_wasi_extra.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/disagree_in_sandbox.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/flt.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/fork_bomb.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/method_init.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/method_init.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/method_private.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/method_private.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/oom.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/rec.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/rec_1023.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/rec_1024.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/storage_rw_long.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/storage_rw_long.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/exploits/unreachable.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/leader_no_nondet.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/leader_no_nondet.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_leader.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_leader.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_valid_err_err.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_valid_err_err.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_valid_err_exit.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_valid_err_exit.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_valid_err_exit_wrong_err.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_valid_err_exit_wrong_err.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_valid_err_nerr.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/leader_errors/simple_valid_err_nerr.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/metod_det_get_webpage.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/metod_det_get_webpage.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/trivial.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/trivial.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/rollback_agree.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/rollback_agree.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/rollback_disagree.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/rollback_disagree.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/rollback_imm.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/rollback_imm.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/rollback_imm.1.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/rollback_imm.1_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/sync.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/sync.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/sync_err.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/nondet/validator/sync_err.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/balance.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/balance_eth.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/sandbox_overspend.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/sandbox_overspend_2.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_all.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_all.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_all.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_all.jsonnetis excluded by!tests/**tests/integration/stable/py/balances/undefined_method.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_method.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_method.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_method.jsonnetis excluded by!tests/**tests/integration/stable/py/balances/undefined_method_payable.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_method_payable.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_method_payable.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_method_payable.jsonnetis excluded by!tests/**tests/integration/stable/py/balances/undefined_receive.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_receive.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_receive.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/balances/undefined_receive.jsonnetis excluded by!tests/**tests/integration/stable/py/embeddings/simple.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/embeddings/simple.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/embeddings/simple_det.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/embeddings/simple_det.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/embeddings/simple_tokenizer.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/embeddings/simple_tokenizer.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/embeddings/vecdb.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/events/post_event.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/call_view.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/call_view.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/call_view.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/call_view.jsonnetis excluded by!tests/**tests/integration/stable/py/intercontract/call_view_iface.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/call_view_iface.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/call_view_iface.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/call_view_iface.jsonnetis excluded by!tests/**tests/integration/stable/py/intercontract/deploy.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/deploy_salt.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/send_message.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/send_message_eth.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/send_message_on.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/send_message_on.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/send_message_on.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/intercontract/send_message_on.jsonnetis excluded by!tests/**tests/integration/stable/py/other/meth/method_init.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_init_wrong_name.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_init_wrong_name.jsonnetis excluded by!tests/**tests/integration/stable/py/other/meth/method_public.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_public.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_retn.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_retn.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_retn_view.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_retn_view.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_rollback.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/meth/method_rollback.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.1.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.1_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.2.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.2_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.3.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.3_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.4.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.4_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.5.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.5_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.6.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.6_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.7.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.7_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.8.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.8_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.9.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/other/ret/returns.9_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/pitfalls/error_msg.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/pitfalls/error_msg.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/pitfalls/error_msg_overridden.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/pitfalls/error_msg_overridden.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/pitfalls/multi_contract.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/pitfalls/pub_ctor.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/pitfalls/store_proxy.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/rollbacks/call_view.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/rollbacks/call_view.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/rollbacks/call_view.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/rollbacks/call_view.jsonnetis excluded by!tests/**tests/integration/stable/py/rollbacks/nondet.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/rollbacks/simple.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/assign-json.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/assign-json.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/exit.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/exit.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/print.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/print.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/rollback.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/rollback.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/sandbox.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/s/sandbox.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/det/sandbox_write.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/non-det/s/assign-json.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/non-det/s/assign-json.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/non-det/s/exit.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/non-det/s/exit.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/non-det/s/print.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/non-det/s/print.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/non-det/s/rollback.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/sandbox/non-det/s/rollback.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/complex_types.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/complex_types.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/prim_types.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/prim_types.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/ret-float.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/ret-float.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/ret-tuple.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/ret-tuple.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/ret.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/ret.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/trivial.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/py/schemas/trivial.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/runners/dup-dependency.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/runners/env-template.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/runners/malformed_runner.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/runners/no_runner.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/runners/zip/no-zip.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/self-run/datetime.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/self-run/floats.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/self-run/formats.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/self-run/issue_163.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/self-run/module/np.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/self-run/module/pil.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/self-run/re.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/self-run/typing_is_ok.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/alloc_generic.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/alloc_generic_err.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/base.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/floats.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/gvm-89.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/gvm-89.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/default-frozen.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/default-frozen.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/default-frozen.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/default-frozen.jsonnetis excluded by!tests/**tests/integration/stable/storage/locking/modify_ctor.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/modify_ctor.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/modify_ctor.jsonnetis excluded by!tests/**tests/integration/stable/storage/locking/modify_later.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/modify_later.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/modify_later.0_0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/locking/modify_later.jsonnetis excluded by!tests/**tests/integration/stable/storage/np.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/persists.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/persists.0_0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/read_nondet.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/storage_tree_map.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/to_str.0.hashis excluded by!**/*.hash,!tests/**tests/integration/stable/storage/tree_map_nested.0.hashis excluded by!**/*.hash,!tests/**
📒 Files selected for processing (13)
executor/codegen/data/host-fns.jsonexecutor/crates/common/Cargo.tomlexecutor/crates/common/src/host_fns.rsexecutor/crates/common/src/lib.rsexecutor/crates/modules-interfaces/Cargo.tomlexecutor/src/exe/run.rsexecutor/src/host/mod.rsexecutor/src/lib.rsexecutor/src/rt/memlimiter.rsexecutor/src/rt/mod.rsexecutor/src/rt/supervisor/mod.rsexecutor/src/rt/vm/mod.rsexecutor/src/wasi/genlayer_sdk.rs
💤 Files with no reviewable changes (2)
- executor/codegen/data/host-fns.json
- executor/crates/common/src/host_fns.rs
|
|
||
| pub async fn flush_all(&self) -> Result<()> { | ||
| for host in &self.hosts { | ||
| host.lock().await.flush()?; | ||
| } | ||
| Ok(()) | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Flush every host before returning the first error.
flush_all returns as soon as one host's flush fails. Hosts later in self.hosts are never flushed after that point. If a host after the failing one still holds buffered writes, that data does not reach its destination before the process exits.
Iterate every host, collect any error, and continue. Return the first error only after every host has had a chance to flush.
🔧 Proposed fix to flush every host and report the first error
pub async fn flush_all(&self) -> Result<()> {
- for host in &self.hosts {
- host.lock().await.flush()?;
- }
- Ok(())
+ let mut first_err = None;
+ for host in &self.hosts {
+ if let Err(e) = host.lock().await.flush() {
+ if first_err.is_none() {
+ first_err = Some(e);
+ }
+ }
+ }
+ match first_err {
+ Some(e) => Err(e),
+ None => Ok(()),
+ }
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| pub async fn flush_all(&self) -> Result<()> { | |
| for host in &self.hosts { | |
| host.lock().await.flush()?; | |
| } | |
| Ok(()) | |
| } | |
| pub async fn flush_all(&self) -> Result<()> { | |
| let mut first_err = None; | |
| for host in &self.hosts { | |
| if let Err(e) = host.lock().await.flush() { | |
| if first_err.is_none() { | |
| first_err = Some(e); | |
| } | |
| } | |
| } | |
| match first_err { | |
| Some(e) => Err(e), | |
| None => Ok(()), | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@executor/src/host/mod.rs` around lines 768 - 774, Update
HostManager::flush_all to attempt flush() on every host even when one fails,
recording the first error while continuing through the remaining hosts; return
that recorded error only after the loop completes, or Ok(()) when all flushes
succeed.
Auto-opened executor mirror of genlayerlabs/genvm-manager#9.
Carries the executor-side work for that manager PR. Auto-closed as merged when the manager PR lands (its
pr/v0.2/feat/rework-manager-apibranch is moved ontov0.2-dev).Summary by CodeRabbit
New Features
Bug Fixes