02Sheet 02.03.027 · Entries

SAC trustline with no event

A contract call creates a classic trustline: no CHANGE_TRUST operation, no event, only a created ledger entry. Indexers that wait for either miss it.

FIG. · Where it sits · inside LedgerCloseMetaCAP-0073 · H-D1
InvokeHostFunctionOp
LedgerEntryChange.created.TrustLineEntry
no operation event

The shape

Since CAP-0073 a contract call (the Stellar Asset Contract's trust function) can create a classic trustline. The trustline appears only as a created ledger entry in the operation's changes: there is no CHANGE_TRUST operation and no operation event. Readers that learn about trustlines from operation types or events drop it. wallet-backend recorded the balance but no TRUSTLINE/ADD state change (#731).

Variants

The variants are generated by a standalone stellar-core v30.0.0 at protocols 30 and 28. On most of them the order of the operation's changes is not stable between core processes, so those pin an order-normalised hash and list every raw ordering seen.

VariantProtocolNetworkSourceSizesha256
p30-mainnet-generatedP30mainnet passphrasegenerated by stellar-core v30.0.0
change order varies: 2 orderings in 20 runs
2,924 Ba08d8c7b8db5…
p28-mainnet-generatedP28mainnet passphrasegenerated by stellar-core v30.0.0
change order varies: 2 orderings in 2 runs
2,916 B86051026e6f0…
p30-testnet-generatedP30testnet passphrasegenerated by stellar-core v30.0.02,924 B4bd94c7a2455…
p28-testnet-generatedP28testnet passphrasegenerated by stellar-core v30.0.0
change order varies: 2 orderings in 2 runs
2,916 Ba37deedf9fde…

What a correct reader returns

A correct reader findsValueBacked by
The transaction calls trust on the XPF Stellar Asset Contract for bob.trustconstructionsnapshotcorewalker
The contract called is the SAC for XPF issued by the fixed issuer key; its ID depends on the network.
p30-mainnet-generated
CDFHSHLQOMFLCUBG5K36JGP2QH24MM6X5DLCTPXHHUPYF6CSRPQDXZUGconstructionsnapshotcorewalker
The contract called is the SAC for XPF issued by the fixed issuer key; its ID depends on the network.
p28-mainnet-generated
CDFHSHLQOMFLCUBG5K36JGP2QH24MM6X5DLCTPXHHUPYF6CSRPQDXZUGconstructionsnapshotcorewalker
The contract called is the SAC for XPF issued by the fixed issuer key; its ID depends on the network.
p30-testnet-generated
CBRDUZVZSMQJDBGSVV64VHIFDCUZFPPXE3BLTZK2NDEPACGV72MIYNFEconstructionsnapshotcorewalker
The contract called is the SAC for XPF issued by the fixed issuer key; its ID depends on the network.
p28-testnet-generated
CBRDUZVZSMQJDBGSVV64VHIFDCUZFPPXE3BLTZK2NDEPACGV72MIYNFEconstructionsnapshotcorewalker
Some change (in any order) creates bob's XPF trustline: balance 0, limit i64::MAX, authorized.some change where 6 fields matchconstructionsnapshotcorewalker
The operation emits no event: an indexer that waits for an event or a CHANGE_TRUST operation never learns about this trustline.length 0snapshot
The invocation succeeded.cbbc48750debb8535093b3deaf88ac7f4cff87425576a58de2bac754acdb4616snapshotcorewalker

The trustline is found by matching a change "in any order": an indexer must never depend on the order of changes within an operation.

What it reproduces

wallet-backend#731stellar-etl#460

make replay feeds this entry's P28 variant to two wallet-backend builds through a mock stellar-rpc. Build 764a4f5b drops the trustline: no TRUSTLINE/ADD state change is recorded. Build c152783c, "record SAC-created trustline state changes" (#734, the fix for #731), records it. See Replay.

Check it yourself

make verify
make replay

On this page