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 EVM+ink! Contracts Pallets to Asset Hub for Polkadot #66

Conversation

sourabhniyogi
Copy link

@sourabhniyogi sourabhniyogi commented Jan 14, 2024

This RFC proposes to add the two dominant smart contract programming languages in the Polkadot ecosystem to AssetHub: EVM + ink!/Coreplay. The objective is to increase DOT Revenue by making AssetHub accessible to
(1) Polkadot Rollups
(2) EVM smart contract programmers
(3) Coreplay smart contract programmers
These changes in AssetHub are enabled by key Polkadot 2.0 technologies: PolkaVM supporting Coreplay, hyper data availability in Blobs Chain.

This RFC proposes to add the two dominant smart contract programming languages in the Polkadot ecosystem to AssetHub: EVM + ink!/Coreplay.  The objective is to increase DOT Revenue by making AssetHub accessible to (1) Polkadot Rollups; (2) EVM smart contract programmers; (3) Coreplay programmers who wil; benefit from easier-to-use smart contract environments.  These changes in AssetHub are enabled  by key Polkadot 2.0 technologies: PolkaVM supporting Coreplay, hyper data availability in Blobs Chain.
@sourabhniyogi sourabhniyogi force-pushed the cn-add-smartcontracts-to-assethub branch from b77c11b to a8e5c25 Compare January 14, 2024 12:08
@albertov19
Copy link

What is the point of this?

The whole point of Polkadot was that Parachains would provide specific functions to the broader ecosystem. By adding SmartContract capabilities to AssetHub you will use AssetHub's blockspace for something it was not meant to do.

@sourabhniyogi
Copy link
Author

sourabhniyogi commented Jan 19, 2024 via email

@albertov19
Copy link

Polkadot's Common Good Parachains idea is to have parachains that are app-specific. If you start adding features, what is the goal of having other parachains like Moonbeam, Astar, and HydraDX? Let's call it a day and add a single-sided AMM to AssetHub, Privacy features, prediction markets, and automation.

Smart Contracts on Polkadot were denied because they are moving ALL functionalities that are not just block finality-related to system chains to maximize Polkadot's blockspace for security.

Asset-Hub's blockspace was designed for Asset-specific things, not smart contract execution.

@sourabhniyogi
Copy link
Author

sourabhniyogi commented Jan 19, 2024

Asset-Hub's blockspace was designed for Asset-specific things, not smart contract execution.

It was originally, but the content of this RFC argues for a change in its design to extend from "Asset-specific things" to include smart contract execution. This supports both EVM sync patterns with those "Asset-specific things" and Polkadot 2.0 technologies:

  • ink! => Coreplay
  • DA for Polkadot

Many Polkadot Rollups require EVM (deposits, withdrawals, fraud proofs, ...) -- converting them to pallets makes little engineering sense.

Many popular defi primitives can usefully work with the top assets of AssetHub (DOT, USDC, USDT), yes, without any other parachains. This has the potential for making AssetHub accessible for everyday users and developers while bringing in additional DOT revenue from those same users and developers.

The choice is clear:
(1) Do not Add EVM + ink! Contracts Pallets to AssetHub, sacrificing DOT revenue from EVM/ink!/Coreplay + Polkadot Rollups in favor of CoreTime DOT Revenue from 1.0 era Parachains. This ARTIFICIALLY forces Polkadot developers into async patterns, leading to poor developer experiences.
(2) Add EVM + ink! Contracts Pallets to AssetHub, sacrificing DOT revenue from 1.0 era Parachains in favor of DOT revenue from EVM/ink!/Coreplay + Polkadot Rollups. This gives FREEDOM for Polkadot developers to pursue hybrid sync+async patterns, leading to ideal developer experiences for both old 1.0 tech (EVM, ink!) and new 2.0 tech (Blobs/Sugondat, Coreplay)

While the past started with choice (1) which made sense in the 1.0 era, this RFC argues for choice (2) in the 2.0 era.

@burdges
Copy link

burdges commented Jan 21, 2024

AssetHub should probably move the oposite direction, meaning improve performance by optimizing for limited functionality.

As an example, you cannot safely run a smart contract chain over storage wich lacks non-membership proofs, but if you give up non-membership proofs then you could've optimal uniform depth storage. AssetHub might or might not need non-membership proofs. It's also possible "best effort" uniform depth storage like Cosmos works well enough in practice. We donno right now..

As for strategy & revenue..

