Skip to content

Move the actor logs into the trace #2097

@Stebalien

Description

@Stebalien

At the moment, when actor debugging is enabled logs are written to stdout. Instead, we should record them in the execution trace inside of the call manager. I.e., each log becomes an ExecutionEvent:

pub enum ExecutionEvent {
GasCharge(GasCharge),
/// Emitted on each send call regardless whether we actually end up invoking the
/// actor or not (e.g. if we don't have enough gas or if the actor does not exist)
Call {
from: ActorID,
to: Address,
method: MethodNum,
params: Option<IpldBlock>,
value: TokenAmount,
gas_limit: u64,
read_only: bool,
},
CallReturn(ExitCode, Option<IpldBlock>),
CallError(SyscallError),
/// Emitted every time an actor is successfully invoked.
InvokeActor {
id: ActorID,
state: ActorState,
},

If we do this, it should become much easier to debug actors from clients. Instead of having to:

  1. Restart the client with some env var enabled.
  2. Read stdout/stderr.

We can invoke the FVM with debug tracing enabled and return the serialized logs over RPC.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions