atis elsts (@atiselsts_eth) header
atis elsts (@atiselsts_eth) profile picture

Researcher | ex @chaoslabs

Joined February 2023
Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)Photo by atis elsts (@atiselsts_eth)
Here's a concrete example of how Glamsterdam repricing breaks existing assumptions around Uniswap v4 smart contracts. (Not an exploit: nothing is live yet + the problem was already known to security researchers in the summer.) v4 PositionManager allows contracts to subscribe to LP positions and get notified when the position is changed or transferred. This is useful for staking and rewards distribution, but it means calling untrusted 3rd party code from a protocol contract. The protocol wants to ensure that such a subscriber is not able to (1) DoS the operations around the position; (2) consume unlimited gas. Conversely, as long as (1) and (2) hold, an honest subscriber should keep getting notified when something happens to the position. To enforce 1-2 around the `unsubscribe` operation specifically, v4 deployments limit the gas that can be consumed by it. On mainnet, the limit is 150k - a protocol config setting. (It used to be 1% of the block's gaslimit, which is a more futureproof design, but was changed to a per-deployment constant before launch.) Before Glamsterdam, creating new state used to cost around 22k gas per slot - so the 150k limit was plenty for that. Afterwards, it costs around 110k for a single slot, so the subscriber may well run out of gas if it's writing any new slots. The saving grace is that around 90% of that gas is paid from a separate pool - the "state gas reservoir". So if the reservoir is present, it's used until it gets empty; then the tx starts consuming regular gas. The reservoir is only present when the initial tx gas is set above 16M (the max gas limit for normal gas - yes it's confusing!). If the user fails to do that AND the 150k limit is insufficient, they will leave the subscriber in a broken state after an `unsubscribe` call. The mirror reflection of this problem is that when the subscriber wants to go wild, it can. If the user sets the gas limit to 16M + X, the subscriber can spend most of that X - it will not be capped by the 150k gas limit configured in the Uniswap contract. This is a griefing attack, not a DoS. The good news is that the breakage is due to new state creation, it can be prevented if the user sending the tx sets a large enough gas limit. (At the expense of becoming more vulnerable to gas griefing.) But regular gas *also* gets repriced in Glamsterdam. Existing storage writes also get more expensive - and they are not funded from the reservoir - so the user cannot fully prevent breakage in some edge cases. Whether and how these affect some real contracts is something EF must be checking now.
5
6
2
57
9,939
Folks are piling on the Glamsterdam state growth repricing design. Yet, gas repricing has always been part of Ethereum. That's why Solidity's send and transfer were deprecated. The choice is between: 1) Limiting L1 execution scaling - leaves L1 too expensive for many use cases 2) State expiry - violates CROPS, L1's core promises 3) Repricing state growth - a compromise That said, the current design is flawed in some nasty ways. Here's an example of a pattern in Uni v4-periphery that would break: nitter.cf/atiselsts_eth/status/1… Let's fix those problems, but let's not throw the baby out with the bathwater. nitter.cf/vdWijden/status/211932…
I am really tired of people not reading a 20 line blog post before running their mouths on twitter. WE ARE INVESTIGATING INTERNALLY, WITH AUDITORS, AND GIVING PEOPLE THE ABILITY TO CONTACT US, SO WE CAN DECIDE HOW TO PROCEED WITH THIS.
4
29
1,585
Permissionless propAMMs (anyone can provide liquidity) seem to be the logical next step. Fynd, Metric, and now Yield Basis are all experimenting with this idea. Potentially a big unlock for all of DeFi. DEX will take over CEX, just a matter of time.
13
4
3
89
7,715
CT can't be "good vibes only", but it should be more like "AMMs are great, we love AMMs, BUT..." not "AMMs will never work BECAUSE..." nitter.cf/guil_lambert/status/20…
I am actually grateful that the Researchers who blackpilled CT against AMMs by larping about LVR, markouts, and “stale orders getting picked off” are gone from my timeline.
3
8
571
Uniswap {Labs, Fnd}: - kills community analytics program - does not fund analytics grants despite $100M grant budget - kills suggestions from DAO to run DAO-owned dashboards Also Uniswap Labs: - gets angry when CT gets their analytics from unfriendly 3rd party guys
17
8
5
173
22,856
I've been an LP since Uniswap v1, and I still LP every day. My UniswapDAO mandate was always to be a voice for LPs. I just voted NO on the Uniswap v4 fee switch proposal. Put simply: turning on the fee switch makes LPing structurally unprofitable. See my temp check post for more details. So while it saddens me that plain "vanilla" Uniswap might be going away, AMMs as a primitive are simply too powerful to disappear. --- Disclosure: I'm the founder of Panoptic, and our protocol can benefit from this vote if LPs choose to migrate to it. I am voting NO anyway because the survival of Uniswap, and every protocol/hook/product built on top of it, still depends on LPs powering the ecosystem. --- I sincerely want to thank 0x6c3A...E62e for delegating their UNI voting power to me over the past 3 years. But this vote will be my last vote as a UniswapDAO delegate.
17
7
4
90
12,341
Some spicy discussion is starting to happen in the Uniswap v4 fee switch thread: gov.uniswap.org/t/temp-check… Coming from wider DeFi perspective, I don't support the switch, but there's no denying that UNI holders are likely to benefit from short-term. nitter.cf/atiselsts_eth/status/2…
Uniswap Labs is pushing for the fee switch for v4. Is this the right time? In my view, no. @Uniswap remains strategically important for all of DeFi. Critically, lending protocols rely on its liquidity to set asset parameters. Less liquidity -> worse trading AND worse lending.
7
15
2,269
RH chain feels like Ethereum back in 2021: with Uniswap dominating the DEX scene and LPs printing money again. The weird thing: the underlying blockchain technology has evolved by miles, yet the AMM technology is almost the same. This can't be the endgame.
6
1
18
1,250
Uniswap Labs is pushing for the fee switch for v4. Is this the right time? In my view, no. @Uniswap remains strategically important for all of DeFi. Critically, lending protocols rely on its liquidity to set asset parameters. Less liquidity -> worse trading AND worse lending.
2
3
2
22
4,230
In theory, the v4 protocol fee can be reduced or even disabled later. Still, would Labs be able and willing to do that if it became necessary to protect the protocol? One certainly hopes so, but I have some doubts.
1
2
176
Bottom line: the previous fee switches have already made DeFi - as a whole - more risky, causing wide-range liquidity on v3 and especially v2 to dry up. High and extractive fees on v4 can make the status significantly worse.
1
2
172