In elastic scaling, we'll permit parachains to make blocks faster than the relay chain, but as their speed increases their data model must address liveness concerns. There are diverse somewhat incompatible ways smart contract chains could handle this smart contract vs liveness conflict, including networking restrictions, collator negotiations, runtime rust-like borrowing, restricted langauges, etc.

In polkadot, we've beaten ETH roll ups on the performacne vs security trade off, but we've never solved this smart contract vs liveness conflict. And nobody else did either because the design space looks huge.

We'll likely want multiple strong smart contract chains like Moonbeam and Astar, who make different choices and explore different parts of this design space. It's thus best if we do not step on the toes of our smart contract parachains right now.

@sourabhniyogi
Copy link
Author

sourabhniyogi commented Jan 21, 2024

AssetHub should probably move the oposite direction, meaning improve performance by optimizing for limited functionality.

@burdges Ser, what performance do you need to see improve? Forcing Polkadot developers into asynchronous patterns to use AssetHub is unnecessary and inhibits usage of AssetHub and Polkadot generally. The USDC and USDT assets on AssetHub are barely used, the AssetHub blockspace is barely used. It was one thing to make the performance argument on the relay chain in RFC #32, but we're not talking about the relay chain anymore. Having sync programming constructs on AssetHub is necessary for Polkadot Rollups, valuable for ink/Coreplay, and to essential for maximizing the use of top 2 assets other than DOT in the ecosystem: USDT and USDC. Failing to do this LIMITS Polkadot growth. If AssetHub performance issues exist, then AssetHub should be improved by developers actually USING AssetHub and hitting the performance limits NOW, not in several years when someone has finally figured whether AssetHub may or may not need non-membership proofs.

As for strategy & revenue..
In polkadot, we've beaten ETH roll ups on the performacne vs security trade off, but we've never solved this smart contract vs liveness conflict. And nobody else did either because the design space looks huge.
It is wonderful that there is a smart contract vs liveness conflict design space problem for you + others to solve with a huge design space. However, this RFC is not about that design space problem. It is about adding pallets to AssetHub.

We'll likely want multiple strong smart contract chains like Moonbeam and Astar, who make different choices and explore different parts of this design space. It's thus best if we do not step on the toes of our smart contract parachains right now.

Your approach appears to be rooted in fear and highly regressive. Polkadot already has these strong contract chains like Moonbeam and Astar, which will continue to exist because they are usable and successful in their own right, and have been since the end of 2021. Two years have passed. Now they will bring in a certain amount of CoreTime revenue in 2024 and we need to grow Polkadot to new heights. This RFC is concerned about making AssetHub usable for developers working with AssetHub assets in defi/nft apps, the easier to use ink=>Coreplay smart contract programming constructs, and Polkadot Rollups through relatively small changes on AssetHub that are extremely easy to justify as bringing in new DOT revenue.

Polkadot can win everything, but not with an approach that is rooted in fear and regressive thought patterns that artificially force Polkadot 1.0 era technology on everyone, with some fake requirement of needing to show off that yes, async patterns need to exist. Async programming constructs are already widely being used in Polkadot AND in competing Web3 ecosystems, sync+async programming constructs are being used in Polkadot AND in competing Web3 ecosystems. Its not a novel thing to be exploring async+sync programming patterns anymore, ser. Its time to advance to new places with Polkadot 2.0 vision. Its time now.

@muddlebee
Copy link

What if I want to build directly on top of Polkadot/Kusama skipping the parachains and pay txn fees directly using DOT/KSM rather than parachain native token? Is Asset Hub the better viable option?

Recently I came across https://yerba.network/ by sasha(ink dev), sounds interesting to be able to pay txn fees using KSM.

@xlc
Copy link
Contributor

xlc commented Jan 29, 2024

pay txn fees directly using DOT/KSM rather than parachain native token

You can do that on Karura / Acala from like a year ago

I do want to point it out, from a purely technical perspective, Frontier is not a good EVM stack that play nicely with the core time model or works with light client.

There are many incompatibilities between EVM and core time model, and I cannot support this unless a feasibility study is implemented.

I can list a few incompatibilities to get you start thinking:

  • Account type - ss58 vs 20 bytes hex
  • ED
  • RPC and extra db requirement for tx data indexing

