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

Content directory meeting summary #1925

Closed
Lezek123 opened this issue Dec 15, 2020 · 2 comments
Closed

Content directory meeting summary #1925

Lezek123 opened this issue Dec 15, 2020 · 2 comments

Comments

@Lezek123
Copy link
Contributor

Open questions

  • Which substrate version we need in order to have a stable evm pallet?

  • Should we include full Frontier functionality in our runtime, with ethereum and ethereum-rpc modules? (it would certainly have a lot of benefits on the frontend side as described in Smart contracts content directory - implementation plan #1816)

  • How does the runtime process ethereum transactions / blocks in case we use Frontier?

    • are ethereum transactions converted into substrate extrinsics?
    • since the ethereum transactions need to be signed it seems we cannot directly conntect them to a substrate accounts (I think substrate account owner does not own the private key to associated ethereum account). Should we have the ability to deposit from substrate account to any choosen evm account?
    • do ethereum blocks exist "separately" from substrate blocks - how they relate to each other how it affects the consensus?
  • how are the weights computed for extrinsics like evm.call where the execution cost depends on the contract logic that lives inside the evm?

  • who should pay the cost of gas consumed by runtime "hooks" that execute smart contract methods (ie. when registering new member)?

  • since the council (or initially - sudo) can set any bridge contract address, can we avoid the possibility of breaking the runtime by setting a broken / malicous bridge contract address? (the runtime will try to call into it, for example, during member creation). If not - should the proposal stake in that case be close to that of a runtime upgrade?

  • should we include any new proposals allowing the council ie. to initialize bridge contract with existing members or will we only rely on sudo in the initial phase? What if we need to split the initialization into multiple blocks?

Contracts implementation - issues in scope for initial release:

Contracts implementation - issues out of scope for initial release

@ondratra
Copy link
Contributor

  • Which substrate version we need in order to have a stable evm pallet?

EVM pallet can be used with both Substrate we are using in Babylon and Olympia releases. Frontier's RPC compatibility is yet to be confirmed.

Yes, we should. It will enable interaction with Metamask and other tools.

  • How does the runtime process ethereum transactions / blocks in case we use Frontier?
    • are ethereum transactions converted into substrate extrinsics?

Ethereum transactions can be created from Substrate code (via extrinsic or inner logic). Also, Ethereum transactions can be received via Ethereum RPC (provided by Frontier).

    • since the ethereum transactions need to be signed it seems we cannot directly conntect them to a substrate accounts (I think substrate account owner does not own the private key to associated ethereum account). Should we have the ability to deposit from substrate account to any choosen evm account?

In our implementation, Substrate account ids are associated with the Ethereum addresses. If you control the account with id 000...001, you also control address 0x00...01 and vice versa. The only downside is that a bigger set of account ids (32 bytes) are mapped into a smaller set of Ethereum addresses (20 bytes), so multiple account ids are controlling the same address. But the 20 bytes number is so high that it shouldn't matter as account ids collision is improbable. Ethereum private keys are also 32 bytes long and are mapped into the same 20 bytes addresses, so this shouldn't be a problem for us as well.

    • do ethereum blocks exist "separately" from substrate blocks - how they relate to each other how it affects the consensus?

Blocks are executed in a virtual environment inside of Substrate. The currency is handled by native Substrate currency (there is no separate Ethereum currency), block info is stored into native logs, and contract code/state is saved into Substrate storage. Consensus shouldn't be affected because it is still achieved via rules written in Substrate.

  • who should pay the cost of gas consumed by runtime "hooks" that execute smart contract methods (ie. when registering new member)?
    Transaction sender is paying the gas fee from the only currency that exists. We can donate this currency to anyone so we can make some transactions free or subsidized if we need it. There is no extra payment for miners/validators for executing EVM.
  • since the council (or initially - sudo) can set any bridge contract address, can we avoid the possibility of breaking the runtime by setting a broken / malicous bridge contract address? (the runtime will try to call into it, for example, during member creation). If not - should the proposal stake in that case be close to that of a runtime upgrade?

It depends on how we can say that some contract is broken. We can programmatically check that contract fulfills some interface. We could maybe run some test inside another "Testing" smart contract, but other than that, we would need some consensus mechanism - maybe referendum or "second council". This seems like Quis custodiet ipsos custodes problem. I'll create a new issue for this.

  • should we include any new proposals allowing the council ie. to initialize bridge contract with existing members or will we only rely on sudo in the initial phase? What if we need to split the initialization into multiple blocks?

This is yet to be researched/decided.

@bedeho
Copy link
Member

bedeho commented Jan 15, 2021

The one thing still missing, which is quite important, is if the runtime calls a contract in the EVM,

  1. where does the gas price come from and from what account is the ETH/JOY deducted to pay for the gas?
  2. how do we properly assign weight to the runtime code which triggers this call?

@bedeho bedeho closed this as completed Apr 14, 2022
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

No branches or pull requests

3 participants