Fe port certificate

WETH9

Port source ports/weth9, runtime code hash 0x3fe26b3d0f24d09333f61486c739457698c7725a7389ea5c3c7c238903d4a9de (1176 bytes), in place of the deployed code with hash 0xd0a06b12ac47863b5c7be4185c2deaad1c61557033f56c7d4ea74429cbb25e23 (3124 bytes). Blocks /root/v2blocks/0x192d500 to /root/v2blocks/0x192d5c7.

No behavior difference: every transaction that ran the port, every mutation of them and every random call behaved as on the deployed code.

Mainnet, as it happenedpassed
Mainnet, mutatedpassed
Random callspassed
Mutants: the unchanged portpassed

Mainnet, as it happened

Each transaction of the blocks ran on its own mainnet pre-state, with the port in place of every account holding the deployed code, and was compared with the chain: status, logs, every balance, nonce and storage slot. Only gas may differ.

Blocks200
Transactions69643
Transactions that ran the port3950
Identical to the chain3615
Differ where other code read the gas left335
  of which part at or under that code335
Differ where other code read code hashes0
Only the deployed code ran out of gas0
Behave differently0

Gas per call in identical transactions

FunctionIn the port's sourceCallsDeployedPortChange
Depositsrc/lib.fe:1449551612615998-0.7%
BalanceOfsrc/lib.fe:12975571005834-17%
Withdrawsrc/lib.fe:150126497409448-2.9%
Transfersrc/lib.fe:17842791325712752-3.8%
TransferFromsrc/lib.fe:18513631326212767-3.7%
Allowancesrc/lib.fe:13517923252078-10.6%
Approvesrc/lib.fe:1685081691516713-1.1%
Decimalssrc/lib.fe:1201823322143-8.1%
–140963980-2.8%
fallback–1788668882+0.1%
TotalSupplysrc/lib.fe:1254343248-27.6%
–140963980-2.8%

Mainnet, mutated

Each transaction that touched the deployed code ran again with its calldata changed, or with one call into the contract changed in flight, on both codes, gas free.

Transactions3950
Runs79000
Identical76569
Differ where other code read the gas left or code hashes2396
  of which code hashes397
  of the rest, part at or under the code that read the gas left1999
Only the deployed code ran out of gas35
Differ after an address-shaped word got upper bits0
Differ after the calldata was cut short0
Differ0

The port ran 560 of its 714 instructions (78.4%) in these runs.

Random calls

1,000 sessions of up to 60 random calls each, against both codes in step.

Well-formed calls47257
Well-formed calls that differ0
Calls with short calldata that differ0
Calls with dirty addresses that differ0
Invariants broken0

The port ran 639 of its 714 instructions (89.4%).

How sharp the checks are

Mutants of the port's source, one operator changed each, built with fe and put through random calls and then mutations of the first ten blocks. The unchanged port passed the same checks first.

Operators in the source13
Mutants built13
Killed by random calls12
Killed by mainnet mutations0
Survived1

92.3% killed. A survivor is a blind spot of the checks or a change that means the same; each deserves a look:

line 82: DynString::from_word_prefix(word: word, len: ((word & 0xff) * 2).downcast_truncate())

Made by fevm-replay certify, written in Fe and running fevm, the EVM written in Fe.