Welcome to the next crypto level
← Nexorena

technology

Sonic fixes discrepancies between simulations and executed transactions

Released on November 16, version 2.2.7 of the Sonic client corrects several results returned by simulation and tracing interfaces. The update is primarily relevant to operators that serve those requests.

Nexorena Editorial Team

Sonic fixes discrepancies between simulations and executed transactions

Traces apply contract creation limits

Sonic Labs released version 2.2.7 of its client on November 16. The release notes describe discrepancies between what certain tools returned and what happened during on-chain execution. One case involved CREATE and CREATE2, instructions that let one contract create another. Tracing applied a 96 KiB limit intended for initialization code in a transaction that directly creates a contract. The two instructions have a 48 KiB limit. For some sizes between those thresholds, a trace could report success even though contract creation failed on-chain.

The patch uses Sonic’s configuration where the simulator previously used Geth’s. Size limits distinguish contract code, initialization code for a creation transaction, and the two internal creation instructions. The distinction matters for teams deploying contracts and reading traces to locate the cause of a failure. A tool that returns results inconsistent with network rules can direct the investigation to the wrong call.

Gas and balances follow Sonic’s rules

The eth_simulateV1 method runs calls under specified assumptions without sending them to the network as transactions. Version 2.2.7 applies Sonic’s fee and balance rules, including its 10% charge on unused gas. If a call leaves gas unspecified, the release notes say the simulator uses the gas remaining in the block, subject to the RPC server’s cap. The result may then include a substantial amount of unused gas. Maintainers tell clients that use consumed gas as an estimate to set the parameter explicitly.

The simulator also treats each call in a simulated block as a separate transaction. A later call no longer inherits transient storage, refunds or certain temporary states from a previous call. If the requested value exceeds the sender’s balance, the simulator reports the call’s failure as it would occur on-chain, instead of rejecting the whole request. Results can therefore change without any change to the contract under test.

Failed calls are excluded from the logs

Sonic removes logs emitted by failed calls from the results. Log indexes are also consecutive across the simulated block, as they are in receipts. The fix matters to tools that read transfer events and need to distinguish effective movements from attempts rolled back during execution.

Sonic Labs recommends the update for operators providing RPC, tracing or simulation services. The recommendation concerns the software version. An interface’s reported version and its provider’s rollout announcements remain the sources for determining whether that interface already applies the fixes.

Article sources

Written with love byEthan BrooksMeet this editorial pen name ↗

Explorer Nexorena