Besides, many use cases simply doesn't require AH to have smart contracts.
It is currently possible (not yet implemented but can be implemented in like 2 weeks) to do a single XCM tx on AH to transfer asset (DOT or USDT or whatever) to Acala, and do a swap, and call some smart contracts, and send some tokens back to AH or another parachain.

@muddlebee
Copy link

@xlc thank you for your answer, appreciate the reply. What if I want to create and use smart contracts with ink! on Polkadot directly, instead of on its parachains, because I feel it's safer and more trustworthy? Is this a possibility in near future?

I understand there are some challenges associated with it as Jeff pointed out earlier. But as a dev POV I want ink Smart Contracts as a first step into Polkadot or Kusama then scale later on into parachains if needed.

image
source

@xlc
Copy link
Contributor

xlc commented Jan 30, 2024

We will never have smart contracts on relaychain directly.

We may have smart contracts on a system chain.

But what is the problem you trying to solve again?

@sourabhniyogi
Copy link
Author

sourabhniyogi commented Jan 30, 2024

I do want to point it out, from a purely technical perspective, Frontier is not a good EVM stack that play nicely with the core time model or works with light client.
There are many incompatibilities between EVM and core time model, and I cannot support this unless a feasibility study is implemented.

@xlc The incompatibilities between EVM and the CoreTime model are not relevant to the RFC:

  • AssetHub does NOT need CoreTime as it is a system chain. As such AssetHub can add the Frontier EVM pallets with ZERO concern for CoreTime.
  • A Polkadot Rollup using EVM tech (e.g. OP Stack) also does NOT need Frontier, nor does it need to buy CoreTime -- it needs to pay for DA.

You must have something else in mind. Can you explain how the incompatibilities between EVM and CoreTime affect the ability to add EVM pallets to AssetHub?

Account type - ss58 vs 20 bytes hex
ED
RPC and extra db requirement for tx data indexing

@xlc The RFC recommends that Astar follow Astar's design choices (rather than Moonbeam or Acala), which is the #1 parachain in the ecosystem by marketcap. However, I'd love to hear why you think Astar's choices would be bad for AssetHub relative to Acala or Moonbeam, with TWO YEARS of hindsight now. Can you help?

Astar uses Frontier with a small but important set of modifications, which are well documented, easy to apply to AssetHub, and hardly require a "feasibility study". There are TWO YEARS of Astar data to act as a "feasibility study" for AssetHub to basically mirror the same judgements (and basically the same from Moonbeam, and maybe a bit less for Acala, you know best). It would be absolutely bizarre to demand a feasibility study with this much history.

[Aside: I think it would be wonderful to have a "CoreEVM" update that addresses the CoreTime incompatibilities with Frontier so that a parachain could use EVM pallets as well. THIS would be a powerful feasibility study, I hope you can lead it and the whole ecosystem would benefit with a giant Frontier update! Call it CoreEVM! Or ETHCore -- That would be poetic =)]

@xlc
Copy link
Contributor

xlc commented Jan 30, 2024

With ED, it is not possible to have 100% EVM compatibility. Acala have ED and not 100% EVM compatibility. Moonbeam don’t and have it.

With Frontier, user will not be able to access EVM via light client. The EVM RPC doesn’t work with tools like Chopsticks.

They are just unsolved problems and everyone is making some trade offs. A study is absolutely required to understand the trade offs and then allow everyone to make a decision.

@sourabhniyogi
Copy link
Author

With ED, it is not possible to have 100% EVM compatibility. Acala have ED and not 100% EVM compatibility. Moonbeam don’t and have it.

With Frontier, user will not be able to access EVM via light client. The EVM RPC doesn’t work with tools like Chopsticks.

They are just unsolved problems and everyone is making some trade offs. A study is absolutely required to understand the trade offs and then allow everyone to make a decision.
I think its wonderful to characterize the decisions for AssetHub in terms of tradeoffs that the Fellows and hopefully (somehow) OpenGov can understand and vote on (somehow).

