Build nimbus evmc shared library and fix issue to enable loading#3050
Merged
Build nimbus evmc shared library and fix issue to enable loading#3050
Conversation
bhartnett
commented
Feb 6, 2025
|
|
||
| # 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.} |
Contributor
Author
There was a problem hiding this comment.
Renamed to enabled loading by the evmc-vmtester tool.
bhartnett
commented
Feb 6, 2025
| vm[].destroy = evmcDestroy | ||
| vm[].execute = evmcExecute | ||
| vm[].get_capabilities = evmcGetCapabilities | ||
| vm[].set_option = evmcSetOption |
Contributor
Author
There was a problem hiding this comment.
Using manual memory alloc and dealloc to fix segfault caused by using ref in shared library.
Contributor
There was a problem hiding this comment.
iirc accessing field of a ptr object no need to use [] deref. Nim automatically produce correct code, no?
Contributor
Author
There was a problem hiding this comment.
Yes you are right. Thanks, I'll update.
Member
There was a problem hiding this comment.
fwiw, I sometimes put an explicit [] to remind the reader to consider nil when refactoring the code..
jangko
approved these changes
Feb 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.