Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full input UTXO as part of input context #184

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

SebastienGllmt
Copy link
Contributor

Previously the input content only included addresses which is not enough for the majority of use-cases. This PR switches it to instead provide the full UTXO payload of the input

Note: this is a breaking change

@SebastienGllmt SebastienGllmt added the enhancement New feature or request label Mar 31, 2024
@@ -69,11 +69,11 @@ WITH
"Block".era as "era!",
"Block".height as "height!",
"TransactionMetadata".payload AS metadata,
json_agg(DISTINCT "Address".PAYLOAD) input_addresses
array_agg("TransactionOutput".PAYLOAD) input_utxo
Copy link
Contributor

Choose a reason for hiding this comment

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

do we care about the order of these? I think not since inputs are a set, but asking just in case, since there is no way to match these with the inputs in the tx body otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah we probably should keep them ordered. Although strictly speaking Cardano doesn't enforce an order, this was definitely a mistake in the Cardano infrastructure since it means matching inputs for Plutus is really expensive since you need to do a O(n) scan over all inputs instead of an O(1) lookup for the index you know and we probably shouldn't make the same mistake

@SebastienGllmt SebastienGllmt merged commit 61fe5f2 into main Sep 14, 2024
2 checks passed
@SebastienGllmt SebastienGllmt deleted the input-utxo-context branch September 14, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants