Frontier plus unified accounts#26
Conversation
This reverts commit 37d2d58.
|
Okay, so now CI is failing because |
That's quite a chain reaction 😅 - I don't JS so I cannot help here, but maybe a step back is in order:
|
…ractions instead of cargo contract
Our chain will host two smart contract platforms (pallet-evm and pallet-contracts). Pallet evm requires a 20byte ethereum-style account id. It is not just a limitation of the pallet either; this accountid type is hard-coded all the way down to the vm level; it is part of the evm semantics. On the other hand, Substrate and pallet-contracts have a nice flexible design that is generic over the account id. Knowing only this, the choice to use the ethereum-style accounts everywhere is the obvious one. It gets tricky when you consider that most real chains that host pallet-contracts use the "normal" @notlesh pursued this strategy in #9 and you can explore it for yourself. The advantage is that all the pallet-contracts tools will work like they always do. The downside is that it requires student users (some of whom are new to blockchain) to understand and interact with this account mapping while we are trying to focus on writing and interacting with contracts. So the question in my mind is What will hinder users more, the account mapping, or reduced tooling for pallet-contracts. This brings us to your next point
Yes, I have hacked on two important tools in the pallet-contracts ecosystem. The Contracts-UI: issue, PR: I have this basically working. Ideally the maintainers would help us put a nice user-setting on it, but worst case, I can host this ui with my small patch and it will work. This was relatively simple because it is based on polkadot-js which already has full support that is used in production for ethereum signatures. Cargo Contract: issue, PR: The compilation, testing, project-scaffolding stuff is all working as usual, but the stuff about interacting with the chain is not. I made an attempt in my PR, but I don't feel very close. This is based on sub-xt which appears to be generic over signature type, but I don't know whether any non In my opinion, the contracts ui is enough for interacting with the chain, and I would prefer to keep the ethereum-style accounts. I think this shows off Substrate's flexibility, and is a good chance to encourage ecosystem tools to support the same genericity as Substrate. However, I value your onpinions as well. |
In my experience contracts-ui and such "manual" tools are good for one-off, simple cases, yet once there are multiple contracts involved in case of non-trivial deployments, or simply to reduce tedious repetitions you'd want to script some automation. Adding on more tool to the mix breeds a bunch of problems, e.g. having a node.js instance, pulling node-modules, dockerizing for reproducibility across OS's and environments .. Even if you harness polkadot/js for the deployment of the contracts, one will still have to use cargo-contract - for compiling them. YMMV, but there is value in having a one-stop-shop for all of the above tasks (one of a big selling points of the Rust itself is The above is just my 2 cents about using polkadot/js, I don't have a strong opinion on the address type issue, if it can be achieved in a relatively painless manner & without a significant overhead than why not. But if it drags on too long or proves to be a rabbit hole than it's not worth the effort IMO. |
|
@notlesh Does this PR (or your original) contain the self-contained transaction type? https://paritytech.github.io/frontier/rustdocs/fp_self_contained/index.html If not, that may affect metamask-like tools. We should address that in a follow-up. |
Good catch, it does look like that's missing. I opened #35 for this. |
Co-authored-by: Stephen Shelton <steve@brewcraft.org>
…-frontier-plus-unified-accounts" Joshy found the docs at https://git.github.io/htmldocs/howto/revert-a-faulty-merge.html very helpful in this process. This reverts commit 00baa0f, reversing changes made to c207fc5.
This PR combines the work from both #9 and #20
I really hope that this unified account path will work out. My biggest question right now is whether it will work with pallet contracts and its associated tooling.
Update: This works with the contracts-ui as long as this patch is applied!