Since none of your above points are about CoreTime (still don't understand why you brought it up..), the tradeoff decisions concerning EVM + ink! are then about what specific choice AssetHub should make, which are extremely well informed by over two years from Polkadot's top 3 parachains [circa December 2021]. For the 2 parameters you brought up

  1. lower the ED further, from 0.01 DOT to 0. This would risks state bloat (cf Moonbeam-XEN) and 0.01 DOT is $0.07. I think this is a non-starter.
  2. adding light client support to Frontier. Someone can try to develop this, but not having light client support for Frontier will not affect the ability to add ink!/EVM pallets to AssetHub.

Concerning (1) and non-zero ED, is there some write up from Acala + Astar about how the non-zero ED choices differ that everyone can study to decision how AssetHub should make similar or different choices? I did not see much to go on here concerning design choices:
https://wiki.acala.network/integrate/acala/protocol-info#existential-deposit
https://wiki.acala.network/get-started/acala-network/acala-account
https://docs.astar.network/docs/learn/interoperability/xcm/building-with-xcm/send-xc20-evm/
Did Acala do a design tradeoff doc for its ED choices and EVM+ generally? If so, please share a link to it, we could learn from it!

Concerning (2), I am unfamiliar why requiring light support for Frontier should derail ink!/EVM support. Can you explain this in detail?

It is NOT essential to have 100.0% EVM Compatibility, but it IS essential to support the following use cases:

  1. Top defi: Uniswap v2/v3/v4, Curve, etc. for AssetHub's top 3 Assets: USDC, USDT, DOT.
  2. Polkadot Rollups for common Rollup platforms (OP STACK, Arbitrum Orbit, Polygon CDK)
    Both of the above have been tested on Moonbeam and Astar, so there is no technical blocker.

@xlc Can you itemize what parameters you would like to see characterized in a tradeoff study?

I think its really important to recognize which parameters are truly important and use the learnings from Astar+Acala to make the correct decisions for AssetHub.

@xlc
Copy link
Contributor

xlc commented Jan 30, 2024

We have this https://evmdocs.acala.network/general/about-acala-evm+ which may or may not answer all your questions but it explains some of the design process of Acala EVM+.

For the rest of the discussion, I would like to get back to step zero. I believe the goal for all of us is to solve some issues, which you have listed a few. But I don't think you want to add smart contracts to AH for the sake of adding it. We should explore all alternatives before deciding if a particular solution (i.e. the one you proposed) is the best one.

So please define the problem.

You have listed two items:

  1. Top defi: Uniswap v2/v3/v4, Curve, etc. for AssetHub's top 3 Assets: USDC, USDT, DOT.
  2. Polkadot Rollups for common Rollup platforms (OP STACK, Arbitrum Orbit, Polygon CDK)

For 1: Because you did not define exactly the requirements, so my solution to the problem that you have defined is simply use one of the existing EVM parachain. I know this answer does not satisfy you but let's iterate it from here. You could say my solution does not solve some specific use case and then we could try to change this alternative approach in such way to address the use case you proposed. It could totally be implementing smart contract in AH, but should not skip the intermediary steps or I am sure our maths teacher won't be happy.

For 2: There are lot more alternatives:

  • Use existing EVM chain
  • Build rollup pallet and
    • deploy to an existing chain
    • deploy to a new chain

@sourabhniyogi
Copy link
Author

We have this https://evmdocs.acala.network/general/about-acala-evm+ which may or may not answer all your questions but it explains some of the design process of Acala EVM+.

Cool, are all the parameters you would expect from feasibility study covered in Acala's detailed overview there? If not, what is missing?

For the rest of the discussion, I would like to get back to step zero. I believe the goal for all of us is to solve some issues, which you have listed a few. But I don't think you want to add smart contracts to AH for the sake of adding it. We should explore all alternatives before deciding if a particular solution (i.e. the one you proposed) is the best one.

So please define the problem.

https://github.com/polkadot-fellows/RFCs/pull/66/files#diff-43154a8feb555fdcfd4b6110bb9cb86172abc13ac3d5030629f54e37b0976d35R37-R89

summarizes the problem of (1)+(2) below. If you have questions in the RFC, please ask and I will clarify. Super happy to improve the motivation section, thank you!

You have listed two items:

  1. Top defi: Uniswap v2/v3/v4, Curve, etc. for AssetHub's top 3 Assets: USDC, USDT, DOT.
  2. Polkadot Rollups for common Rollup platforms (OP STACK, Arbitrum Orbit, Polygon CDK)

For 1: Because you did not define exactly the requirements, so my solution to the problem that you have defined is simply use one of the existing EVM parachain. I know this answer does not satisfy you but let's iterate it from here. You could say my solution does not solve some specific use case and then we could try to change this alternative approach in such way to address the use case you proposed. It could totally be implementing smart contract in AH, but should not skip the intermediary steps or I am sure our maths teacher won't be happy.

Again, the "Motivation" section of the RFC covers this topic. I did try to make it readable for both our math teacher and you =) Could you kindly review that?

