Commit Graph
350 Commits
Author SHA1 Message Date
xermicus d1c00c2147 support solc v0.8.36 (#572)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-07-10 12:06:11 +02:00
xermicus e7c761c068 new clippies (#571)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-07-10 10:43:36 +02:00
xermicusandClaude Opus 4.8 16c255bf18 Fix/ny unaligned store fmp oog (#566)
Bug found by @jubnzv:

`--newyork`: an unaligned `mstore` corrupting the free-memory-pointer
word let a later store through the corrupted pointer silently succeed
where EVM runs out of gas.

---------

Signed-off-by: xermicus <bigcyrill@hotmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 09:13:59 +02:00
xermicusandClaude Opus 4.8 61b7ab8521 Fix/ny fn native fmp oog (#567)
Bug found by @jubnzv:

`--newyork`: a full-width value stored to the free-memory-pointer slot
(e.g. a function parameter `>= 2^64`) was narrowed to 64 bits, inserting
a checked truncation that consumed all gas.

---------

Signed-off-by: xermicus <bigcyrill@hotmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 17:41:05 +02:00
xermicusandClaude Opus 4.8 e2e6514953 Fix/ny msize dse expansion (#565)
Bug found by @jubnzv:

`--newyork`: dead-store elimination could drop a store whose memory
expansion an intervening `msize()` observes, so `msize()` read a stale
(unexpanded) value.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 16:31:01 +02:00
9adfd9db24 Fix/ny dynamic calldatacopy fmp (#564)
Bug found by @jubnzv:

`--newyork`: a `calldatacopy`/`codecopy`/`returndatacopy` to a dynamic
destination that could overwrite the free-memory-pointer word truncated
a subsequent `mload(0x40)` to `0`.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Agent <agent@local>
2026-07-08 15:44:11 +02:00
xermicusandClaude Opus 4.8 da547e9dd9 Fix/ny dse overlapping load (#563)
Another bug found by @jubnzv:

`--newyork`: dead-store elimination could drop a store that a later
overlapping unaligned `mload` reads, returning zeroed memory instead of
the stored bytes.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 09:12:30 +02:00
xermicusandClaude Opus 4.8 c18d29b861 Fix/ny unaligned mload native byteorder (#562)
Another bug found by @jubnzv:

`--newyork`: an unaligned full-word `mload`/`mstore` overlapping a word
kept native (little-endian) by the heap optimization returned
byte-swapped bytes.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 19:38:21 +02:00
xermicus 9b177f6400 Fix NY codegen wth folded guard + inlined for-loop (#561)
Fixes a ICE wth folded guard in inlined for-loop in NY.

Closes #560

---------

Signed-off-by: xermicus <bigcyrill@hotmail.com>
2026-07-06 12:37:55 +02:00
LJ 5b92391c57 Restore resolc long version onto standard JSON and combined JSON output (#557)
## Description

The resolc long version stopped being populated on the standard JSON and
combined JSON output. This PR restores these fields and populates them.
2026-07-02 15:10:26 +02:00
xermicus 541955d31b add integration test for i32 operand overflow in PVM linker const fold (#552)
Closes #551

---------

Signed-off-by: xermicus <cyrill@parity.io>
2026-06-25 18:01:54 +02:00
xermicus fb0e9e6a30 release resolc v1.3.0 (#548)
## v1.3.0

Supported `polkadot-sdk` rev: `2604.2.0`

### Added

- The newyork IR code size optimization pipeline, selectable via the
`--newyork` CLI flag or the `settings.polkavm.newyork` standard JSON
input field.
This can reduce code size by up to 50%. Considered a new and
experimental feature, switched off by default.
[#519](https://github.com/paritytech/revive/pull/519)

### Changed

- The latest supported `polkadot-sdk` version is now `2604.2.0`

Signed-off-by: xermicus <cyrill@parity.io>
2026-06-19 11:50:41 +02:00
xermicus d7407fe138 remove ambiguous ny opt configuration (#550)
Otherwise the std json input settings aren't succint.

Signed-off-by: xermicus <cyrill@parity.io>
2026-06-18 19:12:27 +02:00
98d818f958 The new Yul optimizer toolkit (#519)
This PR introduces powerful code size optimizations. This is achieved
with an additional IR layer in between Yul and LLVM IR. It works quite
well (see below for a comparison) because it captures optimization gains
that neither solc nor LLVM can realize.

The feature is gated behind `--newyork` or a corresponding standard JSON
input setting and **off by default**.

### How it works

We implemented an SSA IR modelled after or inspired by the [MLIR SCF
dialect](https://mlir.llvm.org/docs/Dialects/SCFDialect/). Yul is
translated into this IR and the IR implements mainly the following
optimizations:

- **Type narrowing**: narrows 256-bit values to I1..I160 where provable
(bidirectional + interprocedural), so LLVM emits native 32/64-bit ops
instead
    of software 256-bit arithmetic.
- **FMP range proof**: exposes the `mload(0x40) < heap_size` bound to
LLVM
IPSCCP, eliminating trailing overflow checks on FMP-derived offsets.
Single
    largest code-size contributor.
- **Heap analysis**: skips big-endian byte-swaps where native
little-endian
    layout is safe.
  - **mem_opt / keccak fusion+folding**, **compound outlining** (mapping
sload/sstore), **guard narrowing**, **inlining** tuned for PolkaVM, and
    **exact + fuzzy function dedup**.

### Results
The optimizations implemented with the newyork IR bring substantial code
size improvements.
  - Integration contracts: approximately **-20% to -50%** code size.
  - OpenZeppelin Wizard corpus: around **-47%** code size.

This table shows the code size improvements on various OpenZeppelin ERC
implementations, taken from their [contracts
wizard](https://wizard.openzeppelin.com/), with almost all features
enabled.

| Contract | Default: (bytes) | With `--newyork`: (bytes) | Reduction |
|---|---:|---:|---:|
| erc1155 | 59,206 | 30,649 | -48.2% |
| erc20 | 81,697 | 42,893 | -47.5% |
| erc721 | 92,052 | 49,423 | -46.3% |
| oz_gov | 141,861 | 81,159 | -42.8% |
| oz_rwa | 77,274 | 37,975 | -50.9% |
| oz_simple_erc20 | 29,950 | 16,554 | -44.7% |
| oz_stable | 82,117 | 39,032 | -52.5% |
| **Total** | **564,157** | **297,685** | **-47.2%** |

We believe this to be a reasonably representative dataset and conclude
that the newyork IR achieves drastic code size reductions on real world
dApp implementations.

### Methodology, security and runtime performance

Since the main contributors to these improvements are the FMP range
proofs and the type narrowing, we don't expect big runtime performance
regressions (it may even benefit runtime performance in some cases).

The PR also includes docs
(`book/src/developer_guide/newyork_{optimizer,ir}.md`) and many new
integration tests, including regression tests for known FMP soundness
traps.

The PR was authored collaboratively and reviewed extensively by the
`revive` maintainers, as well as Claude Opus, Claude Fable, Qwen,
Minimax and Deepseek LLMs, over a span of many months.

The `newyork` compiler pipeline introduces no new regressions over our
integration and differential test suites (containing over 30000 test
cases). This was achieved by careful manual reviews and many LLM bughunt
loops. Additionally, a final security review by Anthropic's Fable 5 LLM
found no remaining soundness issues. Nonetheless, like any brand new
software, please consider this an experimental feature upon release.

---------

Signed-off-by: xermicus <bigcyrill@hotmail.com>
Signed-off-by: xermicus <cyrill@parity.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: neo <me@90f9.org>
Co-authored-by: LJ <81748770+elle-j@users.noreply.github.com>
2026-06-17 12:35:16 +02:00
xermicus 998ec823d5 bump cargo dependencies (#545)
- Update PVM to fix a downstream bug.
- Update the polkadot-sdk to get rid of most retester exceptions.

Signed-off-by: xermicus <cyrill@parity.io>
2026-06-17 07:45:59 +02:00
xermicus b2c025faad release resolc v1.2.0 (#534)
Supported `polkadot-sdk` rev: `2603`

### Changed

- Updated `LLVM` from `21.1.8` to LLVM `22.1.4`

### Added

- Support for solc v0.8.35.

### Fixed

- A constant folding bug causing incorrect translation of a signed
remainder edge case. The affected pattern (Solidity % or Yul smod):
  - SREM over the two constant operands `type(int256).min` and `-1`.
- At least one of the two constants needs folding (i.e. not just
`type(int256).min % -1`),
and is written specifically such that solc doesn't fold but LLVM does,
resulting in UB (signed-overflow).
- Fix `mulmod` returning out-of-range result for large moduli.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-05-28 23:20:11 +02:00
xermicus ae8033130b Fix __ulongrem stdlib edge case (#531)
The implementation is off-by-one.

---------

Signed-off-by: xermicus <cyrill@parity.io>
2026-05-28 17:25:23 +02:00
xermicus 40e97d11eb Fix optimization specific SREM edge case (#527)
Existing test coverage didn't catch a signed remainder overflow
semantics edge case behavior where at least one the operators is being
constant folded by LLVM instead of solc. This PR fixes the SREM
translation bug and adds missing test coverage for division ops with
constants.

Closes #524

---------

Signed-off-by: xermicus <cyrill@parity.io>
2026-05-28 09:01:41 +02:00
xermicus ee869cdd18 Support solc v0.8.35 (#512)
- Support solc v0.8.35
- The new `erc7201` is comptime (already translated to a constant in
Yul)

Didn't spot any relevant breakage or addition in the release notes so
should be no-brainer.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-05-01 20:14:36 +02:00
kvpanch 8326aa3aed Update LLVM from 21 to 22 (#505) 2026-04-28 14:28:14 -04:00
xermicus f887e75545 Release resolc v1.1.0 (#504)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-04-13 22:06:26 +02:00
xermicus 255f5cc31b Update dependencies (#503)
- Rust dependencies
- JS dependencies
- Retester submodule

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-04-13 14:59:24 +02:00
kvpanch b3cd402549 Append optnone and noinline for -O0 optlevel (#502)
This appears to be NFC change as new pass manager handles
--passes=default<O0> correctly. Still must be useful as a safeguard and
possibly for the old pass manager that is still used by backend.

```
Contract                        Without (bytes)   With noinline+optnone (bytes)
─────────────────────────────── ───────────────── ────────────────────────────
contract.sol:C                            1,266                          1,266
Fibonacci:Iterative                       2,506                          2,506
Storage                                   3,671                          3,671
Fibonacci:Recursive                       3,794                          3,794
Computation                               5,776                          5,776
Fibonacci:Binet                           8,786                          8,786
large_div_rem                            10,705                          10,705
DivisionArithmetics                      14,831                          14,831
ERC20                                    32,288                          32,288
ERC20Tester                              34,589                          34,589
```
2026-04-09 22:33:21 -04:00
LJ 41d8593a5a Remove stripping of minsize attribute for functions with 256-bit integer division (#501)
## Description

We previously had a workaround to strip `minsize` attributes for
functions with 256-bit integer division due to a crash in the LLVM
backend. We now [patch](https://github.com/paritytech/revive/pull/500)
LLVM with the fix, allowing us to use `minsize` with correct backend
optimization, making the workaround unnecessary.
2026-04-09 20:54:05 +02:00
LJ 3dc84349d9 Apply LLVM patches for deterministic operand order and correct peephole optimization for minsize (#500)
## Description

Applies LLVM patches that have not been backported to the major version
used in our submodule:

* [LLVM PR #163679](https://github.com/llvm/llvm-project/pull/163679)
  * *"[RISCV] Allow large div peephole optimization for minsize"*
* Fixes peephole optimization of large integers when `minsize` function
attribute is set.
* (Our revive codebase used a workaround that can be removed once this
500 PR is merged and we publish a new LLVM release.)
* [LLVM PR #190219](https://github.com/llvm/llvm-project/pull/190219)
* *"[TargetLowering] Speculative fix for a non-determinism issue between
different compilers"*
* Operand ordering of `mul i256` were different depending on the target
ABI when building LLVM, producing different RISC-V and PVM bytecode for
our Windows vs macOS/linux builds.
* The bytecode divergence (yet functionally equivalent) affected
Solidity contracts containing a value [multiplied by
itself](https://github.com/llvm/llvm-project/issues/190148) (e.g. via
explicit squaring or exponentiation), manifesting primarily when using
optimization level `-O0`.
2026-04-09 17:33:09 +02:00
LJ 8c41f93ace Build LLVM for Windows using MSVC-compatible Clang (#497)
## Description

Switches the Windows LLVM build from Visual Studio to `clang-cl` +
`lld-link` (Clang's MSVC-compatible drivers) with Ninja.

This is in order to better match the Clang toolchain used on our Linux
and macOS variants, while keeping the MSVC ABI.

It also speeds up the build time by at least 2x on Windows.
2026-04-09 07:51:37 +02:00
kvpanchandLJ 61ac247135 Provide unique name from closures with same name (#488)
In YUL it's possible to declare closure with a same name, but in
different scope, which previously resulted to func name conflict during
LLVM IR construction.
To solve this, track YUL scope when building LLVM IR and a special
counter that increments every time function with the same name exists in
LLVM module.
There's still assert if somehow within the same scope there 2 functions
with the same name, which should be forbidden by Yul

Fixes: #474

---------

Co-authored-by: LJ <81748770+elle-j@users.noreply.github.com>
2026-03-10 10:55:42 -04:00
xermicus dc155efc73 runtime-api: remove the spurious +fast-unaligned-access flag (#491)
Slipped through in #120

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-03-10 11:27:50 +01:00
kvpanch 5aebcc76ab Disable LLVM warnings and enable LTO in emscripten build (#487)
Fixed #148 and last task of #156
2026-03-04 09:41:38 -05:00
kvpanch 810a36b18b Update EMSDK to 5.0.0 (#479)
Emscripten 4.0.12 introduced breaking change by changing module factory
to always return promise even if `WASM_ASYNC_COMPILATION=0`. To overcome this, build emscripten compiler without MODULARIZE with custom export of `createRevive`.
2026-02-23 15:48:07 -05:00
xermicus 71d584dd6e inhert stderr for recursive process (#485)
Allows for debug logs. The stdout stay piped as its used for
intra-process communication.

Signed-off-by: xermicus <bigcyrill@hotmail.com>
2026-02-22 18:57:20 +01:00
xermicus 073276696f recursive processes use the current executable by default (#484)
- Recursive processes spawn the currently running executable by default,
removing the annoyance of mixing different compiler builds during
contract compilation.
- Remove the unused `once_cell` dependency.

Signed-off-by: xermicus <bigcyrill@hotmail.com>
2026-02-22 18:14:21 +01:00
xermicusandClaude Opus 4.6 c0a7596617 support solc v0.8.34 (#482)
As a drive-by fix, the get-llvm action now ignores LLVM releases marked
as pre-release.

---------

Signed-off-by: xermicus <bigcyrill@hotmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:27:03 +01:00
xermicusandminimax-m2.5 d8d998c114 Fix Yul mode discarding solc validation errors (#478)
In `--yul` mode, resolc now properly exits when solc reports validation
errors (e.g., invalid hex literals, variable redeclarations), matching
`--standard-json behavior.`

`runs_without_input_file` was adapted because it was relying on it where
the new behavior correctly matches solc --strict-assembly.

Closes #477

Co-authored-by: minimax-m2.5 <neo@zion>

---------

Signed-off-by: xermicus <bigcyrill@hotmail.com>
2026-02-16 11:03:24 +01:00
0cd949aa66 Update code base to use LLVM 21 (#434)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Co-authored-by: LJ <81748770+elle-j@users.noreply.github.com>
Co-authored-by: xermicus <cyrill@parity.io>
2026-02-06 12:23:48 -05:00
xermicus b080c1d86c resolc v1.0.0 (#465)
This marks a milestone: Smart contracts on Polkadot Asset Hub are live
and we release the first compiler version!

Signed-off-by: xermicus <bigcyrill@hotmail.com>
2026-01-29 19:17:08 +01:00
LJandxermicus a4163512ff Improve compilation time in standard JSON mode and honor requested output (#461)
# Description

Compilation times for resolc were significantly slower than solc when:
* Multiple files were included in the JSON input file via
`--standard-json`
* And none of the files requested code generation
* (If only a subset of files requested code generation, both resolc and
solc were very slow)

Reason:
* Resolc unconditionally generated bytecode for all contracts, even if
not requested.
* When compiling to PolkaVM bytecode, we need to pass additional flags
(e.g. `irOptimized`) to solc. If these flags were not explicitly
requested, resolc also added these to the requested output since PolkaVM
bytecode was always generated.

## Breaking Changes

The following changes are breaking, but fix the semantics to match its
intended behavior:

* Compiling with `--standard-json` now compiles to PolkaVM bytecode
***only*** for the contracts explicitly requested in the
`outputSelection`.
* Compiling with `--standard-json` now outputs ***only*** the explicitly
requested output (e.g. `evm.assembly`, `evm.bytecode`, `ast`, etc.).

```jsonc
// Example:
{
  "settings": {
    // ...
    "outputSelection": {
      "src/common/GasService.sol": {
        // Contracts in this file will generate bytecode.
        // Only these fields of the JSON output selection will be in the `contracts` output.
        "*": ["abi", "evm.methodIdentifiers", "metadata", "evm.bytecode"],
        // Only this field of the JSON output selection will be in the `sources` output.
        "": ["ast"]
      },
      "src/common/Gateway.sol": {
        // No contracts in this file will generate bytecode.
        "*": ["abi", "evm.methodIdentifiers", "metadata"],
        // No `ast` will be in the `sources` output (only the automatically added `id`,
        // similar to solc as this is not a configurable output selection).
        "": []
      },
    }
  }
}
```

## Performance Improvements

When e.g. the standard JSON input file includes multiple files and
requests output for every contract as per this setting:

```jsonc
{
  "settings": {
    // ...
    "optimizer": { "enabled": true, "runs": 1 },
    "viaIR": true,
    "outputSelection": {
      "src/common/GasService.sol": {
        "*": ["abi", "evm.methodIdentifiers", "metadata", "evm.bytecode"],
      },
      // Rest of files..
    }
  }
}
```

The differences in compilation times depending on whether `evm.bytecode`
is selected in every file, one file, or no files can be seen below:

| Solc Optimizer (runs=1) | ViaIR | Request `abi`,
`evm.methodIdentifiers`, `metadata` | Request `evm.bytecode` | resolc
before | resolc after | solc v0.8.33 |

|:-----------------------:|:-----:|:---------:|:---------:|:-------------:|:------------:|:----------:|
| ✅ | ✅ | All files | All files | `~14.5s` | `~14.5s` | `~13.5s` |
| ✅ | ✅ | All files | One file | `~14.5s` | `~450ms` | `~13.5s` |
| ✅ | ✅ | All files | No files | `~14.5s` | `~390ms` | `~350ms` |

**Observations:**

* `resolc before` is roughly the same no matter the request
  * This is due to unconditionally generating bytecode
* When not requesting bytecode for any contracts:
  * `resolc after` now compiles in ~390ms (vs ~14.5s), similar to `solc`
* Neither `solc` nor `resolc after` generates bytecode when none of the
contracts request it
* When requesting bytecode for all contracts in _only one_ file:
  * `resolc after` now compiles in ~450ms (vs ~14.5s)
* `solc` still compiles in the same time as when requesting bytecode for
all contracts in all files
* This is something they have tried to improve (see
[Solidity#15373](https://github.com/argotorg/solidity/issues/15373) and
[Solidity#15615](https://github.com/argotorg/solidity/issues/15615)),
and the intended behavior seems to now be that bytecode should only be
generated when explicitly requested for each contract.
* Even though PRs have merged to try to fix it, their issue seems to
persist as of v0.8.33.

# Open Questions

* Foundry:
  * [x] Pruning of the AST:
* Just saw [this past
commit](https://github.com/paritytech/revive/pull/385) to not prune the
AST for Foundry compatibility.
    * Can Foundry not explicitly request `"": "ast"`?
    * **Answer:**
* Pruning the AST when not requested should be fine, as long as Foundry
explicitly requests it when needed.
      * Will be tested by Foundry maintainer.

# Review Notes

Changes in `docs/` (~25 files) can be skipped as they are automatically
updated after adding content to `book/` and rebuilding it.

# Resolved Issues

Closes #326

---------

Co-authored-by: xermicus <cyrill@parity.io>
2026-01-28 23:04:22 +01:00
xermicus 95ae938ddf Add missing 63/64 rule documentation and a test (#462)
- Prominently point out the important differences of the `pallet-revive`
runtime.
- Add a test case illustrating the problem.

See also: https://github.com/paritytech/contract-issues/issues/257

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-01-27 19:43:14 +01:00
LJ c601377c2d Add integration test for deleting struct (#459)
Differentially tests the behavior of deleting a struct with a member
that do not occupy the full 32-byte slot. From [this
issue](https://github.com/paritytech/contract-issues/issues/118) it was
unclear whether the `delete` was expected to reset only the bytes
occupied or the entire slot. The current behavior of resetting the
entire slot is expected.
2026-01-20 14:34:27 +01:00
xermicus 50e4d47bc6 update Rust dependencies (#456)
Signed-off-by: xermicus <cyrill@parity.io>
2026-01-15 13:55:14 +01:00
xermicus 289af875db remove superfluous byte swap in linkersymbol builtin translation (#455)
- Remove the superfluous byte swap in the `linkersymbol` builtin
translation.
- Support testing the `linkersymbol` builtin translation in the runner
specs.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-01-15 12:43:46 +01:00
LJ f5fe3faa71 Add default values to compiler arguments (#451)
## Description

Adds default values to the compiler arguments below when parsed by
`clap`. This does not change previous user-facing behavior as these
defaults were implemented using different logic, but improves the UX and
the visibility of the exact defaults used.

**Example output from `resolc --help`:**
(Only affected arguments are shown here, and some of their descriptions
have been omitted here.)
```
Options:

  -O, --optimization <OPTIMIZATION>
          Set the optimization parameter -O[0 | 1 | 2 | 3 | s | z]. Use `3` for best performance and `z` for minimal size
          
          [default: z]

      --metadata-hash <METADATA_HASH>
          Set the metadata hash type. Available types: `none`, `ipfs`, `keccak256`
          
          [default: keccak256]

      --heap-size <HEAP_SIZE>
          The emulated EVM linear heap memory static buffer size in bytes.
          ...
          
          [default: 131072]

      --stack-size <STACK_SIZE>
          The contracts total stack size in bytes.
          ...
          
          [default: 131072]
```

## Resolved Issues

Closes #446
2026-01-14 19:22:03 +01:00
xermicus 285065632e remove the revive-explorer (#450)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-01-13 10:43:25 +01:00
xermicus a1a4f8e6ea Clip OOB values in call data load and copy (#448)
The OOB logic is implemented in the runtime but truncation circumvented
it.

Closes #263

---------

Signed-off-by: xermicus <cyrill@parity.io>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-01-13 10:15:31 +01:00
xermicus 81ce306735 release v0.6.0 (#445)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-01-08 11:45:11 +01:00
kvpanchandxermicus 540ec03cd7 Added 2 options to control expected result to revive-runner (#438)
Added 2 options to control expected result to `revive-runner`:
```
      --verify-failure <VERIFY_FAILURE>
          The expected call result of the contract execution

          Possible values:
          - instantiate: The contract instantiation must fail
          - call:        The contract execution must fail

      --verify-call-gas-consumed <VERIFY_CALL_GAS_CONSUMED>
          The expected amount of consumed gas by the contract execution
```

---------

Co-authored-by: xermicus <bigcyrill@hotmail.com>
2026-01-07 21:36:33 -05:00
Marian Radu 4c85a3113d Set the default PolkaVM stack and heap size values to 128KB. (#441)
Fixes https://github.com/paritytech/contract-issues/issues/149

A few test cases from v2-periphery-polkadot are hitting the PVM stack
limit when the contracts are compiled using resolc version 0.5.0. The
same tests pass if the contracts are compiled with a resolc version that
includes commit:
https://github.com/paritytech/revive/commit/878ca91689b99220f7ffd40df760613b7314de86.

After a brief discussion with @xermicus, we propose to set the default
PolkaVM stack and heap size values to 128KB, since we have already
encountered tests that hit the stack size limit and, without real world
data, it is difficult to determine the optimal values.
2026-01-07 14:27:17 +01:00
xermicus d8c23130bb revive-runner: enable PVM logs (#442)
This PR fixes a small oversight from #431: Set the debug config of the
revive-runner `Runtime` such that we get the PVM logs back. Since the
revive runner runtime is mainly meant for debugging, I further decided
to enable unlimited contract sizes and disable [EIP
3607](https://eips.ethereum.org/EIPS/eip-3607) too.

---------

Signed-off-by: xermicus <cyrill@parity.io>
2026-01-06 18:31:45 +01:00
xermicus 13070a4bdf Ensure correct flags are passed to solc in std json mode (#440)
This tests the marketplace contracts to compile fine. In prior versions
this fails to compile, hitting the solc "Stack too deep" error.

Closes #409

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-01-06 11:16:59 +01:00
xermicus cfcd2ff77c Support solc v0.8.33 (#439)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
2026-01-05 10:59:45 +01:00