Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Bryant Eisenbach
    @fubuloubu
    b13 update: Snap is now uploaded, ReadTheDocs won't build, I don't have access to publish Docker (@jacqueswww), PyPI was uploaded yesterday
    RTD is built
    Ben Hauser
    @iamdefinitelyahuman
    :confetti_ball:
    Bryant Eisenbach
    @fubuloubu
    so now only docker isn't updated
    cc @jacqueswww @davesque
    wschwab
    @wschwab
    Hey all! The Vyper wiki lists a package I hacked together once upon a time as the official Vyper language package for Atom. I've taken some time to update and generally improve it. If any of you are interested in taking a gander: https://github.com/wschwab/language-vyper
    It's not the official APM (Atom Package Manager) package for Vyper, unfortunately. I'm trying to figure out how to get in touch with the guy who published to APM, but haven't succeeded so far.
    Bryant Eisenbach
    @fubuloubu
    nice, looks pretty!
    Bryant Eisenbach
    @fubuloubu
    Going to be quite an interesting meeting tomorrow!
    Ben Hauser
    @iamdefinitelyahuman
    looking forward to it
    Jacques Wagener
    @jacqueswww
    @superbmilkyway_twitter there is a command installed called vyper-server just run that and point remix to use local compiler :)
    Jacques Wagener
    @jacqueswww
    image.png
    Bryant Eisenbach
    @fubuloubu
    ugh, just noticed that the closing ceremony description is this: "An Evening With Doge (yes, that Doge)"
    Charles Cooper
    @charles-cooper
    @fubuloubu don't worry, i recently discovered that bitburger is not a cryptocurrency
    Ben Hauser
    @iamdefinitelyahuman
    buy bitmarmots
    Charles Cooper
    @charles-cooper
    Haha
    Steve Marx
    @smarx

    Following up from the call earlier, here's our highest priority request before we launch into phase 1 of the compiler audit next week. Could someone go through the Python AST and/or vyper/ast.py and write down where there's a difference between the Python grammar/semantics and Vyper's? A couple quick examples of what we're thinking about:

    1. Vyper does preprocessing to turn structs and contracts into classes and keeps track of the original token outside of the AST (I think).
    2. for loops have an else in Python, but Vyper seems to just ignore that. Should it be rejected? Or should it be used?
    3. Vyper has units, like uint256(wei). That probably looks like a function call in the Python AST?

    Incomplete is okay here... it will just save us a lot of time if we have some pointers to where the interesting bits are.

    Jacques Wagener
    @jacqueswww
    I can briefly answer those questsions, will probably more in detail tomorrow when I am more awake.
    1. Yes that's correct we rework class for those two cases.
    2. Good catch, that should be blocked. So basically ast.py works as a filter to catch the parts of python we don't implement. So to handle that we just remove orelse from the For class.
      So to initially get to the point where I could produce ast.py with VyperNode I had to scrape python's ast classes - I could find that script and then we could do a diff and document off of that.
      (e.g. https://github.com/ethereum/vyper/compare/master...jacqueswww:remove_for_orelse?expand=1)
      Further he For statement is way more constricted with 3 variances of range().
    3. Yes correct Vyper's has support for custom units that get defined as an attribute on each Variables' BaseType and GlobalContext._custom_units .
    The units are all derived from the Typing / Annotation / AnnAssign part of the ast. So AnnAssign->Call, at the Module level of the file assign type + unit. And Dict with Name of units defines the global notion that the units may be used.
    Steve Marx
    @smarx
    This is helpful, @jacqueswww! If you have time to go through the rest of ast.py and flag other stuff like this, that would be a huge help.
    Jacques Wagener
    @jacqueswww
    Hi everyone! If you donate 1DAI in the next day or so it will be CLR matched to about 100DAI https://gitcoin.co/grants/128/vyper-smart-contract-language-dev-fund
    Bryant Eisenbach
    @fubuloubu
    "Thats a wrap! $100k Round 3 has closed!"
    realisation
    @realisation
    I saw that uniswap uses block.timestamp
    Is that not dangerous at all for them?
    Bryant Eisenbach
    @fubuloubu
    miners could potentially use it to reject orders maliciously, but it wouldn't impact the solvency of the contract system
    it's a minor issue, but it adds more value than the problems it could cause
    realisation
    @realisation
    thnx
    Michael Egorov
    @michwill

    An optimization question.
    If I have:

    self.y = blah
    log.MyEvent(self.y)

    Will it do two SLOADs? If I want to use less gas, should I do this?

    _x: uint256 = blah
    self.y = _x
    log.MyEvent(_x)
    Bryant Eisenbach
    @fubuloubu
    Well, it should only do one SLOAD (and one SSTORE), but yes the later would be cheaper
    It would be a good optimization trick to do this kind of thing under the hood IFF no read occurs after any write(s)
    (even better, just write blah to the event)
    Michael Egorov
    @michwill
    Well, blah is actually a * very / expensive ** calculation
    But yeah, thanks!
    Bryant Eisenbach
    @fubuloubu
    Gotcha, yep. I meant load the result of the operation on the stack and use it multiple times.
    @wadeAlexC nice write-up!
    Feist Josselin
    @montyly
    Hi! Is there an inbuilt mechanism to have "unsafe" arithmetic operations? Like if I want to use uint without the overflow check?
    Charles Cooper
    @charles-cooper
    @montyly not really
    what is the use case?
    Feist Josselin
    @montyly
    I don't have a typical use-case, but I was just wondering if it was possible
    The main reason to do so would probably be optimization. Like if you have a counter, that you know will never overflow, you might want to remove the overflow check to reduce the gas cost
    Feist Josselin
    @montyly

    Like

    counter: public(uint256)
    
    @public
    def increase():
        self.counter += 1

    Add two SLOAD to the execution

    image.png
    Charles Cooper
    @charles-cooper
    ic. that's very similar to the issue @michwill was asking about earlier
    Feist Josselin
    @montyly
    It won't matter much if the optimizer removes the SLOAD and uses a temporary variable though
    Charles Cooper
    @charles-cooper
    yes. we need some sort of data dependency analysis to be able to optimize those out
    Feist Josselin
    @montyly
    Yes, that makes sense. Thanks for answering my questions so quickly!