pendulum-chain/pendulum

Extract `chain_extension` implementation and re-use it in all runtimes

Closed this issue · 6 comments

ebma commented

We want to use the same chain_extension implementation in all our runtimes. In order not to duplicate any code, we should extract the implementation of the chain_extension into another directory, similar to what Astar did here, and re-use that in each runtime.

To add a bit more structure, we can even split our current chain extension into two sub-parts: a 'token-extension' which is comprised of the functions with ID 1100-1199 and a 'price-extension' which consists of functions with ID 1200-1299. Astar also found a way to use register three chain extensions at the same time, see here.

ebma commented

@pendulum-chain/product this ticket should be prioritized soon. Having this for before Nabla launch would be good, because otherwise we have to duplicate code once we want to use our Solidity wrapper contract solution also on Pendulum.

@prayagd @ebma can we move this ticket to Ready? Any reason why not?

ebma commented

We can move it already but should only work on it once #356 is merged.

@ebma just to check this is important for the Nabla mainnet launch right?

ebma commented

It's a chore and so is not a stopper for anything. It's about refactoring some code and wouldn't add or remove any functionalities. We should still do it eventually and I wouldn't like to have it in the icebox.