Skip to content
Crypto.world

Research

SkelOT: Reusing AOT Compilation Across EVM Contract Families

Production EVM AOT compilers (revmc, evmone, DTVM) cache and reuse native artifacts keyed by each contract's bytecode hash. But real EVM workloads are dominated by contract families…

SkelOT: Reusing AOT Compilation Across EVM Contract Families
arXiv
2609.24404
Published
2026-09-21
Authors
Sipeng Xie, Qianhong Wu, Minghang Li, Qin Wang, Zhipeng Wang, Bo Qin

AI summary

Overview

Research area: Blockchain systems — specifically Ethereum Virtual Machine (EVM) execution engines and ahead-of-time (AOT) compiler design, with a secondary grounding in smart-contract deployment analysis (factory, proxy, and template patterns).

Technical level: Advanced. The paper assumes familiarity with EVM opcode semantics (PUSH immediates, JUMPDEST, CODESIZE/CODECOPY), LLVM-based compilation pipelines, and native code caching.

Scope: SkelOT is an AOT compilation framework that changes the unit of compiled-code reuse from a single contract's code hash to the shared "skeleton" of a contract family, evaluated across four EVM chains and a 10K-block Base mainnet corpus (3.52M transactions).

What This Paper Is About

Production EVM AOT compilers (revmc, evmone, DTVM) cache and reuse native artifacts keyed by each contract's bytecode hash. But real EVM workloads are dominated by contract families — factory-deployed, proxy-based, and template-derived contracts that share the same instruction structure and differ only in a handful of embedded constants (owner addresses, fee tiers, pool parameters, token IDs). Per-hash compilation therefore recompiles structurally identical code many times. The paper's goal is to make one compilation cover an entire family by baking family-wide constants into the artifact and reading only the genuinely varying constants from a small per-contract runtime table.

Key Contributions

  1. Identification of a compilation-granularity mismatch. The authors show that code hash is a good deployment identity but a poor reuse boundary, and they quantify the gap: across Base, Ethereum, BSC, and Arbitrum, 23.1–47.6% of unique compilable bytecodes map to shared family skeletons within 10K-block windows.

  2. Skeleton extraction with an invariant/variant constant split. A family skeleton is the bytecode with PUSH immediate bytes, Solidity metadata, and trailing zero bytes removed, leaving all opcodes in place. Rewriting the bytecode once per family, the system classifies each PUSH position as invariant (same value in every member, baked into native code as a compile-time constant) or variant (differs across members, loaded from a per-contract table).

  3. An end-to-end implementation on revmc/LLVM. The prototype covers skeleton extraction, variance analysis, family-level compilation, runtime constant-table execution, and family-aware caching and dispatch, while leaving the host compiler's analysis, optimization, and object-emission passes unchanged.

  4. Large-scale empirical validation. On a 10K-block Base mainnet corpus with 3.52M transactions, SkelOT reduces compilation units by 47.5%, native-artifact footprint by 57.4%, and compile time by 2.19×, while preserving byte-identical execution outcomes versus per-hash AOT across 9,997 non-empty blocks.

