Compare commits

...

7 Commits

Author SHA1 Message Date
pezkuwichain fd6b707687 feat: add pez-revive-dev-node platform aliases for Pezkuwi SDK compatibility 2026-01-27 15:14:44 +03:00
Omar 9fd6a8d408 Update resolc in ci to use a path (#233) 2026-01-26 21:56:40 +00:00
Omar 0d5e80f80f Update heapsize of resolc (#232)
* Add the ability to override the gas limit and other gas params in test steps

* Update the CI to accept resolc URL

* Update heapsize of resolc
2026-01-26 21:16:49 +00:00
Omar 340c2667e1 Override gas limit for tests (#231)
* Add the ability to override the gas limit and other gas params in test steps

* Update the CI to accept resolc URL
2026-01-26 21:15:29 +00:00
Omar 97d0cf1d1c Allow Targets in Test Cases (#229)
* Add an optional `targets` field to cases.

This PR adds an optional `targets` field to cases which takes presence
over that same field in the `Metadata`. The hope from this is to allow
us to limit specific tests so that they only run on specific platforms
only.

* Update the resolc tests submodule

* Update the default resolc version to use

* Update the default heap-size and stack-size in the cli

* Update the report processor
2026-01-22 13:33:01 +00:00
Omar 3c9f845287 Update the commit hash of the tests (#230) 2026-01-22 12:41:31 +00:00
Marian Radu 87758b4aff Skip contracts that have no bytecode (e.g., abstract contracts) (#228)
* Skip contracts that have no bytecode (e.g., abstract contracts)

* Update Cargo.lock
2026-01-19 15:04:53 +00:00
13 changed files with 223 additions and 110 deletions
@@ -18,10 +18,9 @@ inputs:
required: false required: false
default: "main" default: "main"
type: string type: string
resolc-version: resolc-path:
description: "The version of resolc to install and use in tests." description: "The path of the resolc compiler."
required: false required: true
default: "0.5.0"
type: string type: string
use-compilation-caches: use-compilation-caches:
description: "Controls if the compilation caches will be used for the test run or not." description: "Controls if the compilation caches will be used for the test run or not."
@@ -29,6 +28,10 @@ inputs:
default: true default: true
type: boolean type: boolean
# Test Execution Arguments # Test Execution Arguments
# TODO: We need a better way for people to pass arguments to retester. This way is not very good
# because we need to add support for each argument separately and support defaults and all of that
# perhaps having people pass in a JSON String of the arguments is the better long term solution
# for this.
platform: platform:
description: "The identifier of the platform to run the tests on (e.g., geth-evm-solc, revive-dev-node-revm-solc)" description: "The identifier of the platform to run the tests on (e.g., geth-evm-solc, revive-dev-node-revm-solc)"
required: true required: true
@@ -56,16 +59,6 @@ runs:
ref: ${{ inputs['revive-differential-tests-ref'] }} ref: ${{ inputs['revive-differential-tests-ref'] }}
path: revive-differential-tests path: revive-differential-tests
submodules: recursive submodules: recursive
- name: Installing the Latest Resolc
shell: bash
if: ${{ runner.os == 'Linux' && runner.arch == 'X64' }}
run: |
VERSION="${{ inputs['resolc-version'] }}"
ASSET_URL="https://github.com/paritytech/revive/releases/download/v$VERSION/resolc-x86_64-unknown-linux-musl"
echo "Downloading resolc v$VERSION from $ASSET_URL"
curl -Lsf --show-error -o resolc "$ASSET_URL"
chmod +x resolc
./resolc --version
- name: Installing Retester - name: Installing Retester
shell: bash shell: bash
run: ${{ inputs['cargo-command'] }} install --locked --path revive-differential-tests/crates/core run: ${{ inputs['cargo-command'] }} install --locked --path revive-differential-tests/crates/core
@@ -120,11 +113,12 @@ runs:
--revive-dev-node.path ${{ inputs['polkadot-sdk-path'] }}/target/release/revive-dev-node \ --revive-dev-node.path ${{ inputs['polkadot-sdk-path'] }}/target/release/revive-dev-node \
--eth-rpc.path ${{ inputs['polkadot-sdk-path'] }}/target/release/eth-rpc \ --eth-rpc.path ${{ inputs['polkadot-sdk-path'] }}/target/release/eth-rpc \
--polkadot-omni-node.path ${{ inputs['polkadot-sdk-path'] }}/target/release/polkadot-omni-node \ --polkadot-omni-node.path ${{ inputs['polkadot-sdk-path'] }}/target/release/polkadot-omni-node \
--resolc.path ./resolc \ --resolc.path ${{ inputs['resolc-path'] }} \
--resolc.heap-size 500000 \
"${OMNI_ARGS[@]}" || true "${OMNI_ARGS[@]}" || true
- name: Generate the expectation file - name: Generate the expectation file
shell: bash shell: bash
run: report-processor generate-expectations-file --report-path ./workdir/report.json --output-path ./workdir/expectations.json --remove-prefix ./revive-differential-tests/resolc-compiler-tests run: report-processor generate-expectations-file --report-path ./workdir/report.json --output-path ./workdir/expectations.json --remove-prefix ./revive-differential-tests/resolc-compiler-tests --include-status failed
- name: Upload the Report to the CI - name: Upload the Report to the CI
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with: with:
Generated
+67 -67
View File
@@ -127,7 +127,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"serde_with", "serde_with",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -164,7 +164,7 @@ dependencies = [
"futures", "futures",
"futures-util", "futures-util",
"serde_json", "serde_json",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -206,7 +206,7 @@ dependencies = [
"alloy-rlp", "alloy-rlp",
"crc", "crc",
"serde", "serde",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -232,7 +232,7 @@ dependencies = [
"borsh", "borsh",
"k256", "k256",
"serde", "serde",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -255,7 +255,7 @@ dependencies = [
"serde", "serde",
"serde_with", "serde_with",
"sha2 0.10.9", "sha2 0.10.9",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -296,7 +296,7 @@ dependencies = [
"http 1.4.0", "http 1.4.0",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.17", "thiserror 2.0.18",
"tracing", "tracing",
] ]
@@ -323,7 +323,7 @@ dependencies = [
"futures-utils-wasm", "futures-utils-wasm",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -407,7 +407,7 @@ dependencies = [
"reqwest", "reqwest",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio", "tokio",
"tracing", "tracing",
"url", "url",
@@ -571,7 +571,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"serde_with", "serde_with",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -585,7 +585,7 @@ dependencies = [
"alloy-serde", "alloy-serde",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -623,7 +623,7 @@ dependencies = [
"either", "either",
"elliptic-curve", "elliptic-curve",
"k256", "k256",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -639,7 +639,7 @@ dependencies = [
"async-trait", "async-trait",
"k256", "k256",
"rand 0.8.5", "rand 0.8.5",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -730,7 +730,7 @@ dependencies = [
"parking_lot", "parking_lot",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio", "tokio",
"tower 0.5.3", "tower 0.5.3",
"tracing", "tracing",
@@ -1916,9 +1916,9 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.2.52" version = "1.2.53"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd4932aefd12402b36c60956a4fe0035421f544799057659ff86f923657aada3" checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
dependencies = [ dependencies = [
"find-msvc-tools", "find-msvc-tools",
"shlex", "shlex",
@@ -2873,21 +2873,20 @@ dependencies = [
[[package]] [[package]]
name = "filetime" name = "filetime"
version = "0.2.26" version = "0.2.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"libredox", "libredox",
"windows-sys 0.60.2",
] ]
[[package]] [[package]]
name = "find-msvc-tools" name = "find-msvc-tools"
version = "0.1.7" version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f449e6c6c08c865631d4890cfacf252b3d396c9bcc83adb6623cdb02a8336c41" checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
[[package]] [[package]]
name = "fixed-hash" name = "fixed-hash"
@@ -2977,7 +2976,7 @@ dependencies = [
"semver 1.0.27", "semver 1.0.27",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.17", "thiserror 2.0.18",
"tracing", "tracing",
"yansi", "yansi",
] ]
@@ -3010,7 +3009,7 @@ dependencies = [
"semver 1.0.27", "semver 1.0.27",
"serde", "serde",
"serde_json", "serde_json",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -3040,7 +3039,7 @@ dependencies = [
"scale-info", "scale-info",
"scale-type-resolver", "scale-type-resolver",
"sp-crypto-hashing", "sp-crypto-hashing",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -4354,7 +4353,7 @@ dependencies = [
"quick-protobuf", "quick-protobuf",
"rand 0.8.5", "rand 0.8.5",
"sha2 0.10.9", "sha2 0.10.9",
"thiserror 2.0.17", "thiserror 2.0.18",
"tracing", "tracing",
"zeroize", "zeroize",
] ]
@@ -5411,7 +5410,7 @@ dependencies = [
"rustc-hash", "rustc-hash",
"rustls 0.23.36", "rustls 0.23.36",
"socket2 0.6.1", "socket2 0.6.1",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio", "tokio",
"tracing", "tracing",
"web-time", "web-time",
@@ -5432,7 +5431,7 @@ dependencies = [
"rustls 0.23.36", "rustls 0.23.36",
"rustls-pki-types", "rustls-pki-types",
"slab", "slab",
"thiserror 2.0.17", "thiserror 2.0.18",
"tinyvec", "tinyvec",
"tracing", "tracing",
"web-time", "web-time",
@@ -5887,6 +5886,7 @@ dependencies = [
"revive-dt-report", "revive-dt-report",
"serde", "serde",
"serde_json", "serde_json",
"strum",
] ]
[[package]] [[package]]
@@ -5989,9 +5989,9 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18"
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.26" version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d"
[[package]] [[package]]
name = "rustc-hash" name = "rustc-hash"
@@ -6061,7 +6061,7 @@ dependencies = [
"once_cell", "once_cell",
"ring", "ring",
"rustls-pki-types", "rustls-pki-types",
"rustls-webpki 0.103.8", "rustls-webpki 0.103.9",
"subtle", "subtle",
"zeroize", "zeroize",
] ]
@@ -6101,9 +6101,9 @@ dependencies = [
[[package]] [[package]]
name = "rustls-pki-types" name = "rustls-pki-types"
version = "1.13.2" version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd"
dependencies = [ dependencies = [
"web-time", "web-time",
"zeroize", "zeroize",
@@ -6123,7 +6123,7 @@ dependencies = [
"rustls 0.23.36", "rustls 0.23.36",
"rustls-native-certs 0.8.3", "rustls-native-certs 0.8.3",
"rustls-platform-verifier-android", "rustls-platform-verifier-android",
"rustls-webpki 0.103.8", "rustls-webpki 0.103.9",
"security-framework 3.5.1", "security-framework 3.5.1",
"security-framework-sys", "security-framework-sys",
"webpki-root-certs 0.26.11", "webpki-root-certs 0.26.11",
@@ -6148,9 +6148,9 @@ dependencies = [
[[package]] [[package]]
name = "rustls-webpki" name = "rustls-webpki"
version = "0.103.8" version = "0.103.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
dependencies = [ dependencies = [
"ring", "ring",
"rustls-pki-types", "rustls-pki-types",
@@ -6240,7 +6240,7 @@ dependencies = [
"scale-decode-derive", "scale-decode-derive",
"scale-type-resolver", "scale-type-resolver",
"smallvec", "smallvec",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -6267,7 +6267,7 @@ dependencies = [
"scale-encode-derive", "scale-encode-derive",
"scale-type-resolver", "scale-type-resolver",
"smallvec", "smallvec",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -6329,7 +6329,7 @@ dependencies = [
"quote", "quote",
"scale-info", "scale-info",
"syn 2.0.114", "syn 2.0.114",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -6347,7 +6347,7 @@ dependencies = [
"scale-encode", "scale-encode",
"scale-type-resolver", "scale-type-resolver",
"serde", "serde",
"thiserror 2.0.17", "thiserror 2.0.18",
"yap", "yap",
] ]
@@ -7523,7 +7523,7 @@ dependencies = [
"subxt-macro 0.43.1", "subxt-macro 0.43.1",
"subxt-metadata 0.43.0", "subxt-metadata 0.43.0",
"subxt-rpcs 0.43.0", "subxt-rpcs 0.43.0",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tracing", "tracing",
@@ -7560,7 +7560,7 @@ dependencies = [
"subxt-macro 0.44.2", "subxt-macro 0.44.2",
"subxt-metadata 0.44.2", "subxt-metadata 0.44.2",
"subxt-rpcs 0.44.2", "subxt-rpcs 0.44.2",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tracing", "tracing",
@@ -7583,7 +7583,7 @@ dependencies = [
"scale-typegen", "scale-typegen",
"subxt-metadata 0.43.0", "subxt-metadata 0.43.0",
"syn 2.0.114", "syn 2.0.114",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -7600,7 +7600,7 @@ dependencies = [
"scale-typegen", "scale-typegen",
"subxt-metadata 0.44.2", "subxt-metadata 0.44.2",
"syn 2.0.114", "syn 2.0.114",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -7629,7 +7629,7 @@ dependencies = [
"serde_json", "serde_json",
"sp-crypto-hashing", "sp-crypto-hashing",
"subxt-metadata 0.43.0", "subxt-metadata 0.43.0",
"thiserror 2.0.17", "thiserror 2.0.18",
"tracing", "tracing",
] ]
@@ -7659,7 +7659,7 @@ dependencies = [
"serde_json", "serde_json",
"sp-crypto-hashing", "sp-crypto-hashing",
"subxt-metadata 0.44.2", "subxt-metadata 0.44.2",
"thiserror 2.0.17", "thiserror 2.0.18",
"tracing", "tracing",
] ]
@@ -7674,7 +7674,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"smoldot-light", "smoldot-light",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tracing", "tracing",
@@ -7691,7 +7691,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"smoldot-light", "smoldot-light",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tracing", "tracing",
@@ -7743,7 +7743,7 @@ dependencies = [
"parity-scale-codec", "parity-scale-codec",
"scale-info", "scale-info",
"sp-crypto-hashing", "sp-crypto-hashing",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -7758,7 +7758,7 @@ dependencies = [
"parity-scale-codec", "parity-scale-codec",
"scale-info", "scale-info",
"sp-crypto-hashing", "sp-crypto-hashing",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -7779,7 +7779,7 @@ dependencies = [
"serde_json", "serde_json",
"subxt-core 0.43.0", "subxt-core 0.43.0",
"subxt-lightclient 0.43.0", "subxt-lightclient 0.43.0",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio-util", "tokio-util",
"tracing", "tracing",
"url", "url",
@@ -7803,7 +7803,7 @@ dependencies = [
"serde_json", "serde_json",
"subxt-core 0.44.2", "subxt-core 0.44.2",
"subxt-lightclient 0.44.2", "subxt-lightclient 0.44.2",
"thiserror 2.0.17", "thiserror 2.0.18",
"tokio-util", "tokio-util",
"tracing", "tracing",
"url", "url",
@@ -7833,7 +7833,7 @@ dependencies = [
"sha2 0.10.9", "sha2 0.10.9",
"sp-crypto-hashing", "sp-crypto-hashing",
"subxt-core 0.43.0", "subxt-core 0.43.0",
"thiserror 2.0.17", "thiserror 2.0.18",
"zeroize", "zeroize",
] ]
@@ -7845,7 +7845,7 @@ checksum = "8c4fb8fd6b16ecd3537a29d70699f329a68c1e47f70ed1a46d64f76719146563"
dependencies = [ dependencies = [
"hex", "hex",
"parity-scale-codec", "parity-scale-codec",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -7856,7 +7856,7 @@ checksum = "a26ed947c63b4620429465c9f7e1f346433ddc21780c4bfcfade1e3a4dcdfab8"
dependencies = [ dependencies = [
"hex", "hex",
"parity-scale-codec", "parity-scale-codec",
"thiserror 2.0.17", "thiserror 2.0.18",
] ]
[[package]] [[package]]
@@ -8006,11 +8006,11 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "2.0.17" version = "2.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
dependencies = [ dependencies = [
"thiserror-impl 2.0.17", "thiserror-impl 2.0.18",
] ]
[[package]] [[package]]
@@ -8026,9 +8026,9 @@ dependencies = [
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "2.0.17" version = "2.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -8416,7 +8416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf" checksum = "786d480bce6247ab75f005b14ae1624ad978d3029d9113f0a22fa1ac773faeaf"
dependencies = [ dependencies = [
"crossbeam-channel", "crossbeam-channel",
"thiserror 2.0.17", "thiserror 2.0.18",
"time", "time",
"tracing-subscriber", "tracing-subscriber",
] ]
@@ -8546,7 +8546,7 @@ dependencies = [
"rustls 0.23.36", "rustls 0.23.36",
"rustls-pki-types", "rustls-pki-types",
"sha1", "sha1",
"thiserror 2.0.17", "thiserror 2.0.18",
"utf-8", "utf-8",
] ]
@@ -8860,9 +8860,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]] [[package]]
name = "wasip2" name = "wasip2"
version = "1.0.1+wasi-0.2.4" version = "1.0.2+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
dependencies = [ dependencies = [
"wit-bindgen", "wit-bindgen",
] ]
@@ -9446,9 +9446,9 @@ dependencies = [
[[package]] [[package]]
name = "wit-bindgen" name = "wit-bindgen"
version = "0.46.0" version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
[[package]] [[package]]
name = "writeable" name = "writeable"
@@ -9469,7 +9469,7 @@ dependencies = [
"pharos", "pharos",
"rustc_version 0.4.1", "rustc_version 0.4.1",
"send_wrapper", "send_wrapper",
"thiserror 2.0.17", "thiserror 2.0.18",
"wasm-bindgen", "wasm-bindgen",
"wasm-bindgen-futures", "wasm-bindgen-futures",
"web-sys", "web-sys",
@@ -9643,9 +9643,9 @@ dependencies = [
[[package]] [[package]]
name = "zmij" name = "zmij"
version = "1.0.14" version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea" checksum = "94f63c051f4fe3c1509da62131a678643c5b6fbdc9273b2b79d4378ebda003d2"
[[package]] [[package]]
name = "zombienet-configuration" name = "zombienet-configuration"
+6
View File
@@ -32,8 +32,12 @@ pub enum PlatformIdentifier {
/// The Lighthouse Go-ethereum reference full node EVM implementation with the solc compiler. /// The Lighthouse Go-ethereum reference full node EVM implementation with the solc compiler.
LighthouseGethEvmSolc, LighthouseGethEvmSolc,
/// The revive dev node with the PolkaVM backend with the resolc compiler. /// The revive dev node with the PolkaVM backend with the resolc compiler.
#[strum(serialize = "revive-dev-node-polkavm-resolc", serialize = "pez-revive-dev-node-polkavm-resolc")]
#[serde(alias = "pez-revive-dev-node-polkavm-resolc")]
ReviveDevNodePolkavmResolc, ReviveDevNodePolkavmResolc,
/// The revive dev node with the REVM backend with the solc compiler. /// The revive dev node with the REVM backend with the solc compiler.
#[strum(serialize = "revive-dev-node-revm-solc", serialize = "pez-revive-dev-node-revm-solc")]
#[serde(alias = "pez-revive-dev-node-revm-solc")]
ReviveDevNodeRevmSolc, ReviveDevNodeRevmSolc,
/// A zombienet based Substrate/Polkadot node with the PolkaVM backend with the resolc compiler. /// A zombienet based Substrate/Polkadot node with the PolkaVM backend with the resolc compiler.
ZombienetPolkavmResolc, ZombienetPolkavmResolc,
@@ -98,6 +102,8 @@ pub enum NodeIdentifier {
/// The go-ethereum node implementation. /// The go-ethereum node implementation.
LighthouseGeth, LighthouseGeth,
/// The revive dev node implementation. /// The revive dev node implementation.
#[strum(serialize = "revive-dev-node", serialize = "pez-revive-dev-node")]
#[serde(alias = "pez-revive-dev-node")]
ReviveDevNode, ReviveDevNode,
/// A zombienet spawned nodes /// A zombienet spawned nodes
Zombienet, Zombienet,
+8 -2
View File
@@ -294,10 +294,16 @@ impl SolidityCompiler for Resolc {
let map = compiler_output.contracts.entry(source_path).or_default(); let map = compiler_output.contracts.entry(source_path).or_default();
for (contract_name, contract_information) in contracts.into_iter() { for (contract_name, contract_information) in contracts.into_iter() {
let bytecode = contract_information let Some(bytecode) = contract_information
.evm .evm
.and_then(|evm| evm.bytecode.clone()) .and_then(|evm| evm.bytecode.clone())
.context("Unexpected - Contract compiled with resolc has no bytecode")?; else {
tracing::debug!(
"Skipping abstract or interface contract {} - no bytecode",
contract_name
);
continue;
};
let abi = { let abi = {
let metadata = &contract_information.metadata; let metadata = &contract_information.metadata;
if metadata.is_null() { if metadata.is_null() {
+1
View File
@@ -806,6 +806,7 @@ pub struct ResolcConfiguration {
/// If unspecified, the revive compiler default is used /// If unspecified, the revive compiler default is used
#[clap(id = "resolc.heap-size", long = "resolc.heap-size")] #[clap(id = "resolc.heap-size", long = "resolc.heap-size")]
pub heap_size: Option<u32>, pub heap_size: Option<u32>,
/// Specifies the PVM stack size in bytes. /// Specifies the PVM stack size in bytes.
/// ///
/// If unspecified, the revive compiler default is used /// If unspecified, the revive compiler default is used
+9 -9
View File
@@ -482,15 +482,16 @@ where
.context("Failed to find deployment receipt for constructor call"), .context("Failed to find deployment receipt for constructor call"),
Method::Fallback | Method::FunctionName(_) => { Method::Fallback | Method::FunctionName(_) => {
let resolver = self.platform_information.node.resolver().await?; let resolver = self.platform_information.node.resolver().await?;
let tx = match step let mut tx = step
.as_transaction(resolver.as_ref(), self.default_resolution_context()) .as_transaction(resolver.as_ref(), self.default_resolution_context())
.await .await?;
{
Ok(tx) => tx, let gas_overrides = step
Err(err) => { .gas_overrides
return Err(err); .get(&self.platform_information.platform.platform_identifier())
} .copied()
}; .unwrap_or_default();
gas_overrides.apply_to::<Ethereum>(&mut tx);
self.platform_information.node.execute_transaction(tx).await self.platform_information.node.execute_transaction(tx).await
} }
@@ -911,7 +912,6 @@ where
.get(contract_instance) .get(contract_instance)
{ {
info!( info!(
%address, %address,
"Contract instance already deployed." "Contract instance already deployed."
); );
+15 -8
View File
@@ -223,17 +223,24 @@ impl<'a> TestDefinition<'a> {
/// Checks if the platforms all support the desired targets in the metadata file. /// Checks if the platforms all support the desired targets in the metadata file.
fn check_target_compatibility(&self) -> TestCheckFunctionResult { fn check_target_compatibility(&self) -> TestCheckFunctionResult {
let mut error_map = indexmap! { // The case targets takes presence over the metadata targets.
"test_desired_targets" => json!(self.metadata.targets.as_ref()), let Some(targets) = self
.case
.targets
.as_ref()
.or(self.metadata.targets.as_ref())
else {
return Ok(());
}; };
let mut error_map = indexmap! {
"test_desired_targets" => json!(targets),
};
let mut is_allowed = true; let mut is_allowed = true;
for (_, platform_information) in self.platforms.iter() { for (_, platform_information) in self.platforms.iter() {
let is_allowed_for_platform = match self.metadata.targets.as_ref() { let is_allowed_for_platform =
None => true, targets.contains(&platform_information.platform.vm_identifier());
Some(required_vm_identifiers) => {
required_vm_identifiers.contains(&platform_information.platform.vm_identifier())
}
};
is_allowed &= is_allowed_for_platform; is_allowed &= is_allowed_for_platform;
error_map.insert( error_map.insert(
platform_information.platform.platform_identifier().into(), platform_information.platform.platform_identifier().into(),
+8 -2
View File
@@ -1,16 +1,22 @@
use alloy::primitives::Address; use alloy::primitives::{Address, map::HashSet};
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use revive_dt_common::{ use revive_dt_common::{
macros::define_wrapper_type, macros::define_wrapper_type,
types::{Mode, ParsedMode}, types::{Mode, ParsedMode, VmIdentifier},
}; };
use crate::steps::*; use crate::steps::*;
#[derive(Debug, Default, Serialize, Deserialize, Clone, Eq, PartialEq, JsonSchema)] #[derive(Debug, Default, Serialize, Deserialize, Clone, Eq, PartialEq, JsonSchema)]
pub struct Case { pub struct Case {
/// An optional vector of targets that this Metadata file's cases can be executed on. As an
/// example, if we wish for the metadata file's cases to only be run on PolkaVM then we'd
/// specify a target of "PolkaVM" in here.
#[serde(skip_serializing_if = "Option::is_none")]
pub targets: Option<HashSet<VmIdentifier>>,
/// An optional name of the test case. /// An optional name of the test case.
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>, pub name: Option<String>,
+2 -1
View File
@@ -8,6 +8,7 @@ use std::{
str::FromStr, str::FromStr,
}; };
use alloy::primitives::map::HashSet;
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@@ -83,7 +84,7 @@ pub struct Metadata {
/// example, if we wish for the metadata file's cases to only be run on PolkaVM then we'd /// example, if we wish for the metadata file's cases to only be run on PolkaVM then we'd
/// specify a target of "PolkaVM" in here. /// specify a target of "PolkaVM" in here.
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub targets: Option<Vec<VmIdentifier>>, pub targets: Option<HashSet<VmIdentifier>>,
/// A vector of the test cases and workloads contained within the metadata file. This is their /// A vector of the test cases and workloads contained within the metadata file. This is their
/// primary description. /// primary description.
+63
View File
@@ -1,6 +1,7 @@
use std::{collections::HashMap, fmt::Display, str::FromStr}; use std::{collections::HashMap, fmt::Display, str::FromStr};
use alloy::hex::ToHexExt; use alloy::hex::ToHexExt;
use alloy::network::Network;
use alloy::primitives::{FixedBytes, utils::parse_units}; use alloy::primitives::{FixedBytes, utils::parse_units};
use alloy::{ use alloy::{
eips::BlockNumberOrTag, eips::BlockNumberOrTag,
@@ -11,6 +12,7 @@ use alloy::{
}; };
use anyhow::Context as _; use anyhow::Context as _;
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, stream}; use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, stream};
use revive_dt_common::types::PlatformIdentifier;
use schemars::JsonSchema; use schemars::JsonSchema;
use semver::VersionReq; use semver::VersionReq;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@@ -152,6 +154,11 @@ pub struct FunctionCallStep {
/// during the execution. /// during the execution.
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub variable_assignments: Option<VariableAssignments>, pub variable_assignments: Option<VariableAssignments>,
/// Allows for the test to set a specific value for the various gas parameter for each one of
/// the platforms we support. This is ignored for steps that perform contract deployments.
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
pub gas_overrides: HashMap<PlatformIdentifier, GasOverrides>,
} }
/// This represents a balance assertion step where the framework needs to query the balance of some /// This represents a balance assertion step where the framework needs to query the balance of some
@@ -965,6 +972,62 @@ impl<'de> Deserialize<'de> for EtherValue {
} }
} }
#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, Eq, PartialEq, JsonSchema)]
pub struct GasOverrides {
#[serde(skip_serializing_if = "Option::is_none")]
pub gas_limit: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub gas_price: Option<u128>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_fee_per_gas: Option<u128>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_priority_fee_per_gas: Option<u128>,
}
impl GasOverrides {
pub fn new() -> Self {
Default::default()
}
pub fn with_gas_limit(mut self, value: impl Into<Option<u64>>) -> Self {
self.gas_limit = value.into();
self
}
pub fn with_gas_price(mut self, value: impl Into<Option<u128>>) -> Self {
self.gas_price = value.into();
self
}
pub fn with_max_fee_per_gas(mut self, value: impl Into<Option<u128>>) -> Self {
self.max_fee_per_gas = value.into();
self
}
pub fn with_max_priority_fee_per_gas(mut self, value: impl Into<Option<u128>>) -> Self {
self.max_priority_fee_per_gas = value.into();
self
}
pub fn apply_to<N: Network>(&self, transaction_request: &mut N::TransactionRequest) {
if let Some(gas_limit) = self.gas_limit {
transaction_request.set_gas_limit(gas_limit);
}
if let Some(gas_price) = self.gas_price {
transaction_request.set_gas_price(gas_price);
}
if let Some(max_fee_per_gas) = self.max_fee_per_gas {
transaction_request.set_max_fee_per_gas(max_fee_per_gas);
}
if let Some(max_priority_fee_per_gas) = self.max_priority_fee_per_gas {
transaction_request.set_max_priority_fee_per_gas(max_priority_fee_per_gas)
}
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
+1
View File
@@ -18,6 +18,7 @@ revive-dt-common = { workspace = true }
anyhow = { workspace = true } anyhow = { workspace = true }
clap = { workspace = true } clap = { workspace = true }
strum = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
+32 -4
View File
@@ -1,6 +1,6 @@
use std::{ use std::{
borrow::Cow, borrow::Cow,
collections::{BTreeMap, BTreeSet}, collections::{BTreeMap, BTreeSet, HashSet},
fmt::Display, fmt::Display,
fs::{File, OpenOptions}, fs::{File, OpenOptions},
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
@@ -9,11 +9,12 @@ use std::{
}; };
use anyhow::{Context as _, Error, Result, bail}; use anyhow::{Context as _, Error, Result, bail};
use clap::Parser; use clap::{Parser, ValueEnum};
use serde::{Deserialize, Serialize, de::DeserializeOwned}; use serde::{Deserialize, Serialize, de::DeserializeOwned};
use revive_dt_common::types::{Mode, ParsedTestSpecifier}; use revive_dt_common::types::{Mode, ParsedTestSpecifier};
use revive_dt_report::{Report, TestCaseStatus}; use revive_dt_report::{Report, TestCaseStatus};
use strum::EnumString;
fn main() -> Result<()> { fn main() -> Result<()> {
let cli = Cli::try_parse().context("Failed to parse the CLI arguments")?; let cli = Cli::try_parse().context("Failed to parse the CLI arguments")?;
@@ -23,11 +24,14 @@ fn main() -> Result<()> {
report_path, report_path,
output_path: output_file, output_path: output_file,
remove_prefix, remove_prefix,
include_status,
} => { } => {
let remove_prefix = remove_prefix let remove_prefix = remove_prefix
.into_iter() .into_iter()
.map(|path| path.canonicalize().context("Failed to canonicalize path")) .map(|path| path.canonicalize().context("Failed to canonicalize path"))
.collect::<Result<Vec<_>>>()?; .collect::<Result<Vec<_>>>()?;
let include_status =
include_status.map(|value| value.into_iter().collect::<HashSet<_>>());
let expectations = report_path let expectations = report_path
.execution_information .execution_information
@@ -73,7 +77,12 @@ fn main() -> Result<()> {
Status::from(status), Status::from(status),
) )
}) })
.filter(|(_, status)| *status == Status::Failed) .filter(|(_, status)| {
include_status
.as_ref()
.map(|allowed_status| allowed_status.contains(status))
.unwrap_or(true)
})
.collect::<Expectations>(); .collect::<Expectations>();
let output_file = OpenOptions::new() let output_file = OpenOptions::new()
@@ -143,6 +152,11 @@ pub enum Cli {
/// Prefix paths to remove from the paths in the final expectations file. /// Prefix paths to remove from the paths in the final expectations file.
#[clap(long)] #[clap(long)]
remove_prefix: Vec<PathBuf>, remove_prefix: Vec<PathBuf>,
/// Controls which test case statuses are included in the generated expectations file. If
/// nothing is specified then it will include all of the test case status.
#[clap(long)]
include_status: Option<Vec<Status>>,
}, },
/// Compares two expectation files to ensure that they match each other. /// Compares two expectation files to ensure that they match each other.
@@ -157,7 +171,21 @@ pub enum Cli {
}, },
} }
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] #[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash,
Serialize,
Deserialize,
ValueEnum,
EnumString,
)]
#[strum(serialize_all = "kebab-case")]
pub enum Status { pub enum Status {
Succeeded, Succeeded,
Failed, Failed,