fix(ouroboros): Made changes to handle repeated blockfetch NoBlocks requests
Signed-off-by: Akhil Repala <[email protected]>
Signed-off-by: Akhil Repala <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
When partialFanout returns Left during the binary search fallback the error was silently discarded. Now emits PartialFanoutFailed with the reason before throwing StalePartialFanoutTx, making unrecoverable failures visible in the node logs. Signed-off-by: Sasha Bogicevic <[email protected]>
- fitsTx: verify short-circuit (size check before UPLC eval), failure
on budget/script errors, success path, and a real-world test against
actual Cardano protocol parameters and evaluateTx
- findLargestFitting: verify O(log n) call count via pure (Sum Int, a)
monad, correct propagation of mkTx/fitsCheck exceptions, and
monotone correctness via round-trip
- UTxO splitting: replace three fixed-value unit tests with one property
test covering normal split, n-exceeds-size, and empty-UTxO cases,
with cover thresholds to enforce all branches are exercised
Signed-off-by: Sasha Bogicevic <[email protected]>
Eliminates the `either (const Nothing) Just` conversion at each call site by changing the preferred-tx parameter from `Maybe Tx` to `Either e Tx` and pattern matching on `Right`/`Left` in `findBest`. Signed-off-by: Sasha Bogicevic <[email protected]>
Extend TinyWallet with isTxWithinSizeLimits to check serialised tx byte size against ppMaxTxSizeL from current protocol parameters. Replace the linear scan in findFittingFanoutTx with a binary search (findLargestFitting) that finds the largest chunk that fits within both size and script execution limits. A short-circuiting fitsTx check runs the cheap size check before the expensive UPLC evaluation. Structural failures from partialFanout abort the search immediately since they are independent of chunk size. Both functions are extracted as testable top-level exports and covered by property tests: fitsTx tests verify short-circuit behaviour and correct result combination using real Cardano protocol parameters and evaluateTx; findLargestFitting tests verify the monotone-predicate property and the O(log n) evaluation bound using the built-in Monad instance for (,) (Sum Int). Signed-off-by: Sasha Bogicevic <[email protected]>
Also reduce a diff in the test code Signed-off-by: Sasha Bogicevic <[email protected]>
- HeadLogic: FanoutInProgress case must convert Set (TxOutType tx) to
UTxOType tx via filterUTxOByOutputs/computeFullFanoutUTxO before passing
to FinalPartialFanoutTx.utxoToDistribute
- State/Handlers: remove non-existent splitUTxOAt and sizeUTxO (were
introduced in the branch but never added to Hydra.Tx); inline the UTxO
split using take/drop on UTxO.toList, and replace sizeUTxO with UTxO.size
- HeadLogicSpec: remainingUTxO field renamed to remainingOutputs (master's
name from the partial-fanout PR); replace removed PartialFanoutTx
PostChainTx constructor with FinalPartialFanoutTx
- HandlersSpec/StateSpec: add missing imports (finalPartialFanout,
unsafePartialFanout, UTxO); rewrite splitUTxOAt tests with inline splits
Signed-off-by: Sasha Bogicevic <[email protected]>
Remove the two duplicate binarySearch helpers from computePartialFanOutNominalCost and computePartialFanOutMixedCost and replace them with the shared findLargestFitting from Hydra.Chain.Direct.Handlers. Also use fanoutChunkSize from fixture in the membership proof bench group name instead of a hardcoded literal. Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Replace the hardcoded numToDistribute = totalUTxO - 1 in the partial fanout benchmarks with a binary search that finds the largest chunk actually fitting within both the tx size and execution budget, mirroring findFittingFanoutTx in the real node. The Remaining column in the output table now carries meaningful information instead of always showing 1. Also add ContestationDeadlineOutsideTimeHorizon to the PostTxError oneOf in api.yaml, which was defined in Chain.hs but missing from the schema, causing ServerOutputSpec to fail. Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
computeFinalPartialFanOutCost was capped at 7 (fanoutChunkSize), hiding the real tx-size limit for the terminal fanout step. Now it sweeps a wide range and searches for the actual maximum, using a single preceding output as minimal setup to reach FanoutProgress. computePartialFanOutMixedCost also dropped its fanoutChunkSize cap and now distributes all-but-one outputs, consistent with the nominal benchmark. The stale description mentioning fanoutChunkSize is corrected accordingly. Signed-off-by: Sasha Bogicevic <[email protected]>
fanoutChunkSize and fanoutOutputThreshold are now defined once in Test.Hydra.Tx.Fixture and imported wherever needed, removing the per-file duplicates. prepareTxToPost gains explicit FanoutTx/FinalPartialFanoutTx branches (error) so GHC's exhaustiveness checker catches any future unhandled constructor, instead of silently falling through a wildcard. The two deadline-slot conversions in mkChain.postTx now throw FailedToConstructFanoutTx (a PostTxError Tx) instead of userError, so the exception is caught by Node.hs's PostTxError handler rather than propagating uncaught and crashing the node.
HeadLogic no longer uses fanoutChunkSize or fanoutOutputThreshold to decide which tx type to emit. For a fresh fanout it always emits FanoutTx; for an in-progress fanout it always emits FinalPartialFanoutTx. Handlers now owns the sizing decision: it tries the preferred tx first, then falls back to PartialFanoutTx with a decreasing chunk size (starting at N-1) until one fits within the execution budget, using a single shared findFittingFanoutTx helper. PartialFanoutTx is removed from PostChainTx — it is now an internal Handlers detail, never emitted by HeadLogic. fanoutChunkSize and fanoutOutputThreshold are removed from KZGTrustedSetup and all call sites.
Signed-off-by: Chris Gianelloni <[email protected]>
Signed-off-by: Chris Gianelloni <[email protected]>
Signed-off-by: Chris Gianelloni <[email protected]>
* fix(ci): fix check-version workflow Signed-off-by: Tripura Repalle <[email protected]> * fix(ci): fix check-version workflow Signed-off-by: Tripura Repalle <[email protected]> * fix(ci): fix check-version workflow Signed-off-by: Tripura Repalle <[email protected]> --------- Signed-off-by: Tripura Repalle <[email protected]>