Skip to content

Please expose the generic para 'EXT' of struct 'EthInterpreter' #3230

@benli5510

Description

@benli5510
pub struct EthInterpreter<EXT = (), MG = SharedMemory> {
    _phantom: core::marker::PhantomData<fn() -> (EXT, MG)>,
}

I want to use the EXT in EthInterpreter to extend the functionalities of the interpreter to do specific works, but in so many traits and implementations, it just use the struct EthInterpreter, to set the EXT to default value ().

for example,

impl<CTX, INSP, I, P> EvmTr for Evm<CTX, INSP, I, P, EthFrame<EthInterpreter>>
where
    CTX: ContextTr,
    I: InstructionProvider<Context = CTX, InterpreterTypes = EthInterpreter>,
    P: PrecompileProvider<CTX, Output = InterpreterResult>,
{

You can see, 'EthFrame>', users couldn't use their own EthInterpreter type with other value of EXT except ().

I hope this generic parameter EXT could be exposed, like

impl<CTX, INSP, I, P, EXT> EvmTr for Evm<CTX, INSP, I, P, EthFrame<EthInterpreter<EXT>>>
where
    CTX: ContextTr,
    I: InstructionProvider<Context = CTX, InterpreterTypes = EthInterpreter<EXT>>,
    P: PrecompileProvider<CTX, Output = InterpreterResult>,
{

Now I don't want to modify the SharedMemory, the exposition of generic para 'MG' is under your consideration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions