feat(transactions)!: integrate trigger executions into the transaction model
This PR is built on top of #5467. Please review #5467 first.
Overview
This PR overhauls the core transaction definition by treating the initial entrypoint and its subsequent data-trigger executions as a single transactional unit. In concrete terms:
- Redefined
CommittedTransactionto carry both:- The original
TransactionEntrypoint(external or time-triggered) - The resulting
TransactionResult(data-trigger sequence or rejection reason)
- The original
- Integrated Merkle inclusion proofs for both entrypoint and result, enabling clients to verify that the entrypoint and the result match the trusted block header
- However, see the Limitations section.
- Extended the query API (
FindTransactions) to return these proofs alongside the transaction data - Added fault-injection tests to simulate and detect maliciously tampered entrypoints or results
- See
tx_history::client_verifies_transaction_entrypoint_and_result_proofs
- See
timeline
title Transaction redefined, vertically and horizontally
section External Transactions
Entrypoint : Data Trigger : Data Trigger
Entrypoint : Data Trigger : Data Trigger : Data Trigger
Entrypoint : Data Trigger
section Time-triggered Transactions
Entrypoint : Data Trigger : Data Trigger : Data Trigger
Entrypoint : Data Trigger : Data Trigger
A column is a transaction, comprising an entrypoint and its data-trigger sequence:
block-beta
columns 2
block
columns 1
a["entrypoint"] c["sequence"]
end
block
columns 1
b["entrypoint"] d["sequence"]
end
External (user-requested) transactions precede time-triggered transactions in execution order:
block-beta
columns 2
block
columns 1
a["external"] c[" "]
end
block
columns 1
b["time-triggered"] d[" "]
end
Only external entrypoints are in block payloads. Others are recorded outside payloads but inside blocks as secondary state:
block-beta
columns 2
block
columns 1
a["source"] c[" "]
end
block
columns 1
b[" "] d[" "]
end
As a query result, a committed transaction consists of the entrypoint and the result (data-trigger sequence on success, or rejection reason on failure):
block-beta
columns 2
block
columns 1
a["entrypoint"] c["result"]
end
block
columns 1
b["entrypoint"] d["result"]
end
Breaking Changes
CommittedTransactionhas been updated with new fields; existing consumers must be updated accordingly.BlockHeadernow includes aresult_merkle_rootfield. This may be consolidated back into a single root in a future PR.SignedBlockV1now has aresult: BlockResultfield instead of anerrorsfield.TransactionEntrypointenum now combinesSignedTransactionandTimeTriggerEntrypointas its variants.
Related Issues
- Builds on PR #5467
- Closes #4968
- Opens #5473
Limitations
-
Merkle proofs require header verification to be effective, which is out of scope for this PR.
-
Actual result verification requires additional measures—see issue #5473.
-
Does not support
ExecuteTriggerandExecutable::Wasm, pending refactoring:// FIXME: remove ExecuteTrigger entirely in #5147. // FIXME: include actual instructions -- requires #5358 refactoring.