MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / commit

Method commit

fendermint/vm/interpreter/src/fvm/state/exec.rs:309–312  ·  view source on GitHub ↗

Commit the state. It must not fail, but we're returning a result so that error handling can be done in the application root. For now this is not part of the `Interpreter` because it's not clear what atomic semantics we can hope to provide if the middlewares call each other: did it go all the way down, or did it stop somewhere? Easier to have one commit of the state as a whole.

(mut self)

Source from the content-addressed store, hash-verified

307 /// all the way down, or did it stop somewhere? Easier to have one commit of the state
308 /// as a whole.
309 pub fn commit(mut self) -> anyhow::Result<(Cid, FvmUpdatableParams, bool)> {
310 let cid = self.executor.flush()?;
311 Ok((cid, self.params, self.params_dirty))
312 }
313
314 /// Flush and return the current state root without consuming the execution state.
315 pub fn flush_state_root(&mut self) -> anyhow::Result<Cid> {

Callers 2

finalizeMethod · 0.45
init_genesisFunction · 0.45

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected