Skip to content

Tx evaluation#378

Closed
ginnun wants to merge 13 commits into
mainfrom
feat/tx-evaluation-rebased
Closed

Tx evaluation#378
ginnun wants to merge 13 commits into
mainfrom
feat/tx-evaluation-rebased

Conversation

@ginnun

@ginnun ginnun commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Resolves #306

Stacked on #537 - merge that one first.

Context

Implements tx evaluation APIs compatible with the Blockfrost.io version:

  • /utils/txs/evaluate
  • /utils/txs/evaluate/utxos

What is added

  • Two new endpoints with integration tests
  • bf-tx-evaluator crate providing native (Rust, via pallas-validate) and external (Haskell, via testgen-hs) evaluators
  • ChainConfigWatch in bf-node - a background task that watches the Cardano node and publishes protocol params + genesis config via tokio::sync::watch, refreshed only at epoch boundaries
  • Node helpers: ledger, utxo, chain_config_watch

What is changed

  • Pallas fork switched to blockfrost/pallas with pallas-validate (phase2 feature) for script evaluation
  • CBOR validation error messages improved (graceful fallback on pallas-hardano formatting failure)
  • Devshell picks up tools needed by the new native deps - m4 (for secp256k1-sys), make/awk/diffutils (for integration tests)
  • cardano-node trace silencing migrated to the newer API
  • CI: CARGO_PROFILE_DEV_DEBUG=0 on integration-test jobs to reduce disk pressure

What is scoped out (now in #537)

  • testgen-hs subprocess handling extracted from crates/node/src/cbor/ into dedicated bf-testgen and bf-error-decoder crates
  • testgen-hs version bump to 10.6.3.1 and release binary downloads switched to blockfrost/testgen-hs
  • build_utils target detection helpers factored out

@ginnun ginnun marked this pull request as draft September 12, 2025 10:03
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 12, 2025

Copy link
Copy Markdown

Deploying blockfrost-platform with  Cloudflare Pages  Cloudflare Pages

Latest commit: e4991eb
Status: ✅  Deploy successful!
Preview URL: https://96df9d93.blockfrost-platform.pages.dev
Branch Preview URL: https://feat-tx-evaluation-rebased.blockfrost-platform.pages.dev

View logs

@michalrus michalrus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey, I started reviewing, but then noticed that it's a draft! Left a few comments either way :)

Comment thread nix/internal/unix.nix Outdated
Comment thread nix/internal/unix.nix Outdated
Comment thread src/api/utils/txs/evaluate/model.rs Outdated
Comment thread crates/testgen/src/testgen.rs Outdated
Comment thread crates/node/src/cbor/fallback_decoder.rs Outdated
@ginnun ginnun force-pushed the feat/tx-evaluation-rebased branch 3 times, most recently from c702f03 to a53a53c Compare September 22, 2025 12:06
@ginnun ginnun changed the title Feat/tx evaluation rebased Tx evaluation Sep 23, 2025
@ginnun ginnun force-pushed the feat/tx-evaluation-rebased branch 2 times, most recently from 3bcc5c5 to e67b1a9 Compare October 10, 2025 11:35
@ginnun ginnun marked this pull request as ready for review December 15, 2025 10:02
@ginnun ginnun force-pushed the feat/tx-evaluation-rebased branch from 6980be7 to f269525 Compare January 16, 2026 09:32
@michalrus

Copy link
Copy Markdown
Member

Maybe let's have a simpler merge commit for the current conflicts? 🥺 Unless you're using git-rerere.

@michalrus

Copy link
Copy Markdown
Member

I've just merged main into this PR in cd2794a — I hope correctly… … 🫣

@michalrus michalrus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I pushed another merge with main, because there were some more conflicts to resolve. I hope I did that correctly!

Now I see that cargo test tests are failing:

❯ cargo nextest run --workspace --lib --verbose

…

     Summary [  76.650s] 650 tests run: 195 passed, 455 failed, 0 skipped

Stuff like:

        FAIL [   1.058s] blockfrost-platform-error-decoder external::tests::test_cbor_0001_ConwayTreasuryValueMismatch_Coin_Coin

Or:

        FAIL [   1.086s] blockfrost-platform-error-decoder tests::specific::test_cbor_0013_ConwayWdrlNotDelegatedToDRep_KeyHash_KeyHash

@michalrus

Copy link
Copy Markdown
Member

Maybe the tests are failing because my commits updated testgen-hs to 10.4.1.2 also in the devshell. And it's the one against which the old CBOR tests are being run. 🤔

@ginnun

ginnun commented Feb 20, 2026

Copy link
Copy Markdown
Contributor Author

Everything is working related to this PR. The CI failure is caused by updated ledger codebase coming from the testgen-hs binary

@michalrus

michalrus commented Feb 23, 2026

Copy link
Copy Markdown
Member

The CI failure is caused by updated ledger codebase coming from the testgen-hs binary

So what do you suggest to be a solution here?

Maybe update testgen-hs in a separate PR, to not mix them, and fix it there? And park this one until we're again matching the Haskell trasaction submission errors?

(I think we shouldn’t be merging "red" ❌ PRs.)

@michalrus

Copy link
Copy Markdown
Member

@ginnun wait, but why did I get the same error in:

I don’t have your changes (the updated testgen-hs).

So the integration tests would also fail on main now? Perhaps due to devops updating cardano-node in the "legacy" Blockfrost API?

@michalrus

Copy link
Copy Markdown
Member

Look here:

Deploying cardano-node version v10.6.2 to dev hosts

on 2026-02-19T02:55:30,167769000+00:00.

@ginnun

ginnun commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

So what do you suggest to be a solution here?

The plan is to fix/update the code for pallas/hardano. Until than, we can disable that specific test since it will fail for every branch. What do you say @michalrus ?

@michalrus

Copy link
Copy Markdown
Member

The plan is to fix/update the code for pallas/hardano.

Great! Here's a tracking issue for this new work:

@michalrus

michalrus commented Feb 23, 2026

Copy link
Copy Markdown
Member

Until than, we can disable that specific test since it will fail for every branch. What do you say @michalrus ?

I suppose… Hmm, WDYT, @vladimirvolek?

This temporary fix is in:

@ginnun ginnun force-pushed the feat/tx-evaluation-rebased branch 2 times, most recently from a4a277d to dde536f Compare February 27, 2026 15:03
Comment thread nix/internal/unix.nix Outdated
Comment thread nix/internal/unix.nix Outdated
@ginnun ginnun force-pushed the feat/tx-evaluation-rebased branch from 6642500 to 1db6c61 Compare March 2, 2026 15:02
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.

Add POST /utils/txs/evaluate – how many execution units for a transaction

5 participants