Skip to content

Commit 48a7abb

Browse files
authored
Track disimprovements pallet-revive made for ink! (#2600)
* Add disimprovements `pallet-revive` made for ink! * Update text * Update text
1 parent 413bbf3 commit 48a7abb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ARCHITECTURE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,24 @@ the contract macro ([documentation here](https://use-ink.github.io/ink/ink/attr.
221221
__Important:__ If a developer writes a contract for a chain that deviates
222222
from the default Polkadot SDK types, they have to make sure to use that
223223
chain's `Environment`.
224+
225+
## Design decisions in `pallet-revive` that make it harder for ink!
226+
227+
Parity made a couple changes when forking `pallet-revive` from `pallet-contracts`, which
228+
make things harder/less performant for ink!.
229+
230+
We are tracking these changes here because they make it easier to understand the codebase.
231+
In the future, this list could also be used to improve the performance of ink! running
232+
on `pallet-revive`, if Parity is open to it.
233+
234+
(1) Individual host functions were migrated to pre-compiles. Instead of being able to
235+
just call into the host, these functions now have the performance overhead of calling
236+
into another contract. Functions throughout ink! are affected by this.
237+
238+
(2) The builtin pre-compiles don't support SCALE encoding, but instead expose only a
239+
Solidity interface. As ink! natively uses SCALE encoding we are required to
240+
re-encode arguments into the bloated Solidity ABI encoding, as well as decode them.
241+
242+
(3) `pallet-revive` uses two types for a contracts balance: the generic `Balance` (which
243+
is set in the chain configuration) and the Ethereum-native `U256`. Currently users of
244+
ink! have to deal with both types as well.

0 commit comments

Comments
 (0)