For 2: There are lot more alternatives:

  • Use existing EVM chain
    To summarize the content of the RFC again:
    (a) FORCING async patterns onto developers and users for defi/nft applications is completely unnecessary in AssetHub.
    (b) Polkadot Rollups would trust a system chain over a parachain. A parachain could just disappear. And at the end of the day, we're here to improve the business of Polkadot, not the parachain. [I understand you might see differently.]

So, this alternative should be ruled out. Do you see differently?

  • Build rollup pallet and

    • deploy to an existing chain
    • deploy to a new chain

Blobs has the basics to serve Polkadot Rollups for a DA perspective, but converting all Rollup tech (OP, ARB, PolygonCDK) into rollup pallets is way too engineering intensive -- Thrum's shims model is just clearly better since it spares tons of engineering replication with little to gain. In contrast, adding EVM pallets to AssetHub is largely about making tradeoff decisions based on the history of successful EVM parachains -- I do agree reviewing the tradeoffs for AssetHub adding EVM+ink/Coreplay merits careful review of the EVM+ink/Coreplay parachains.

@sourabhniyogi
Copy link
Author

sourabhniyogi commented Feb 13, 2024

@joepetrowski (all) Is a separate "OpenEVM" SYSTEM chain (with the assetConversion pallet) -- approved by OpenGov Root Referendum -- a better way to address the need for Polkadot Rollups needing EVM?

https://twitter.com/giottodf/status/1757275333143707849

This keeps AssetHub purely doing ONE THING (yay!) and relegates the OpenEVM SYSTEM chain to do other things:

  • EVM (with DOT Revenues)
  • ED 0 (having the same issues as Moonbeam, aka "not scalable")
  • Polkadot Rollups with Blobs Chains

The underlying thesis is that DOT Revenues from OpenEVM SYSTEM chains would exceed that of the EVM Smart Contract parachains (Moonbeam + Astar).

Questions:

  • Is it possible to have 3x or 6x the number of cores assigned to an OpenEVM SYSTEM chain to enable 2s or 1s block times?
  • What would have to happen to enable this possibility?
  • If an OpenEVM chain is approved by Root Referendum to be a SYSTEM chain, what body governs changes to this system chain? Does it go through OpenGov processes or RFC processes? Is a OpenEVM Collective a suitable choice for an alternative to both OpenGov or RFC?
  • Another argument for EVM addition to AssetHub is to add better USDC support via Circle's CCTP contracts. Would this be better done under an OpenEVM system chain instead?

@joepetrowski
Copy link
Contributor

Is a separate "OpenEVM" SYSTEM chain (with the assetConversion pallet) -- approved by OpenGov Root Referendum -- a better way to address the need for Polkadot Rollups needing EVM?

Probably, yes. I'm discussing with some other Fellows the best way to essentially override the Fellowship RFC process in a way that doesn't take the single-proposal Root track, see polkadot-fellows/runtimes#184

Is it possible to have 3x or 6x the number of cores assigned to an OpenEVM SYSTEM chain to enable 2s or 1s block times?

Yes but that's a separate issue to "should the chain exist". It's purely a scheduling/core assignment problem, which really should be automated to scale with more load.

If an OpenEVM chain is approved by Root Referendum to be a SYSTEM chain, what body governs changes to this system chain? Does it go through OpenGov processes or RFC processes?

IMO this would be the Fellowship. The Fellowship has a mandate to maintain and develop the Polkadot protocol. Of course, people in the Fellowship have opinions about what should be (or not be) in the protocol, but a Root referendum that says unequivocally, "the network wants X feature", should be sufficient. The Fellowship works for the network. Of course, if what the network wants is wildly insecure or reckless, the Fellowship's job would be to try to stop it or at least not support it, and at the point it would come to someone else implementing the change and doing a non-Fellowship-endorsed release/upgrade.

Is a OpenEVM Collective a suitable choice for an alternative to both OpenGov or RFC?

I think that a new collective for this purpose is a terrible idea. We don't have a "Bridge Hub collective". Don't get me wrong, I love collectives and think they are hugely underutilized, but let's not make every single problem a nail and collectives a hammer. We already have a collective for the maintenance of the system, the Tech Fellowship, and I don't see why we'd need another Fellowship for the maintenance of a piece of the system.

