-
Notifications
You must be signed in to change notification settings - Fork 176
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
Port check_for_impurity.se
to Vyper LLL
#143
Conversation
For anyone following along, the next step is to manually compile the |
We might want to put it in /contracts even though it is a |
agree that this file should go to |
Vyper doesn't allow the number of rounds in the `repeat` form to be dynamic. This commit instead just ranges over the maximum size of any contract `2**256` and simply breaks out of the loop if we run past the current contract's bytecode
Vyper doesn't allow the number of rounds in the `repeat` form to be dynamic. This commit instead just ranges over the maximum size of any contract `2**256` and simply breaks out of the loop if we run past the current contract's bytecode
…es/casper into migrate-purity-checker
Ok, I need to sort out some issue that arose after rebasing master and trying to run the tests but as long as I verify I don't need to update anything then the purity_checker is ready to go. Once I'm ready I'll remove the [WIP] tag and submit this PR. |
check_for_impurity.se
to Vyper LLLcheck_for_impurity.se
to Vyper LLL
Ok, I've integrated w/ the latest testing updates. This is ready to go! |
Hey, I've been having a look at this and it's epic. Nice work @ralexstokes. I started making some notes, they might be useful for newcomers trying to understand the LLL. I'll turn it into a blog post once the code settles. If you've got feedback (or solutions to my TODOs) I'd be keen to hear them in the comments of that gist. They're incomplete, but I post them prematurely in the hope they might save someone some time. https://gist.github.com/paulhauner/f9915100e80305ba81ebd977b88c616c I was asked have a look at this as I wrote the existing tests for the purity stuff. I spent the last several hours nutting out the LLL, I'll come back with any comments tomorrow 😄 |
Thanks to @paulhauner, your post is a lifesaver that really helps the review. And really awesome work @ralexstokes |
@paulhauner yes thanks for that! i'll comment w/ answers now -- great summary of the code which is admittedly opaque :D |
@paulhauner awesome summary! I made some edits you can see here: https://gist.github.com/ralexstokes/2c0f91c7cb7543656a055b6577d82297/revisions Let me know if you have any further questions -- there are a lot of things that go into the code that aren't clear from just looking at it. A lot of this stuff was just me looking at the Vyper or Serpent source code and porting the existing idioms over (like the array implementation). |
Awesome, thanks @ralexstokes! I have merged your updates into my Gist. I will format this into a tidy blog post in the near future. I'll use this info to finish my review then leave any comments here 😄 |
Reading through the code and the summary. Excellent work @ralexstokes and @paulhauner. When I originally put up this issue, I did not quite comprehend the task that I was asking.. 😬 This is killer. Sorry @ralexstokes that it's taken a while for us to review, but as you know it's complicated and we want to give it the review it deserves. |
Hey all, There are two sets of tests:
Given that both sets of tests have the same outcome (assuming valid There are cases where I can see the test structure you have added @ralexstokes is more sophisticated in some aspects than the structure currently used in I also have a few minor points/queries about the purity checker operation (which are inherited from the original serpent version), but I think they may extend beyond the scope of this pull request, which I understand to be "port the existing purity checker to LLL", not "produce an ideal LLL purity checker". If we're aiming for the latter, let me know. Keen to hear thoughts from the official reviewers. 😄 |
great @paulhauner ! Yeah I started developing the new tests in isolation from this repo and then later merged them in and it seemed different enough at the time to keep them separate. I see the And I'm happy to go over the remaining points although I'm guessing they get to some of the unresolved questions around what direction this thing should take. Would love to hear everyone's thoughts. |
I was getting pretty deep into this thing over the long weekend. It stood up to all the attack vectors I could come up with during that time. One thing I did notice is that it seems to rely on an implicit assumption that the I gather this from lines This seems like a pretty reasonable assumption to me. Vitalik wrote the original Serpent version so I guess it seemed reasonable to him too. I just wanted to bring it up for the sake of information synchronicity. |
@ralexstokes Great work here! Does this make sense to pay out the Gitcoin bounty at this time, @djrtwo? Whenever it does free to submit work here and use the Gitcoin faucet for a bit of ETH if needed 🙂 |
Finally reviewed code and @paulhauner's doc. Doing the merge. Thanks everyone! |
How do I submit work? |
Fixes #69.
Work in progress for @gitcoinbot.
Ports https://github.com/ethereum/research/blob/master/impurity/check_for_impurity.se from the deprecated Serpent to Vyper LLL.
I'm placing it under the test utils for now as a separate file. I'll check w/ repo maintainers to see if they want to keep the source here or just include the contract creation transaction in
conftest.py