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

Adding smart contracts functionality to the Coretime chain #96

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

poppyseedDev
Copy link
Contributor

This RFC proposes adding smart contracts to the Coretime chain using platforms like Ethereum’s Solidity or Polkadot's Ink!. This will support automated region trading, dynamic pricing, and other advanced functionalities, expanding the chain's capabilities and fostering innovation. This suggestion follows discussions in PR #94.

@chungquantin
Copy link

To expand more on this, wonder why don't we just create a new Contract Hub system parachain that is ready to XCM any other system parachains in the ecosystem? I saw there is a proposal for expanding the functionalities of the Asset Hub via contract execution as well: https://polkadot.subsquare.io/referenda/885 and I saw this is a conflict of interests while we keep making the system parachains more complicated instead of simplifying the way other L1 parachains can XCM to these system parachains.

Let me know if this is not a correct place to start a further discussion.

@eskimor
Copy link

eskimor commented Jun 20, 2024

In my mind the complication this brings to coretime is mostly integrating one more pallet. While if we not do this, we push the complexity to the developers of smart contracts. People are working on making XCM easier and better integrated/accessible to smart contracts/ ...., but it will nevertheless always be a bit more complex than just calling a function, it will always stay asynchronous, it will always be much slower and it will always be of higher cost. Therefore it makes sense to stay on a chain where you can and only go cross chain when there is an actual need. E.g. getting funds to the Coretime chain to interact with the market.

@athei
Copy link

athei commented Jun 26, 2024

I am in favour of this. I think asking contract developers to deal with XCM is a big ask when there is essentially no need for this. Sharding is a tool for scalability but we are not there, yet. It is good that we have XCM once sharding is useful, though.

text/00xx-smart-contracts-coretime-chain.md Outdated Show resolved Hide resolved
text/00xx-smart-contracts-coretime-chain.md Outdated Show resolved Hide resolved
## Testing, Security, and Privacy

### Testing
- Comprehensive unit tests and integration tests should be developed to ensure the correct functionality of smart contracts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems outside the scope of the RFC, since by definition we can't control what contracts people deploy. Could you clarify to state that the tests should cover the functionality of the contract virtual machine and interactions that it can have with the rest of the runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joepetrowski thanks for catching that. By this I meant that there need to be tests that ensure that the broker pallet functionality that is for example exposed to the smart contracts has doesn't pose any vulnerabilities.

Comment on lines +70 to +72
### Performance
- The introduction of smart contracts may impact performance due to the additional computational overhead.
- Optimization techniques, such as efficient gas fee mechanisms and resource management, should be employed to minimize performance degradation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be pretty easy to mitigate by giving contracts a custom DispatchClass and limiting how much of the block they can consume, so we ensure some amount is always reserved for "core" Coretime functionality.

poppyseedDev and others added 2 commits July 20, 2024 11:18
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
@poppyseedDev
Copy link
Contributor Author

Seems like the sentiment is overall positive for this proposal, could we maybe proceed with the voting process?

@@ -0,0 +1,102 @@
# RFC-0002: Smart Contracts on the Coretime Chain
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# RFC-0002: Smart Contracts on the Coretime Chain
# RFC-0096: Smart Contracts on the Coretime Chain

| | |
| --------------- | ------------------------------------------------------------------------------------------- |
| **Start Date** | 2024-06-09 |
| **Description** | Implement smart contracts on the Coretime chain |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| **Description** | Implement smart contracts on the Coretime chain |
| **Description** | Integrate smart contracts with the Coretime chain |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File name should be 0096, not 00xx

@polkadot-fellows polkadot-fellows deleted a comment from paritytech-rfc-bot bot Aug 9, 2024
@athei
Copy link

athei commented Aug 9, 2024

I think the RFC should specify that we want to deploy the same pallet that we deploy on AssetHub for contract execution. While this seems to be implied it should be explicitly stated in my opinion. This is important to make sure that we don't end up with two incompatible solutions and set of toolings.

In this scenario runtime functionality will be exposed via pre-compiles. I assume that there will just be a different set of pre-compiles on AssetHub vs. Coretime. From the point if view of Solidity developers it is just a different set of .sol interface files they can make use of.

Seems like the sentiment is overall positive for this proposal, could we maybe proceed with the voting process?

Once the open suggestions are addressed I can propose it.

@anaelleltd anaelleltd added the Proposed Is awaiting 3 formal reviews. label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposed Is awaiting 3 formal reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants