Skip to content

Conversation

@golddydev
Copy link
Collaborator

@golddydev golddydev commented Dec 15, 2025

Description

Integrate UTxOW rules check into omnibus process and add test cases for each UTxOW rules (expect transaction with native script)

Also make tx_unpacker, utxos_state, block_vrf_validator, block_kes_validator to use ValidationOutcomes.

Related Issue(s)

Related to #424 #473

How was this tested?

Add unit tests to utxos_state and tx_unpacker for UTxOW rules and BadInputsUTxO check.

Checklist

  • My code builds and passes local tests
  • I added/updated tests for my changes, where applicable
  • I updated documentation (if applicable)
  • CI is green for this PR

Impact / Side effects

In utxos_state, we validate the transactions and this will make process run a bit slower.

Reviewer notes / Areas to focus

utxos_state/src/utxo_state.rs - Where we validate transactions from UTxODeltasMessage

@golddydev golddydev changed the base branch from main to gd/add-utxow-rules December 15, 2025 13:18
@golddydev golddydev changed the base branch from gd/add-utxow-rules to main December 16, 2025 13:26
@golddydev golddydev mentioned this pull request Dec 17, 2025
4 tasks
@golddydev golddydev marked this pull request as ready for review December 18, 2025 17:36
Copy link
Collaborator

@sandtreader sandtreader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work - I really like the referencing and the collecting the UTXOs needed for a transaction - that will be needed for the script context in phase 2 as well.

I'm worried about the switch from tx.consumes() to tx.inputs() though - I remember digging this out at the very beginning, consumes() handles the case of a phase 2 validation failure and consumption of the collateral. If this is only being used for validation and you handle collateral later, that's fine, but if it's used for the actual UTXO processing I think this will break things.

codec/src/tx.rs Outdated
let tx_hash = TxHash::from(*tx.hash());

for input in tx.consumes() {
for input in tx.inputs() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beware! consumes() covers the case where the transaction phase 2 validation fails and the collateral is consumed instead of the input.

See https://github.com/txpipe/pallas/blob/2aba7fff1498d3e0cea082d61b08f6e0f7506891/pallas-traverse/src/tx.rs#L411

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks for pointing this out 👍🏼

34e5e52

TxCertificateWithPos, Withdrawal,
};

/// Get VKey Witnesses needed for transaction
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice references and explanation!

Copy link
Collaborator

@sandtreader sandtreader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks!

@golddydev
Copy link
Collaborator Author

c6d7588

Just renamed inputs and outputs to consumes and produces to reduce confusion later.

c6d7588

codec/src/tx.rs Outdated
parsed_inputs.push(utxo);
}

for (index, output) in tx.outputs().iter().enumerate() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be tx.produces() for the same reason, but check my logic!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is right, I only changed the name 😓
a2a8a98

@golddydev golddydev merged commit a965f4f into main Dec 19, 2025
2 checks passed
@golddydev golddydev deleted the gd/integrate-utxow-rules branch December 19, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants