evmone icon indicating copy to clipboard operation
evmone copied to clipboard

Document precompiles support

Open chfast opened this issue 2 years ago • 3 comments

Add README section (or separate README file in evmone_precompiles) describing which precompile is supported and by what "backend" (e.g. pure EVM, EVMMAX, EVMMAX-C++, native, etc).

chfast avatar Jan 03 '24 13:01 chfast

Precompiles documentation would be useful.

@chfast is it possible to build the evmone shared library with precompiles enabled?

Are precompiles something that can be included in the library or do they need to be linked in separately?

bhartnett avatar Feb 19 '25 14:02 bhartnett

@bhartnett,

No, currently precompiles are not a part of the evmone shared library. Low level code is in the evmone::precompiles static library, but the high level code is in evmone::state in precompiles.cpp. This is quite a mess currently. But we can clean it up and make a part of the main library.

However, they won't be enabled for EVM execution because the EVMC API is not very good for this. So in the end, if you want to use EVMC you need to wire precompiles yourself, similarly as this is done in host.cpp.

I'm also slowly working on new API where this is all hidden and you can just execute a transaction. The API itself should also be simpler than EVMC and less "chatty".

chfast avatar Feb 20 '25 08:02 chfast

@bhartnett,

No, currently precompiles are not a part of the evmone shared library. Low level code is in the evmone::precompiles static library, but the high level code is in evmone::state in precompiles.cpp. This is quite a mess currently. But we can clean it up and make a part of the main library.

However, they won't be enabled for EVM execution because the EVMC API is not very good for this. So in the end, if you want to use EVMC you need to wire precompiles yourself, similarly as this is done in host.cpp.

I'm also slowly working on new API where this is all hidden and you can just execute a transaction. The API itself should also be simpler than EVMC and less "chatty".

I see, thanks. Good to know, actually after spending some time looking into it I've decided to wire in the precompiles myself in the EVMC host side.

Also, this new API you mentioned sounds interesting. Perhaps is something we can use in the future.

bhartnett avatar Feb 20 '25 11:02 bhartnett