-
Notifications
You must be signed in to change notification settings - Fork 129
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
Build nimbus evmc shared library and fix issue to enable loading #3050
base: master
Are you sure you want to change the base?
Conversation
@@ -14,9 +14,9 @@ import | |||
evmc/evmc, ../config | |||
|
|||
# The built-in Nimbus EVM, via imported C function. | |||
proc evmc_create_nimbus_evm(): ptr evmc_vm {.cdecl, importc, raises: [], gcsafe.} | |||
proc evmc_create_nimbusevm(): ptr evmc_vm {.cdecl, importc, raises: [], gcsafe.} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to enabled loading by the evmc-vmtester tool.
nimbus/transaction/evmc_vm_glue.nim
Outdated
vm[].destroy = evmcDestroy | ||
vm[].execute = evmcExecute | ||
vm[].get_capabilities = evmcGetCapabilities | ||
vm[].set_option = evmcSetOption |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using manual memory alloc and dealloc to fix segfault caused by using ref in shared library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc accessing field of a ptr object no need to use []
deref. Nim automatically produce correct code, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean using usual dot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are right. Thanks, I'll update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, I sometimes put an explicit []
to remind the reader to consider nil when refactoring the code..
Using the evmc-vmtester tool which is a part of the evmone project to verify and test if the Nimbus EVM can be used as a standalone EVMC VM.
Before this change:
After this change:
Execute call is still failing for other reasons but this gets us closer.