02Sheet 02.03.193 · Entries

Apply order is not transaction-set order, and differs by network and protocol

The transaction set lists transactions in phases sorted by hash; core applies the classic phase first, then the Soroban phase, each in an order shuffled by the hash of the whole set (TxSetFrame.cpp ApplyTxSorter).

FIG. · Where it sits · inside LedgerCloseMetaCAP-0063 · H-C12
tx_processing order differs from tx_set order; classic phase before Soroban phase

The shape

The transaction set lists transactions in phases sorted by hash; core applies the classic phase first, then the Soroban phase, each in an order shuffled by the hash of the whole set (TxSetFrame.cpp ApplyTxSorter). The same recipe gives a different apply order on each network and protocol. Readers that number transactions by their position in the set, or assume one order, misattribute results.

Variants

VariantProtocolNetworkSourceSizesha256
p30-mainnet-generatedP30mainnet passphrasegenerated by stellar-core v30.0.017,236 Bdbc26aa0d752…
p28-mainnet-generatedP28mainnet passphrasegenerated by stellar-core v30.0.017,228 Bb464fb610c5d…
p30-testnet-generatedP30testnet passphrasegenerated by stellar-core v30.0.017,132 B93d7ae80867e…
p28-testnet-generatedP28testnet passphrasegenerated by stellar-core v30.0.017,124 Be7e04e4b8cdf…

What a correct reader returns

A correct reader findsValueBacked by
The ledger applies 12 transactions.length 12constructionsnapshot
Applied first (p30-mainnet): race-attacker-merge-tx-source.
p30-mainnet-generated
e1d0c3540dab4451c867f57717e15ea3df0a2442087eef21898084b1f66e883fsnapshotcorewalker
Applied last (p30-mainnet): race-victim-opNO_ACCOUNT, a Soroban transaction.
p30-mainnet-generated
6f567981957f2a9e4aacb9c5393e51853cb8399a57fa0aa0de3cca498862c0e7snapshotcorewalker
Applied first (p28-mainnet): race-attacker-bump-sequence.
p28-mainnet-generated
86aaca7b5f6ef4c53049986de367c63f5684e20fae244f6eb348189063dcfb98snapshotcorewalker
Applied last (p28-mainnet): race-victim-txBAD_SEQ, a Soroban transaction.
p28-mainnet-generated
961954d8ed490a2e44f35f97495a6594417029d3218ca6f325c97479323565f2snapshotcorewalker
Applied first (p30-testnet): race-attacker-bump-sequence.
p30-testnet-generated
4ac9fa3f3e0cd863700b37054c9c9173ecacdb1327a26d7b0195aef52e87cbaasnapshotcorewalker
Applied last (p30-testnet): race-victim-txNO_ACCOUNT, a Soroban transaction.
p30-testnet-generated
d32c6d2fd3dd151f22b5b123193ebbdd40c79f7e7316c1db0beb08f07f9b0507snapshotcorewalker
Applied first (p28-testnet): race-attacker-remove-op-signer.
p28-testnet-generated
2e6ab3b022cf9769e69d6ef488aff887ba5d4939de3ea4d68537c5aa3ec62679snapshotcorewalker
Applied last (p28-testnet): race-victim-txBAD_AUTH, a Soroban transaction.
p28-testnet-generated
f3668f3187d61ad00a88f1144f6edfb1e6d533ea88063846dee36b082d936bdasnapshotcorewalker

Check it yourself

make verify   # schema, hashes, the byte-for-byte round trip and every fact above
make oracle   # the facts' values, re-read by stellar-core and the schema walker

Entry id ledger.apply-order-differs-from-set-order · compiled from catalog/ledger.apply-order-differs-from-set-order.json · entry.json

On this page