Skip to main content

Crate thruput_tx_validation

Crate thruput_tx_validation 

Source
Expand description

Off-chain mirror of the bounds hogd checks before executing a transaction.

hogd’s SystemCallHandler::perform_initial_validation rejects a transaction deterministically, before running any of it, when its root invocation budgets more gas than the chain’s max_tx_gas, when it attaches more contracts than the chain’s network config permits, when any attached contract’s code exceeds the size the config admits, when the same contract is attached twice, or when an attached RV32 artifact declares more guest memory or code than the config admits (the attachment fails verification in NewContractSet::make). Applying the same checks before submission turns a silent later failure into an immediate, structured TxInvalidDetail.

The chain-configured bounds are read from the network config a db tip carries, flattened once into NetworkConfigParams so every later access is a field read. A bound is enforced only with a value the protocol defines: the one the config states, or, for the parameters whose unstated value the protocol itself fixes (kDefaultMaxContractSizeBytes, kDefaultMaxRv32CodeBytes, kDefaultMaxRv32MemoryBytes, and max_tx_gas’s 1,000,000,000), that constant. Nothing is copied from hogd’s own fallbacks. None of this is a trust boundary: the executor re-checks everything, and a reading that lags a block is harmless because these parameters change only through explicit config upgrades.

Structs§

NetworkConfigParams
The execution parameters a chain’s network config states, flattened from the list that carries them. Backs the getChainConfig response.
UnknownConfigParamName
A name that does not belong to any parameter this build knows.
UnsupportedNetworkConfig
A network config whose version this build cannot interpret.

Enums§

ConfigParamName
The name a chain execution parameter carries outside its XDR encoding.

Functions§

check_transaction
Check a decoded transaction against the executor’s pre-execution bounds.