mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
lux-evm serves the stock revm set behind the classical-family gate and nothing else, so an evaluator that goes through PrecompileProvider::run on lux_evm::Precompiles reports what a Rust node would charge and return for each call in the corpus. The context it needs is inert, because a precompile reads nothing but its own input. Gas is converted at the edge: charged is limit minus remaining, which for a revm Gas is Gas::spent. Go and Rust agree on every vector at 0x01 through 0x08 — ecrecover, sha256, ripemd160, identity, modexp under the Osaka repricing, and the three bn254 operations — and disagree in three places, each with one cause. The Lux bls12381 modules sit on the pre-final EIP-2537 layout, which puts a different operation at every address from 0x0c up. The Lux p256verify module charges 3450 where the stock table charges 6900. And geth deducts RequiredGas before reaching Run, so it charges a refusal, where revm computes the cost inside the precompile and records nothing when the input is refused. Co-authored-by: Hanzo Dev <[email protected]>
28 lines
964 B
TOML
28 lines
964 B
TOML
# SPDX-License-Identifier: BSD-3-Clause-Eco
|
|
|
|
[package]
|
|
name = "lux-evm-conformance"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "The Rust EVM's answers to the precompile corpus"
|
|
license = "BSD-3-Clause-Eco"
|
|
repository = "https://github.com/luxfi/node2"
|
|
publish = false
|
|
|
|
[dependencies]
|
|
# The implementation under test. A path dependency for the same reason the
|
|
# chains reach the node by path: the evaluator has to answer for the code this
|
|
# checkout would run, and a version number between them would be a way for the
|
|
# differential to report on something else.
|
|
lux-evm = { path = "../../../../../lux-rs/evm" }
|
|
|
|
# The types the seam is stated in — `CallInputs` going in, `InterpreterResult`
|
|
# coming out. Named at the same major version `lux-evm` names, so there is one
|
|
# revm in the graph and the `InterpreterResult` this program reads is the one
|
|
# `lux_evm::Precompiles` produced.
|
|
revm = "36"
|
|
|
|
[[bin]]
|
|
name = "conformance"
|
|
path = "src/bin/conformance.rs"
|