xermicus
a07968205b
llvm-context: modularize compiler builtin functions ( #234 )
...
- Add the revive runtime function interface to minimize boiler plate
code.
- Outline heavily repeated code into dedicated functions to bring down
code size.
- The code size tests builds optimized for size.
- Function attributes are passed as slices.
This significantly brings down the code size for all OpenZeppelin wizard
contracts (using all possible features) compiled against OpenZeppelin
`v5.0.0` with size optimizations.
|contract|| `-Oz` main | `-Oz` PR || `-O3` main | `-O3` PR |
|-|-|-|-|-|-|-|
|erc1155.sol||100K|67K||114K|147K|
|erc20.sol||120K|90K||160K|191K|
|erc721.sol||128K|101K||178K|214K|
|governor.sol||226K|165K||293K|349K|
|rwa.sol||116K|85K||154K|185K|
|stable.sol||116K|86K||155K|192K|
On the flip side this introduces a heavy penalty for cycle optimized
builds. Setting the no-inline attributes for cycle optimized builds
helps a lot but heavily penalizes runtime speed (LLVM does not yet
inline everything properly - to be investigated later on).
Next steps:
- Modularize more functions
- Refactor the YUL function arguments to use pointers instead of values
- Afterwards check if LLVM still has trouble inline-ing properly on O3
or set the no-inline attribute if it does not penalize runtime
performance too bad.
2025-02-25 16:47:01 +01:00
xermicus
89cdfefab4
remove some dead code leftovers ( #218 )
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2025-02-19 10:41:32 +01:00
xermicus
cb268850a9
llvm-context: remove the linear memory pointer indirection ( #211 )
2025-02-13 13:21:43 +01:00
xermicus
60fc09f787
llvm-context: disable call re-entrancy for send and transfer ( #196 )
2025-02-06 16:49:50 +01:00
xermicus
157647d5c1
remove superfluous warning and clippy allows ( #194 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2025-02-05 12:44:29 +01:00
xermicus
bfda465c32
remove support for legacy evm assembly ( #186 )
2025-02-03 14:13:43 +01:00
xermicus
1a8a7926e9
implement the coinbase opcode ( #179 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2025-01-29 15:24:45 +01:00
xermicus
3608a5a143
runtime-api: pass call arguments in registers instead of spilling to stack ( #174 )
...
Companion to paritytech/polkadot-sdk#7319
Signed-off-by: xermicus <cyrill@parity.io >
2025-01-28 12:45:54 +01:00
Cyrill Leutwiler
3e7579580b
vet workspace dependencies ( #163 )
...
- Update the used workspace dependencies.
- Remove the unused workspace dependencies.
- Add the machete CI workflow.
2025-01-15 20:14:54 +01:00
Cyrill Leutwiler
ad805543b3
call and create set uncapped resource limits ( #161 )
...
- polkadot-sdk#6890 companion
- Adjust the gas price constant for the required polkadot-sdk version as a drive-by
2025-01-15 17:32:31 +01:00
Cyrill Leutwiler
d8752ec6b5
the basefee opcode ( #142 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-12-19 18:59:10 +01:00
Cyrill Leutwiler
6ad846a285
the base fee opcode ( #141 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-12-19 12:44:15 +01:00
Cyrill Leutwiler
3f9771f838
update and fix the linker ( #140 )
2024-12-18 23:11:06 +01:00
Cyrill Leutwiler
22070a824d
the gas limit opcode ( #139 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-12-18 20:31:42 +01:00
Cyrill Leutwiler
d299dd1a19
change getters to register version ( #138 )
2024-12-18 17:56:37 +01:00
Cyrill Leutwiler
14a598e840
implement the gas opcode ( #136 )
2024-12-18 17:19:32 +01:00
Cyrill Leutwiler
909de515c4
Allow arbitrary call data size ( #135 )
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-12-18 14:04:46 +01:00
Cyrill Leutwiler
2cb8f82266
calls: supply max ref_time and proof_size limits ( #133 )
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-12-10 16:31:44 +01:00
Cyrill Leutwiler
6f2f158ef1
fix new clippy lint ( #132 )
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-12-10 15:24:25 +01:00
Cyrill Leutwiler
f0d9d44dce
Implement the gasprice opcode ( #127 )
2024-11-29 17:14:27 +01:00
Cyrill Leutwiler
7c00bbb0fc
remove unneeded utils ( #125 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-11-29 16:21:24 +01:00
Cyrill Leutwiler
423a494621
Switch target to 64bit and enable the zbb feature ( #120 )
2024-11-29 15:56:10 +01:00
Ermal Kaleci
01b5ed5ba3
Implement delegate_call ( #80 )
2024-11-23 18:05:21 +01:00
Cyrill Leutwiler
dbb47fd13e
experimental: support for debug info ( #118 )
...
Signed-off-by: wpt967 <matt.aw@parity.io >
Signed-off-by: xermicus <cyrill@parity.io >
2024-11-22 08:56:09 +01:00
Cyrill Leutwiler
87f2bcefb3
dump the elf shared object into the debug output directory ( #119 )
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-11-21 21:48:42 +01:00
Cyrill Leutwiler
6a120463c2
implement the blockhash opcode ( #114 )
2024-11-15 13:11:04 +01:00
Cyrill Leutwiler
f947984671
update 64bit target flags ( #113 )
2024-11-14 10:29:21 +01:00
Cyrill Leutwiler
37ab2b6782
declare immutable globals during in declare ( #108 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-10-31 12:07:39 +01:00
Cyrill Leutwiler
43d2ef3ce9
implement the code size opcodes ( #107 )
2024-10-31 11:46:47 +01:00
Cyrill Leutwiler
5b3b90db83
support the origin opcode ( #103 )
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-10-29 18:40:25 +01:00
Cyrill Leutwiler
a4043ecde7
update LLVM target features ( #102 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-10-29 18:17:29 +01:00
Ermal Kaleci
aae25107a2
support full storage key space ( #100 )
...
- The storage pointer values will no longer be truncated to the register size, allowing for the use of arbitrary storage keys
- Failed storage value reads will now guarantee to return the zero value
2024-10-28 10:18:11 +01:00
Ermal Kaleci
ee83d28a51
Implement extcodehash ( #77 )
2024-10-21 10:13:50 +02:00
Cyrill Leutwiler
82ae22c163
tidy up the runtime API crate ( #85 )
...
- remove unused runtime API imports and constants
- move runtime api symbols into the revive-runtime-api crate
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-10-17 10:55:27 +02:00
Cyrill Leutwiler
f0f344a139
disable sbrk and emulate EVM linear memory internally ( #76 )
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
Signed-off-by: xermicus <cyrill@parity.io >
2024-10-14 15:20:00 +02:00
Ermal Kaleci
adda5a0f12
improve runtime api return value names ( #81 )
2024-10-14 08:56:26 +02:00
Ermal Kaleci
d9842b5427
Fix implementation for balance_of ( #79 )
...
The balance_of syscall is now available in pallet-revive.
- Fix balance_of implementation to use correct runtime api
- Add build_address_argument_store helper to be used for address arguments
2024-10-12 12:35:10 +02:00
Cyrill Leutwiler
6335c34a2b
remove obsolete runtime builtins
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-10-11 15:58:28 +02:00
Cyrill Leutwiler
49d2157a84
remove near calls
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-10-11 15:58:28 +02:00
Cyrill Leutwiler
e131eebf50
remove system mode and request memoization
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-10-11 15:58:28 +02:00
Cyrill Leutwiler
d5d419cefc
implement immutable variables codegen ( #70 )
2024-10-10 13:33:00 +02:00
xermicus
b344e0cff5
Revert "implement immutable variables codegen"
...
This reverts commit 0e6a6d12c3 .
2024-10-09 03:43:05 +02:00
xermicus
0e6a6d12c3
implement immutable variables codegen
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-10-09 03:37:56 +02:00
Cyrill Leutwiler
6585973e99
Updated call semantics ( #56 )
...
- Update pallet-revive dependency
- Implement calls according to pallet-revive call semantics
- Switch to the new return data API in pallet revive and get rid of return data buffer
- Remove a bunch of resulting dead code
2024-09-28 20:03:03 +02:00
Cyrill Leutwiler
066acc4663
set chain_id in test runtime
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-09-28 19:17:41 +02:00
Cyrill Leutwiler
287272b789
sync runtime with the pallet ( #54 )
2024-09-24 09:14:36 +02:00
Cyrill Leutwiler
72d958392b
revise alloca at function entry later
...
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com >
2024-09-16 12:42:50 +02:00
Cyrill Leutwiler
616f044633
always build alloca in the entry block ( #46 )
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-09-13 21:54:42 +02:00
xermicus
7dc8e6051e
enable compressed instructions extension
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-09-13 14:55:16 +02:00
xermicus
0f2b55f6ff
fixed output size for transferred value
...
Signed-off-by: xermicus <cyrill@parity.io >
2024-09-13 08:41:23 +02:00