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

Add type hinting #11

Closed
pipermerriam opened this issue Oct 17, 2018 · 47 comments
Closed

Add type hinting #11

pipermerriam opened this issue Oct 17, 2018 · 47 comments

Comments

@pipermerriam
Copy link
Member

Largely copy/pasted from ethereum/py-evm#1398

Background

Type hints allow us to perform static type checking, among other things. They raise the security bar by catching bugs at development time that, without type support, may turn into runtime bugs.

This stackoverflow answer does a great job at describing their main benefits.

What is wrong?

This library currently does not have any type hints.

This needs to be fixed by:

  1. Adding all missing type hints.
  2. Enforcing (stricter) type checking in CI

How

There does exist tooling (monkeytype) to the generation of type hints for existing code bases. From my personal experience monkeytype can be helpful but does still require manual fine tuning. Also, manually adding these type hints does serve as a great boost to the general understanding of the code base as it forces one to think about the code.

  1. Run mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional --check-untyped-defs --disallow-incomplete-defs --disallow-untyped-defs --disallow-any-generics -p eth

  2. Eliminate every reported error by adding the right type hint

Because this library supports older versions of python, the type hints will not be able to use the modern python3.6 syntax.

Definition of done

This issue is done when the following criteria are met:

  1. mypy is run in CI

Add a new command to the flake8 environment in the tox.ini file that runs:

mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional --check-untyped-defs --disallow-incomplete-defs --disallow-untyped-defs --disallow-any-generics -p py_ecc`
  1. Usage of type: ignore (silencing the type checker) is minimized and there's a reasonable explanation for its usage

Stretch goals

When this issue is done, stretch goals can be applied (and individually get funded) to tighten type support to qualify:

  1. mypy --strict --follow-imports=silent --ignore-missing-imports --no-strict-optional -p py_ecc
@6ug
Copy link
Contributor

6ug commented Oct 17, 2018

I like to work on this thing, I just saw talk from guido and I can do this thing.

@pipermerriam
Copy link
Member Author

@6ug 👍

Please get a pull request open early (like as soon as you have any changes committed). We'll mark it as a work in progress while you complete it.

@pipermerriam
Copy link
Member Author

Also, you should just include the necessary changes for #12 in this as well as they don't really need to be done separately.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 360.0 DAI (360.0 USD @ $1.0/DAI) attached to it.

@iamonuwa
Copy link
Contributor

@6ug are you interested in this? Am ready to start working on it immediately

@iamonuwa
Copy link
Contributor

I'll apply for this. But if you are interested, you can work on it.

@6ug
Copy link
Contributor

6ug commented Oct 17, 2018

hey hi @iamonuwa, sorry I did not saw your comment. Yeah, I like to work on this, may be we can work more collaboratively. You can start solving it by end of mypy output and I will start solving by top, will that be okay?

@iamonuwa
Copy link
Contributor

Alright. Apply for the task as well.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 360.0 DAI (360.0 USD @ $1.0/DAI) attached to it.

@gitcoinbot
Copy link

gitcoinbot commented Oct 17, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 9 months, 3 weeks from now.
Please review their action plans below:

1) bhargavasomu has been approved to start work.

I have already made a PR with completing the tasks mentioned, and waiting for a review.

Learn more on the Gitcoin Issue Details page.

2) bhargavasomu has applied to start work (Funders only: approve worker | reject worker).

I am well versed with type hinting in python and have a good understanding of the codebase. If assigned to me, I will complete this task within at max a 3 days.

Learn more on the Gitcoin Issue Details page.

3) yuraz71 has applied to start work (Funders only: approve worker | reject worker).

Hello,
If you are still in needs of this project, I can help you.
I used type hints in many of my projects and I think there is no will be problem with it.
Can you approve me to our project ?

Learn more on the Gitcoin Issue Details page.

@svenski123
Copy link

Hi the type hinting issue that I applied to work was opened about 30 minutes ago and so I jumped it as I was late to the original py-evm.eth bounty. However it seems there is already a long github thread in place which is linked to multiple issues/bounties so I am not sure if this has been taken or not. Please kindly clarify which modules (if any) are to be worked on by whom.

@spm32
Copy link

spm32 commented Oct 17, 2018

Hey @iamonuwa @6ug did you both apply? I don't see you in the list of applicants.

@pipermerriam
Copy link
Member Author

We generally do fixst-come-first-serve with the expectation that when there are multiple parties interested in doing a task that the work will be done promptly by the person claiming (loosely defined as PR open within the first 24 hours and actively working on the issue).

@6ug has first dibs, followed by @iamonuwa

If the two of you (@6ug and @iamonuwa ) want to team up on this, make sure you two have a clear and public agreement on how bounty payout will work if you are both interested in the bounty).

@pipermerriam
Copy link
Member Author

@svenski123 yes, py_ecc package, apologies if the gitcoin issue says something different, I was creating a bunch of these across multiple repositories.

@gitcoinbot
Copy link

gitcoinbot commented Oct 23, 2018

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 7 months, 1 week from now.
Please review their action plans below:

1) federicosan has been approved to start work.

mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports -- no-strict-optional --check-untyped-defs --disallow-incomplete-defs --disallow-un typed-defs --disallow-any-generics -p py_ecc
py_ecc\secp256k1\secp256k1.py:9: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:26: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:34: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:46: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:51: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:63: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:87: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:92: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:105: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:109: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:113: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:117: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:128: error: Function is missing a type annotation
py_ecc\secp256k1\secp256k1.py:140: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:12: error: Name 'long' is not defined
py_ecc\optimized_bn128\optimized_field_elements.py:14: error: Incompatible types in assignment (expression has type "Tuple[Type[int]]", variable has type "Tuple [Type[int], Any]")
py_ecc\optimized_bn128\optimized_field_elements.py:19: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:34: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:41: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:45: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:49: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:52: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:55: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:59: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:63: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:68: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:71: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:76: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:79: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:89: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:95: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:98: error: Function is missin g a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:101: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:105: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:109: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:114: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:121: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:135: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:143: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:151: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:159: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:176: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:179: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:190: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:193: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:204: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:222: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:225: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:232: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:235: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:239: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:243: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:249: error: Function is missi ng a type annotation
py_ecc\optimized_bn128\optimized_field_elements.py:259: error: Function is missi ng a type annotation
py_ecc\bn128\bn128_field_elements.py:11: error: Name 'long' is not defined
py_ecc\bn128\bn128_field_elements.py:13: error: Incompatible types in assignment (expression has type "Tuple[Type[int]]", variable has type "Tuple[Type[int], An y]")
py_ecc\bn128\bn128_field_elements.py:27: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:42: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:49: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:53: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:57: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:60: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:63: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:67: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:71: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:76: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:79: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:84: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:87: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:97: error: Function is missing a type annot ation
py_ecc\bn128\bn128_field_elements.py:103: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:106: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:109: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:113: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:117: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:122: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:129: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:141: error: Unsupported operand types for + ("Tuple[Type[FQ]]" and "Tuple[Type[int], Any]")
py_ecc\bn128\bn128_field_elements.py:146: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:154: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:158: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:162: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:177: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:180: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:187: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:190: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:201: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:219: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:222: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:229: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:232: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:236: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:240: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:246: error: Function is missing a type anno tation
py_ecc\bn128\bn128_field_elements.py:255: error: Function is missing a type anno tation
py_ecc\optimized_bn128\optimized_curve.py:46: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_curve.py:51: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_curve.py:63: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_curve.py:77: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_curve.py:105: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_curve.py:116: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_curve.py:122: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_curve.py:132: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_curve.py:139: error: Function is missing a type annotation
py_ecc\bn128\bn128_curve.py:45: error: Function is missing a type annotation
py_ecc\bn128\bn128_curve.py:50: error: Function is missing a type annotation
py_ecc\bn128\bn128_curve.py:62: error: Function is missing a type annotation
py_ecc\bn128\bn128_curve.py:71: error: Function is missing a type annotation
py_ecc\bn128\bn128_curve.py:89: error: Function is missing a type annotation
py_ecc\bn128\bn128_curve.py:100: error: Function is missing a type annotation
py_ecc\bn128\bn128_curve.py:109: error: Function is missing a type annotation
py_ecc\bn128\bn128_curve.py:116: error: Function is missing a type annotation
py_ecc\optimized_bn128\optimized_pairing.py:36: error: Function is missing a typ e annotation
py_ecc\optimized_bn128\optimized_pairing.py:45: error: Function is missing a typ e annotation
py_ecc\optimized_bn128\optimized_pairing.py:69: error: Function is missing a typ e annotation
py_ecc\optimized_bn128\optimized_pairing.py:98: error: Function is missing a typ e annotation
py_ecc\optimized_bn128\optimized_pairing.py:138: error: Function is missing a ty pe annotation
py_ecc\optimized_bn128\optimized_pairing.py:146: error: Function is missing a ty pe annotation
py_ecc\bn128\bn128_pairing.py:27: error: Function is missing a type annotation
py_ecc\bn128\bn128_pairing.py:42: error: Function is missing a type annotation
py_ecc\bn128\bn128_pairing.py:71: error: Function is missing a type annotation
py_ecc\bn128\bn128_pairing.py:95: error: Function is missing a type annotation
py_ecc\bn128\bn128_pairing.py:101: error: Function is missing a type annotation

Learn more on the Gitcoin Issue Details page.

@federicosan
Copy link

federicosan commented Oct 23, 2018

Hi, I applied to work on this via gitcoin, please confirm is this is already taken. @pipermerriam pipermerriam

@pipermerriam
Copy link
Member Author

@federicosan work is already underway in #18

@federicosan
Copy link

@pipermerriam Thanks to clarify

@gitcoinbot
Copy link

@federicosan Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

1 similar comment
@gitcoinbot
Copy link

@federicosan Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@federicosan due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

1 similar comment
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


@federicosan due to inactivity, we have escalated this issue to Gitcoin's moderation team. Let us know if you believe this has been done in error!

  • warning (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@Bhargavasomu
Copy link
Contributor

Bhargavasomu commented Nov 4, 2018

@pipermerriam as I don't see progress in the issue (as per gitcoin), I would like to work on this. I can complete this in a day. Do I have the permission to go ahead with this? @gitcoinbot can you please reopen the issue, as I would like to work on it.

@rmshea
Copy link

rmshea commented Nov 8, 2018

Hey @pipermerriam, what is the status on this? Would love to give @Bhargavasomu the opportunity to complete this for you. On Gitcoin, @federicosan is the only worker approved. How can I help here? 😄

@pipermerriam
Copy link
Member Author

@ryan-shea just got back from some vacation post-devcon. @Bhargavasomu has my blessing to work on this.

@Bhargavasomu
Copy link
Contributor

@gitcoinbot could you please reopen the issue and later approve me?

@spm32
Copy link

spm32 commented Nov 14, 2018

You should be approved now @Bhargavasomu 👍

@spm32
Copy link

spm32 commented Nov 21, 2018

Hey @Bhargavasomu any updates on your end?

@Bhargavasomu
Copy link
Contributor

Bhargavasomu commented Nov 21, 2018

@ceresstation I am in the middle of the examinations and have completed half of the work. Will work full time on this in around 5 days. Is that ok? (Already done half of the supportive work, though not in the state for a PR) Will complete this bounty in a week for sure.

@Bhargavasomu
Copy link
Contributor

Bhargavasomu commented Nov 21, 2018

@pipermerriam why are we using seperate classes for FQ when it is just like an int? I don't see anything new features added to the FQ class. Could you please explain the need for that?

One more thing I was curious about, could you show me the modules where this library is used?

Deeper down, I observed that there was no modulo operation for the class FQ.


Should I add that (or) it is meant to not be considered?

@pipermerriam
Copy link
Member Author

@Bhargavasomu this was all originally written by Vitalik and I don't actually have a strong understanding of the internals. I'd shoot for absolute minimal changes to the code as part of this as I'm not willing to sign off on anything that does much in terms of structural changes that aren't easy to visually verify that they don't change any functionality.

@Bhargavasomu
Copy link
Contributor

@pipermerriam I think that there are some potential problems in this code, when it comes to type hinting because of the design.

class FQ(object):
def __init__(self, n):
if isinstance(n, self.__class__):
self.n = n.n
else:
self.n = n % field_modulus
assert isinstance(self.n, int_types)

If you take a look at the above snippet, the type hinting for the function argument n, as per the code should be Union[int, "FQ"]. But the type int doesn't have the attribute n and hence mypy is also throwing the same error.

error: Item "int" of "Union[int, FQ]" has no attribute "n"

We could do a type: ignore, but there are a lot of places with similar design and would involve a bunch of type: ignore which would make the code messy. How should I go about this?

@Bhargavasomu
Copy link
Contributor

EDIT: Figured out the solution to the above problem. It is because that mypy has a bug with self.__class__. Hence all self.__class__ have been replaced with type(self). But a new problem now arised.
If we replace as above, then in the code we are returning the objects of the children class. But in the children class the __init__ signature has been changed. Hence mypy is now throwing the following error.
error: Too few arguments for "FQP"

For example if we consider this

def inv(self):
lm, hm = [1] + [0] * self.degree, [0] * (self.degree + 1)
low, high = self.coeffs + [0], self.modulus_coeffs + [1]
while deg(low):
r = poly_rounded_div(high, low)
r += [0] * (self.degree + 1 - len(r))
nm = [x for x in hm]
new = [x for x in high]
assert len(set(
[len(lm), len(hm), len(low), len(high), len(nm), len(new), self.degree + 1]
)) == 1
for i in range(self.degree + 1):
for j in range(self.degree + 1 - i):
nm[i + j] -= lm[i] * r[j]
new[i + j] -= low[i] * r[j]
lm, low, hm, high = nm, new, lm, low
return self.__class__(lm[:self.degree]) / low[0]

Here the return type is pertained to the types of either FQ2 or FQ12, and hence typing this as FQP is throwing up the error.
How should I go about this? cc @cburgdorf

@Bhargavasomu
Copy link
Contributor

Bhargavasomu commented Nov 28, 2018

@pipermerriam there are a lot of assert statements between the code, not as part of any function but as part of the main code itself.

# Check consistency of the "line function"
one, two, three = G1, double(G1), multiply(G1, 3)
negone, negtwo, negthree = (
multiply(G1, curve_order - 1),
multiply(G1, curve_order - 2),
multiply(G1, curve_order - 3),
)
assert linefunc(one, two, one)[0] == FQ(0)
assert linefunc(one, two, two)[0] == FQ(0)
assert linefunc(one, two, three)[0] != FQ(0)
assert linefunc(one, two, negthree)[0] == FQ(0)
assert linefunc(one, negone, one)[0] == FQ(0)
assert linefunc(one, negone, negone)[0] == FQ(0)
assert linefunc(one, negone, two)[0] != FQ(0)
assert linefunc(one, one, one)[0] == FQ(0)
assert linefunc(one, one, two)[0] != FQ(0)
assert linefunc(one, one, negtwo)[0] == FQ(0)

It would be better if the assert statements would be placed in tests directory right? Could you guide me more on this as in where to place all these assert statements?

@Bhargavasomu
Copy link
Contributor

@pipermerriam this issue is still not over as the type hinting of optimized_bn128. I will be submitting the PR for that soon though.

@pipermerriam pipermerriam reopened this Nov 28, 2018
@pipermerriam
Copy link
Member Author

@Bhargavasomu take not of some cleanup I'm doing in #28

@pipermerriam
Copy link
Member Author

https://github.com/ethereum/py_ecc/blob/master/tox.ini#L27-L29

@Bhargavasomu can you get in one more PR which condenses those three CI runs into a single run on the base module so that we can confirm that the whole library is properly typed/linted.

@Bhargavasomu
Copy link
Contributor

@pipermerriam the main problem with that is the sub-modules bs12_381 and optimized_bs12_381 are not type hinted as of now; and hence mypy check on the base module(py_ecc) would fail. I could type hint it, but it would lead to a lot of redundancy and doing a refactoring first would help in the type hinting. I have added all the details here. I will first try to tackle the refactoring part as of #24 and then finish the type hinting for the rest of the sub-modules.

@pipermerriam
Copy link
Member Author

Alright,

I've opened #31 which is a copy/paste from your comment. I've submitted to have a bounty attached to it.

We don't traditionally pay out bounties until they are complete and this issue is not yet complete. I understand your reasoning for wanting to do #31 first though and I think you are correct to do it that way.

Are you ok proceeding with #31 and then completing this issue after which the bounty will be paid out? If it's a problem feel free to raise it here or message me directly.

@Bhargavasomu
Copy link
Contributor

@pipermerriam I would like to take up #31. Once I am done with it, will come back to this.

@Bhargavasomu
Copy link
Contributor

Bhargavasomu commented Dec 7, 2018

And by the way, could we have a blocked label for this issue?

@0xcat
Copy link

0xcat commented Jan 7, 2019

Hey folks, can I take this issue?

@pipermerriam
Copy link
Member Author

@catslovesmilk

Somu (@Bhargavasomu ) has been working towards this for a bit and was blocked by his work on #31 so for now it is still his.

@carver carver added the Blocked label Jan 22, 2019
@Bhargavasomu
Copy link
Contributor

@pipermerriam I think this bounty be closed with #63.

@carver carver removed the Blocked label Mar 23, 2019
@carver carver closed this as completed Mar 23, 2019
@pipermerriam
Copy link
Member Author

@gitcoinbot is it possible to re-activate this bounty to be paid towards @Bhargavasomu

This issue ended up being blocked/delayed by some other deeper work that Somu did on the library and it's just now been completed.

@gitcoinbot
Copy link

⚡️ A tip worth 360.00000 DAI (360.0 USD @ $1.0/DAI) has been granted to @Bhargavasomu for this issue from @ceresstation. ⚡️

Nice work @Bhargavasomu! Your tip has automatically been deposited in the ETH address we have on file.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This Bounty has been completed.

Additional Tips for this Bounty:

  • ceresstation tipped 360.0000 DAI worth 360.0 USD to Bhargavasomu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests