Skip to content
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

fix(spec-test): pass eth_aggregate_pubkeys_x40_pubkey #100

Closed
wants to merge 54 commits into from

Conversation

matthewkeil
Copy link
Member

This PR is related to #88 and covers spec testing of the aggregatePublicKeys spec test that was failing.

Inclusions

  • X40 spec test for aggregatePublicKeys

How to test

NOTE: to build and test copy the blst folder into rebuild/deps/blst. This will go away when we merge but for now node-gyp gets heartburn when building deps in folder above the binding.gyp file

Unit tests are provided and should have 100% coverage. If you see an edge that may not be covered please feel free to bring it up and I will add the test case

cd rebuild
yarn
yarn build
yarn test:spec

- Create ErrorHandler
- Extends ErrorHandler to DRY rest of classes
@matthewkeil matthewkeil requested a review from a team as a code owner May 15, 2023 02:56
@matthewkeil matthewkeil mentioned this pull request May 15, 2023
34 tasks
@matthewkeil matthewkeil changed the base branch from mkeil/rebuild-sign-spec to master May 17, 2023 17:03
@matthewkeil matthewkeil marked this pull request as draft May 17, 2023 17:03
* so if P1 points are aggregated often (Eth2.0) you want to keep the point
* cached in jacobian coordinates.
*/
export enum CoordType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move all types/interfaces to a types.d.ts or something


/**
*
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we chunk out these empty comment lines

*/
bool BlstBase::IsZeroBytes(const uint8_t *data, size_t start_byte, size_t byte_length)
{
for (size_t i = start_byte; i < byte_length; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use spaces instead of tabs

Setup();
if (HasError())
{
goto out_err;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need t o use goto? and where is the label out_err ?

return ret_val;
WORKER_TRY_CATCH_END("RunSync");
};
Napi::Value BlstAsyncWorker::Run()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new line after each fn/class declaration

Napi::Value BlstAsyncWorker::Run()
{
WORKER_TRY_CATCH_BEGIN
_use_deferred = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add comment what _use_deferred does

*
*
* Uint8ArrayArgArray
*
Copy link
Contributor

@g11tech g11tech May 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move this to a separate file, also js-docs kind of input output description

return true;
}
}
} while (1 == RAND_poll());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just import something rather than copy over?

try \
{

#define WORKER_TRY_CATCH_END(name) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is using the macro to try catch standard way of doing this?

}
else if (_has_affine)
{
if (_affine->is_inf())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chain them in if else

}
}

set_error:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in favor of goto at all unless you are writing a stack implementation

goto is hard to prove correctness

public:
PublicKeyArg(Napi::Env env);
PublicKeyArg(Napi::Env env, Napi::Value raw_arg);
PublicKeyArg(const PublicKeyArg &source) = delete;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this supposed to do here?

@matthewkeil matthewkeil closed this Jan 5, 2024
@matthewkeil
Copy link
Member Author

closed with preference for macros instead of class based constructs. see rebuild branch

@matthewkeil matthewkeil deleted the mkeil/fix-agg-spec branch April 22, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants