Typeberry by Fluffy Labs - v0.4.0
    Preparing search index...

    Interface HostCallHandler

    An interface for a host call implementation

    interface HostCallHandler {
        basicGasCost:
            | number & WithBytesRepresentation<4> & pvm.WithOpaque<"SmallGas[U32]">
            | ((reg: pvm.HostCallRegisters) => Gas);
        currentServiceId: U32;
        index: number & WithBytesRepresentation<4> & pvm.WithOpaque<
            "HostCallIndex[U32]",
        >;
        tracedRegisters: (number & pvm.WithOpaque<"register index">)[];
        execute(
            gas: IGasCounter,
            regs: pvm.HostCallRegisters,
            memory: pvm.HostCallMemory,
        ): Promise<PvmExecution | undefined>;
    }
    Index

    Properties

    basicGasCost:
        | number & WithBytesRepresentation<4> & pvm.WithOpaque<"SmallGas[U32]">
        | ((reg: pvm.HostCallRegisters) => Gas)

    The gas cost of invocation of that host call.

    NOTE: ((reg: HostCallRegisters) => Gas) function is for compatibility reasons: pre GP 0.7.2

    currentServiceId: U32

    Currently executing service id.

    index: number & WithBytesRepresentation<4> & pvm.WithOpaque<
        "HostCallIndex[U32]",
    >

    Index of that host call (i.e. what PVM invokes via ecalli)

    tracedRegisters: (number & pvm.WithOpaque<"register index">)[]

    Input&Output registers that we should add to tracing log.

    Methods