Another argument for EVM addition to AssetHub is to add better USDC support via Circle's CCTP contracts. Would this be better done under an OpenEVM system chain instead?

I would much rather see a solution that does not put EVM on Asset Hub.

@burdges
Copy link

burdges commented Feb 15, 2024

Is a separate "OpenEVM" SYSTEM chain (with the assetConversion pallet) -- approved by OpenGov Root Referendum --

Who'd maintain this?

We've multiple external parachain projects who do this job now, so does one want them to merge? Or does someone want tresury funds to compete with them?

We do have folks doing EVM compiler work at Parity, presumably EVM->PolkaVM eventually. We should not bring the actual EVM chain work in-house at Parity or W3F of course.

a better way to address the need for Polkadot Rollups needing EVM?

You said "rollup" and "need" in the same sentence. Afaik all roll ups are pessimisations vs parachains in one of two senses, either zk roll ups need exterme CPU time costs, or else optimistic roll ups need long unlocking period, meaning rollups needs days or weaks of delay when sending messages. And optimistic roll ups have the same problem as nested relay chains that polkadot cannot validate parachain's off-chain concensus.

If someone wants a high-speed low-security chain, then we could do that in other ways, like cores with fewer approval checkers, but it still complicates messaging, which makes doing it messy.

In brief, we already have better tech for doing what rollups do, which makes them mostly pointless.

We can have parachains which also act like an optimistic roll up on another chain like ETH, but likely bridges superceed these. A fully EVM programable bridge maybe interests folks. A system EVM chain cannot facilitate these features.

@joepetrowski
Copy link
Contributor

Who'd maintain this?
We've multiple external parachain projects who do this job now, so does one want them to merge? Or does someone want tresury funds to compete with them?
We do have folks doing EVM compiler work at Parity, presumably EVM->PolkaVM eventually. We should not bring the actual EVM chain work in-house at Parity or W3F of course.

Like Rob said here, an RFC just says the "what". With sub-treasuries functioning now, it would make sense for people to apply for funding to implement approved RFCs.

Staying neutral to the EVM thing here, just saying that if the Root origin says "we want something", I'm sure there will be a way to make implementation happen.

@sourabhniyogi
Copy link
Author

sourabhniyogi commented Feb 15, 2024

Who'd maintain this?

An OpenEVM Collective, seeded with technical people deeply involved in improving Polkadot EVM technology

https://github.com/polkadot-evm/seeding

I would think this could have been in the Fellowship, but the Fellowship has a LOT of extremely complex feelings about EVM technology, as if its an unwanted bastard child, so it is SUPER clear that its valuable to give EVM people their own space rather than pretend the bastard doesn't exist. Pretending the EVM bastard doesn't exist is wrong. Polkadot can do EVM -- with all its bastardized synchrononous atomicity -- in its own way with its superior CORES. An OpenEVM collective distinctly committed to doing this with a full heart in a Polkadot-first way can do amazing things for the Web3 industry and I hope the Fellows can see one distinct from the Fellowship is valuable and either timely or long overdue.

We've multiple external parachain projects who do this job now, so does one want them to merge?

Interesting question, but... they already issued their own non-DOT token in all cases I know of, that would be insane because the idea is to bring far more DOT revenue instead.

Or does someone want tresury funds to compete with them?

The idea is to bring far more DOT revenue with (initially or permanently) treasury-funded CoreTime to demonstrate that Polkadot EVM tech is not just better in theory but in the marketplace, to compete not with other Polkadot parachains but with Arbitrum, Optimism, Avalanche et el. The "them" framing has to be not rooted in a Polkadot frame but in the broader Web3 ecosystem.

A serious % of all available cores (say, 8-16%, like 24 cores or 48 cores out of 300) can be allocated to 1-3 "OpenEVM" chains.

If Moonbeam/Astar is using 1 "core" and operating at 6s, my naive idea is that:

  • 2 cores on an OpenEVM chain would operate at 3s block production times
  • 3 cores on an OpenEVM chain would operate at 2s (like Optimism)
  • 6 cores on an OpenEVM chain would operate at 1s
  • 12 cores on an OpenEVM chain would operate at 0.5s
  • 24 cores on an OpenEVM chain would operate at 0.25s (like Arbitrum, approximately)

