Documentation
¶
Overview ¶
Package collateralfee computes the fee-pot contribution of phase-2-invalid transactions. The Alonzo/Babbage UTXOS rule consumes the collateral inputs of an isValid=false transaction (minus its collateral return output) into the fee pot, and that pot is snapshotted as feeSS for the delayed reward calculation, so omitting it diverges every downstream reward value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForTransaction ¶
func ForTransaction( db *gorm.DB, tx lcommon.Transaction, pending PendingAmountFunc, ) (uint64, bool, error)
ForTransaction returns the lovelace amount an isValid=false transaction adds to the fee pot: consumed collateral inputs minus the collateral return output. Valid transactions return 0.
The declared total-collateral field is used when present because the Babbage UTXO rule requires it to equal the consumed balance; otherwise the collateral inputs are resolved from the utxo table (including already-spent rows) with pending as a fallback for same-batch producers.
The boolean reports whether every collateral input was resolved. On false the returned amount is a lower bound: unresolved inputs count as zero, matching the node's lenient consumed-UTxO recovery below the Mithril trust boundary.
Types ¶
type PendingAmountFunc ¶
PendingAmountFunc resolves the lovelace amount of a UTxO produced earlier in the current ingest batch but not yet flushed to the utxo table. It returns false when the reference is not an in-flight producer.