Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untangle the Interpreter type mess #1241

Open
raulk opened this issue Dec 23, 2024 · 0 comments
Open

Untangle the Interpreter type mess #1241

raulk opened this issue Dec 23, 2024 · 0 comments

Comments

@raulk
Copy link
Contributor

raulk commented Dec 23, 2024

We have to untangle the nested Interpreter design ASAP -- it is extremely unergonomic, rigid (despite generic abuse), and poorly designed. I just want to add a simple check that rejects a message if the gas fee cap is below the minimal base fee (held in state). I could check this at the FvmMessageInterpreter, because its CheckInterpreter implementation has access to FvmExecState, but it requires me to return an ExitCode, which I can't because no FVM execution is actually needed.

ChainMessageInterpreter seems like the correct nested interpreter to add this to, but it does not have access to state in its trait implementation because it inherits the generic from its inner interpreter (State == I::State), which is kinda ironic because that type is actually only ever FvmExecState in practice.

At the end of the day, what we have here is an overly generic design with, laughably, zero degrees of freedom because all interpreters are tightly coupled to one another as a result of their trait bounds restricting the associated types that the "next" interpreter must use (e.g. CheckInterpreter for SignedMessageInterpreter can only ever have an inner interpreter that uses FvmMessage as the Message type and FvmCheckRet as the Output type, which today is only FvmMessageInterpreter, and this is so restrictive, that it can never be anything else, really).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant