This packages the library for deployment on zx (migrating from the old otpr-aeserialization-* line).
It also adds a native Erlang fallback to invokation of the Blake2 algorithm, picking enacl if it is present, but proceeding with eblake2 if not.
This packages the library for deployment on zx (migrating from the old otpr-aeserialization-* line).
It also adds a native Erlang fallback to invokation of the Blake2 algorithm, picking enacl if it is present, but proceeding with eblake2 if not.
I am wondering if we plan keeping all of those versions in sync somehow, ex. when we change the encoder version, do we also bump the chain objects one? How would we test for compatibility?
I am wondering if we plan keeping all of those versions in sync somehow, ex. when we change the encoder version, do we also bump the chain objects one? How would we test for compatibility?
Those are added by zx but could be omitted. The versions are clearly not in sync across projects (the version of serialization has never been in sync with bytecode or the compiler, for example).
Those are added by zx but could be omitted. The versions are clearly not in sync across projects (the version of serialization has never been in sync with bytecode or the compiler, for example).
dimitar.p.ivanov
approved these changes 2025-01-22 14:58:15 +09:00
uwiger
approved these changes 2025-01-22 15:45:23 +09:00
Actually, the slowest part of the error throwing machinery isn't the catch (it's actually very fast if not capturing stacktraces, and pretty fast even then), but the code:ensure_loaded/1 call needed before throwing an undef error.
If we can know (through initialization logic) that enaclwill be loaded at this point, if present at all, we can use erlang:function_exported(enacl, generichash, 2).
Actually, the slowest part of the error throwing machinery isn't the `catch` (it's actually very fast if not capturing stacktraces, and pretty fast even then), but the `code:ensure_loaded/1` call needed before throwing an `undef` error.
If we can know (through initialization logic) that `enacl` _will_ be loaded at this point, if present at all, we can use `erlang:function_exported(enacl, generichash, 2)`.
Does that make the failed case more efficient?
I'm not sure where in initialization we could discover which case we're in, so I left it at call time.
Does that make the failed case more efficient?
I'm not sure *where* in initialization we could discover which case we're in, so I left it at call time.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This packages the library for deployment on zx (migrating from the old otpr-aeserialization-* line).
It also adds a native Erlang fallback to invokation of the Blake2 algorithm, picking enacl if it is present, but proceeding with eblake2 if not.
@@ -6,6 +6,7 @@%%% @end%%%--------------------------------------------------------------------module(gmser_api_encoder).-vsn("0.1.2").I am wondering if we plan keeping all of those versions in sync somehow, ex. when we change the encoder version, do we also bump the chain objects one? How would we test for compatibility?
Those are added by zx but could be omitted. The versions are clearly not in sync across projects (the version of serialization has never been in sync with bytecode or the compiler, for example).
@@ -51,0 +58,4 @@% syncing a new node, for example).blake2(Size, Bin) ->tryenacl:generichash(Size, Bin)Actually, the slowest part of the error throwing machinery isn't the
catch(it's actually very fast if not capturing stacktraces, and pretty fast even then), but thecode:ensure_loaded/1call needed before throwing anundeferror.If we can know (through initialization logic) that
enaclwill be loaded at this point, if present at all, we can useerlang:function_exported(enacl, generichash, 2).Does that make the failed case more efficient?
I'm not sure where in initialization we could discover which case we're in, so I left it at call time.
@@ -0,0 +9,4 @@{key_name,none}.{a_email,[]}.{c_email,[]}.{copyright,"Hans Svensson"}.Is this correct?
Ah, copyright, no. I think.