indy-vdr
indy-vdr copied to clipboard
fix: fixed binary for react native
the async_trait macro appeared to be crashing Bifold in react native. I've refactored the code to remove the async_trait macro and made some changes to the code to compensate
@genaris @TimoGlastra @andrewwhitehead could I get a quick review on this please?
the async_trait macro appeared to be crashing Bifold in react native. I've refactored the code to remove the
async_traitmacro and made some changes to the code to compensate
Do you have some of the logs for this? We have used async_trait since the beginning and it didn't really causes any crashes then. Curious to see what broke it.
I'd get this error message on the build with async trait after fetching a schema definition from the ledger:
Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x76d39d6fa0 in tid 15686 (mqt_js), pid 15558 (bc.gov.BCWallet)
I'd get this error message on the build with async trait after fetching a schema definition from the ledger:
Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x76d39d6fa0 in tid 15686 (mqt_js), pid 15558 (bc.gov.BCWallet)
But there is no indication of async_trait breaking anything here, correct?
I am not aware of the technical implications of removing async_trait and moving to sync, so it might be fine.
https://github.com/dtolnay/async-trait?tab=readme-ov-file#explanation just shows that it adds a box+pin to it, which shouldn't segfault, right?
it shouldn't segfault because it doesn't in node... but for some reason it does on react native maybe because it's compiled for mobile architectures (arm64 and eabi). My hunch is that box+pin isn't getting properly translated when cross compiling so maybe things are moving around in memory when they should be pinned. That's just a hunch though, I haven't proven it.
Either way I discovered that the async_trait wasn't needed anyway and I was able to do the same functionality using core rust libraries. So I view this PR as a kind of refactoring/code cleanup with the added bonus of fixing a bug for mobile users
From a quick search it looks like SEGV_ACCERR usually indicates a stack overflow, which could be due to a smaller stack being configured on the mobile builds. async_trait would not be the problem so much as running the cache operations within the async executor, although I don't really see why that should cause any issues. If it works then this fix seems fine.
The other build errors seem to have started with the dependabot update PR, but are likely due to a new release of some dependency (cmake?). On Darwin I see it trying to link an arm64 build of libzmq during the x64_64 build.
Edit: the build issues seem to be mostly due to GHA updating to MacOS 14, the workflow is adjusted to use macos-12 for now.
@wadeking98, #292 is merged. Try rebasing your PR.
@andrewwhitehead @cvarjao the checks completed successfully