Main Findings

  • Family structure is widespread and cross-chain. Skeleton deduplication over one 10K-block window per chain gives 47.60% reduction on Base (19,130 bytecodes to 10,025 skeletons), 30.69% on Ethereum (35,215 to 24,406), 30.79% on BSC (14,444 to 9,996), and 23.14% on Arbitrum (2,895 to 2,225).
  • The effect is not a single deployment burst. Across ten non-overlapping 1K-block sub-windows per chain, reductions stay in narrow ranges: [40.91%, 42.42%] on Base, [26.83%, 28.43%] on Ethereum, [24.67%, 27.13%] on BSC, and [16.34%, 21.03%] on Arbitrum. Corpus-level rates exceed every sub-window rate because larger windows merge more members into each family.
  • Savings concentrate in large contracts. On the Base corpus, the "huge" bucket (≥15,000 bytes) holds 68.41% of raw input bytes and reduces by 65.5% (±5.8), while the "tiny" bucket (<100 bytes) holds only 0.01% of bytes but reduces by 70.9% (±10.1). Medium and large buckets reduce by 35.6% (±5.6) and 30.4% (±3.5).
  • A few large families drive the reduction. Top families correspond to recognizable, long-lived templates: Uniswap V3 and PancakeSwap V3 pool skeletons, PancakeSwap V3 liquidity-mining pool variants, EIP-1167 minimal proxies, TransparentUpgradeableProxy families, ClankerToken ERC-20 deployments, and Ethereum ERC1155Creator proxy/NFT-collection families.
  • Cross-chain recurrence rises at the skeleton level. At exact-code level, 1,672 code hashes recur on at least two chains and 145 on all four; at skeleton level these counts rise to 2,970 and 302.
  • Reuse comes from a minority of families. On the Base corpus, 9,200 of 10,025 distinct skeletons appear only once and fall back to Naive AOT; the remaining 825 multi-member families cover 9,930 unique compilable bytecodes, or 51.9% of the corpus.
  • Embedded constants are overwhelmingly stable. Across four 10K-block corpora, 93.72%–96.91% of PUSH-immediate bytes in multi-member families are invariant.
  • Runtime speedup, not just compile savings. SkelOT delivers a 1.31× median per-contract speedup across family members at runtime.
  • Budget efficiency. Under a compile budget targeting 75% execution-time coverage, SkelOT needs far fewer artifacts than per-hash AOT, and the advantage holds at every coverage target tested.
  • Metadata overhead is small. Per-member variant tables total 5.4 MiB across 9,910 members of multi-member families, with a median table size of 352 bytes; the full registry file, including per-member hash identifiers and per-family bookkeeping, totals 9.6 MiB on disk.
  • Correctness is preserved byte-for-byte. The paper argues relative correctness — SkelOT reproduces the observable behavior (success/failure, gas, output, post-state) of the underlying per-contract AOT compiler — and confirms byte-identical outcomes against per-hash AOT across 9,997 non-empty blocks.

Methodology in Plain English

The authors start from a simple observation about how EVM bytecode works. Most opcodes operate on values already on the stack, but the PUSH family (PUSH1 through PUSH32) carries an inline constant — an address, a fee, an ID — directly in the code. Two contracts can therefore have exactly the same sequence of operations but be different files, because their embedded constants differ.

Their approach is to erase those constants. Strip the PUSH immediate bytes, strip the compiler's appended metadata trailer and trailing zeros, and what remains is a "skeleton" — a pure opcode layout. Two contracts belong to the same family precisely when their skeletons are byte-for-byte identical, which makes family membership a deterministic equality test rather than a similarity threshold. This matters because the compiler must share an actual instruction stream, not merely a structural analysis.

Compiling one artifact per family creates a problem: if you simply turn every constant into a runtime table lookup, you lose the constant folding and branch specialization that made AOT compilation fast in the first place. So the authors compare every member's bytecode at family formation time and split the PUSH positions in two. Positions where all members agree ("invariants") are baked into the shared native code as compile-time constants. Positions where members disagree ("variants") are lowered to indexed loads from a small per-member table, with slots numbered in skeleton order so one artifact serves every member. PUSH values that the compiler has already folded into native branch targets are excluded from the variant set entirely, since allowing them to vary would make the shared branch structure unsound.

Newly seen contracts can join an existing family only through a conservative admission check: the skeleton must match and every invariant position must hold the family's expected value. If a candidate disagrees, it is rejected and compiled on its own rather than triggering a rewrite of the family descriptor. Singleton families simply compile the ordinary per-contract way.

The evaluation is deliberately apples-to-apples. Rather than racing SkelOT against evmone or DTVM — which would confound the design variable with differences in language, intermediate representation, and JIT/AOT policy — the baseline is revmc's own per-hash path at the same compiler version, optimization level, and thread count. Base mainnet serves as the primary corpus because of its high deployment activity; the authors sample blocks 38,004,930 through 38,014,929 (3.52M transactions, three of them empty), exclude empty bytecode and bytecode beginning with 0xEF (deferred EOF format), and measure LLVM-emitted .o object size rather than runtime overhead.

