-
Notifications
You must be signed in to change notification settings - Fork 2.6k
contracts: Refactor the runtime API in order to simplify node integration #7409
Conversation
If the runtime upgrade and the client upgrade are done together, there shouldn't be any problem. Otherwise, there will be always a period of time until both are in sync to make it work again. |
Co-authored-by: Andrew Jones <ascjones@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than some minor formatting grumbles, looks great!
bot merge |
Waiting for commit status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Checks failed; merge aborted. |
bot merge |
Waiting for commit status. |
* Use substrate dependencies from master * Cargo update * Fix up compiler errors * Update Cargo.lock * Update contract call rpc api boilerplate. Rel paritytech/substrate#7409 * Fix up service * Update runtime * Update README
Currently, in order for a node to implement the contracts runtime api it is necessary to copy paste some conversion logic:
This PR reduces it to:
It does this by moving common types to the
pallet-contracts-primitives
crate and by that removing the need for intermediate types that made those conversions necessary.I think this is important because this conversion logic is duplicated in every runtime and is also part of a tutorial that can be simplified by doing so (@danforbes @wheresaddie).
Because this modifies a runtime API a client update is necessary. This API is only used by a the
contracts_call
RPC and is therefore not critical: It is only relevant for public RPC nodes. Nonetheless I bumped the priority to medium to signal that a client update is necessary to restore this RPC functionality.