XDPoSChain compatibility is determined by the target EVM version, not by a single Solidity compiler version.
Current network activation block numbers:
| Network | Cancun | Prague | Osaka |
|---|---|---|---|
| mainnet | 98802000 | TBD | TBD |
| testnet | 71551800 | TBD | TBD |
| devnet | 43200 | TBD | TBD |
Recommended compiler settings:
| Solidity version | Default target EVM | Deploying to current mainnet/testnet/devnet |
|---|---|---|
| 0.8.25 to 0.8.29 | cancun | default settings are fine |
| 0.8.30 | prague | generally compatible (see note 2) |
| 0.8.31 and later | osaka | pin evmVersion (see note 3) |
Notes:
evmVersionmainly affects opcode availability and code generation strategy, not Solidity language syntax itself.- (0.8.30) pin
evmVersion: "cancun"only if you need reproducible outputs with existing Cancun-targeted artifacts. - (0.8.31+) set
evmVersiontocancun(orpragueafter Prague activation) unless your target network has Osaka. - The repository contains fixtures generated by
solc 0.8.28, but that is not a hard upper bound for supported Solidity versions. - If Prague is activated on XDPoSChain in the future, Solidity 0.8.30 and later
can target it by setting
evmVersion: "prague"explicitly. - Solidity 0.8.31 introduced support for the
CLZopcode (EIP-7939), which is part of Osaka, not Prague. The strong pinning warning applies to Osaka-only features (such as CLZ), not to 0.8.30's defaultpraguetarget by itself.
The value of block.prevrandao is keccak256(block.number) in our current implemention. It is predictable and unsafe.
NOTICE: do not use it in real business.
The value of block.basefee is always 12.5 GWei in our EIP-1559 implemention.
The value of block.blobbasefee is always 0 in our EIP-7516 implemention.