Why This Matters

Impact on research. The paper opens a question that prior smart-contract literature did not ask. Clone-detection and code-reuse studies (He et al. 2020; Sun et al. 2023), factory/proxy deployment analyses (Wang et al. 2026; Zhang et al. 2025), and similarity-detection work all treat contracts as deployment or analysis objects. SkelOT reframes them as units of compilation work, and argues that a compiler's reuse boundary must be defined by what the backend can actually share — a stricter, byte-level criterion than a similarity score — rather than by deployment identity. It also connects EVM engineering to classic compiler concerns about dynamic-compilation warmup cost and JIT budget policy.

Real-world applications:

  • RPC providers and archive nodes that must serve native execution for millions of deployed contracts under memory ceilings on their compile caches.
  • Rollup sequencers and block builders, where a wall-clock window before a block is due limits how much of the incoming contract set can be AOT-compiled.
  • Chains with heavy factory activity (token launchpads, DEX pool factories, NFT collection factories), where thousands of near-identical contracts arrive in bursts from a single template.
  • Cross-chain infrastructure, since the same protocol templates recur on Base, Ethereum, BSC, and Arbitrum — 302 skeletons appear on all four chains — opening the door to sharing artifacts across networks.

Industry relevance. The three costs the paper identifies are operational, not theoretical: redundant translation work, a native-artifact cache that scales with deployment count instead of family count, and — most consequentially — reduced workload coverage under a finite compile budget, which pushes uncovered contracts back to the interpreter and inflates tail latency. A 57.4% smaller artifact footprint and 2.19× compile-time reduction translate directly into more contracts compiled per unit of budget, which is exactly the metric production node operators optimize.

Future Directions

  • Versioned families and online reclassification. The admission rule is intentionally conservative: once a family descriptor is written, a new contract that disagrees with an invariant position is rejected rather than causing the descriptor to be rewritten. Recovering that reuse requires an artifact invalidation policy, which the paper defers to its discussion section (§7.4).
  • The all-variant design point. Classifying every eligible immediate as a variant maximizes skeleton sharing and permits a more permissive admission rule (over contracts that share a skeleton and do not need folded control-flow operands to vary), but replaces compile-time constants with runtime loads. The paper quantifies these compile-side costs in §6.2 as an ablation; the open question is whether a hybrid policy can capture the flexibility without the optimization loss.
  • EOF-format bytecode. The current design must heuristically establish a code/data boundary — reading the metadata trailer length, verifying the CBOR shape, marking stripped positions as invalid jump targets, and conservatively rejecting skeletons where reachable code could run off the end into stripped bytes. The authors note that EOF-style formats would separate code from data at the format level and remove the need for both checks; EOF is currently deferred on the EVM roadmap and excluded from the corpus.
  • Beyond exact skeletons. Contracts that are merely similar, but not skeleton-identical, fall outside the reuse model by construction. Extending reuse to near-skeleton contracts — without sacrificing the byte-equality guarantee that makes the correctness argument tractable — remains open.

Target Audience

Compiler engineers and systems researchers working on EVM execution engines, AOT/JIT infrastructure, or blockchain node performance; node operators, RPC providers, and sequencer teams who manage compile budgets and artifact caches in production; and smart-contract security and measurement researchers interested in how deployment patterns (factories, proxies, templates) shape on-chain workloads. Readers need a working knowledge of EVM opcode semantics and native-code compilation to follow the correctness argument, though the problem statement and headline results are accessible to a broader blockchain-systems audience.

Authors’ abstract

Ahead-of-time (AOT) compilers (e.g., revmc, evmone, and DTVM) for the Ethereum Virtual Machine (EVM) reuse compilation artifacts at contract-code-hash granularity. This granularity is poorly matched to real EVM workloads dominated by \emph{contract families}: factory-, proxy-, and template-driven deployments that share instruction structure but differ in a small set of embedded constants. Across four EVM chains (Base, Ethereum, BSC, and Arbitrum), we find that 23.1--47.6\%…

The full abstract on arXiv
Read the original paper