This block production time trick is widely used, and everyone who knows anything about optimistic rollups also knows that users pretty much forget about the 7 day window. A bunch of OpenEVM chains (plural, because we should retrofit XCM to this somehow surely) could take 48 cores and have different parameters with different gas/weight limits, while PolkaVM/CorePlay grows up to compete, something like this with 42 cores out of 300:

  • OpenEVM6 (6 cores) - 1s blocktimes
  • OpenEVM12 (12 cores) - 0.5s blocktimes
  • OpenEVM24 (24 cores) - 0.25s blocktimes

I should think existing EVM parachains would also want more cores in pretty much the same way in order to compete not with OpenEVM or each other but with the broader Web3 ecosystem. If they ask for OpenGov supported resources for the same number of 24-48 cores, they should offer similar amount of DOT revenue.

In brief, we already have better tech for doing what rollups do, which makes them mostly pointless.

Your conclusion is that Polkadot Optimisic Rollups with a "Blobs" chain and Optimism and Arbitrum shims with Polkadot DA would suck in the same way as Optimism and Arbitrum, right? (Not 100% sure) Ok, if we can replicate the above tricks with more cores in a set of OpenEVM chains (where DOT revenue accrues to Polkadot Treasury, and not with EVM parachains with their own token), we can scrap Polkadot Rollups. Can you kindly explain "cores with fewer approval checkers" to us and help us get beyond the above naive idea/ improve it in a OpenEVM+CoreTime combined world?

So now that Polkadot 2.0 is virtualizing VMs themselves in work packages, for Polkadot EVM chains to compete in the broader Web3 marketplace (not in "we have better tech", I mean like in terms of TVL, marketcap, TPS vanity metrics, etc.), we should utilize the full power of CORETIME+Frontier [or whatever is better]. Can we agree on this?

Whether OpenEVM chains NEED to be system chains can be decided by OpenGov, I don't think users really can see it. But Circle+Tether+CEXes see the difference clearly. They clearly see system chains like AssetHub with EVM powers totally different from non-system chains with EVM powers. For a key multi-ecosystem feature like USDC CCTP, its a massive loss for Polkadot to not have CCTP somewhere, and I don't see a coherent plan for this. The hope might be, however, that with a lot of talented people in an OpenEVM collective an equivalent credibility would exist for OpenEVM chains. Then the OpenEVM chains would be taken as seriously by Circle+Tether+CEXes if they weren't system chains. Anyone who looks would see the "asset related" functionality of OpenEVM chains as being the shadow AssetHub, kind of subversive.

@gonzaloetjo
Copy link

Everytime a core consumer / parachain / external agent develops a widely used tool, will we discuss if Polkadot should subsidize it into it's "common goood" space?

Polkadot has a specific job, and bringing overhead costs (maintenance) and production costs (block-space) up should be carefully considered.

The question is if EVM makes the cut. Avalanche c-chain shows that it might.

@xermicus
Copy link

xermicus commented Mar 27, 2024

I think the scope should be reduced or broken up to just concern the contracts pallet. The contracts pallet integrates well and doesn't need ETH compatiblity layers, it is audited and used in production already by many parachains. Devs can write contracts using Rust, TypeScript and a Solidity dialect.

I don't understand what EVM and "rollups" have to do with making asset hub programmable in permission less way per se. I doubt it's inherently needed and if so it can be added later, in an incremental fashion. I feel that by reducing the scope this RFC is a) more likely to succeed and b) much faster to be actually delivered.

@burdges
Copy link

burdges commented Mar 28, 2024

I'd think https://forum.polkadot.network/t/contracts-update-solidity-on-polkavm/6949 supersedes this RFC, given polkavm contracts should definitely work.

@xermicus
Copy link

I'd think https://forum.polkadot.network/t/contracts-update-solidity-on-polkavm/6949 supersedes this RFC, given polkavm contracts should definitely work.

Yes, and the target runtime likely won't diverge much from contracts as it is today. It'll take some time to get everything production ready though. In the meantime we could already test the waters on Kusama..

@sourabhniyogi
Copy link
Author

sourabhniyogi commented Mar 28, 2024

I think the scope should be reduced or broken up to just concern the contracts pallet. The contracts pallet integrates well and doesn't need ETH compatiblity layers, it is audited and used in production already by many parachains. Devs can write contracts using Rust, TypeScript and a Solidity dialect.
I feel that by reducing the scope this RFC is a) more likely to succeed and b) much faster to be actually delivered.

Excellent. I'll make the change based on
https://forum.polkadot.network/t/contracts-update-solidity-on-polkavm/6949
and resubmit.

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.

8 participants