Skip to content

Conversation

@knst
Copy link
Collaborator

@knst knst commented Jun 28, 2023

Issue being fixed or feature implemented

Current implementation of BLS wrapper has an unclear interface related to checkMalleable flag.

There are 2 methods Unserialize, that has both default arguments:

template
inline void Unserialize(Stream& s, const bool specificLegacyScheme, bool checkMalleable = true);
template
inline void Unserialize(Stream& s, bool checkMalleable = true);

Let's assume that I am calling Unserialize(s, true) - it's very non-obvious which one will be called and not error prune at all.

It should be re-implemented, and there should not be default argument.

Pasta noticed that this flag can be useful from performance point of view - let's have better new method such as UnserializeNoMalleable or similar and use it when reindexing/etc. It should be specified explicit.

Reverting this change and adding new interface in future won't be difficult task so far as changes are quite trivial.

What was done?

Removed flag checkMalleable to simplify code because it's always true.
It splits from #5443

How Has This Been Tested?

Run unit functional tests.

Breaking Changes

No breaking changes - flag is always true.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

This flag is true in all usages (including a default value)
Copy link

@ogabrielides ogabrielides left a comment

Choose a reason for hiding this comment

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

utACK

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK for squash merge; did some profiling and found no noticeable differences

@PastaPastaPasta PastaPastaPasta merged commit 96554c8 into dashpay:develop Jul 3, 2023
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.

4 participants