How can I instrument the EVM bytecode for runtime monitoring? Is there any technique or implementation for that?
1 Answer
I think what you're looking for is something that will create an intermediate representation (IR) between Solidity and EVM bytecode, and which will act as a high-level assembly equivalent which you can instrument, rather than instrumenting the EVM bytecode itself. (There are a few common tools for doing this in the wider world, such as LLVM which is used in C instrumentation.)
I'm not sure what is commonly used in the Ethereum ecosystem, but there are several papers detailing techniques. See, for example: SIF: A Framework for Solidity Contract Instrumentation and Analysis
Edit:
Actually it looks like a tool called Zeus will now create LLVM bitcode from Solidity, so that might be a place to start.
-
That is really helpful and similar to the work done in C. But, what if I want to instrument the bytecode itself, something like binary or bytecode instrumentation in C? Is there any tool for that? @Richard Horrocks– MARiiiiFeb 11, 2021 at 4:33
monitoring