Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

bug: maxRefScriptSizePerTx limit is 200,000 bytes instead of 204,800

Closed
#178 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
58/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
blockchain

Research direction

Open packages/evolution/src/sdk/builders/TxBuilderImpl.ts and inspect calculateReferenceScriptFee and its current 200,000-byte comparison. Change the Conway-era cap to 204,800 bytes (200 KiB), then verify that totals through 204,800 bytes are accepted while larger totals are rejected.

Written by the indexing model from the issue text.

Description

bug

Summary

calculateReferenceScriptFee in TxBuilderImpl.ts rejects transactions whose total reference script size exceeds 200,000 bytes. The correct Conway-era hard cap is 204,800 bytes (200 × 1024 = 200 KiB).

Transactions with total reference script sizes between 200,001 and 204,800 bytes are incorrectly rejected by the SDK but would be accepted by the node.

Root Cause

// current (wrong)
if (totalScriptSize > 200_000) {

The Cardano Conway ledger hardcodes the limit as 200 * 1024:

ppMaxRefScriptSizePerTxG = L.to . const $ 200 * 1024  -- 204,800 bytes

Source: ConwayEraPParams instance in eras/conway/impl/src/Cardano/Ledger/Conway/PParams.hs. Documented in ADR-009.

Note: these become proper protocol parameters in Dijkstra era (ppMaxRefScriptSizePerTxL).

Fix

if (totalScriptSize > 204_800) {
  // maxRefScriptSizePerTx: 200 * 1024 = 204,800 bytes (200 KiB)
  // Hardcoded in Conway era, becomes a protocol parameter in Dijkstra era.

Affected File

packages/evolution/src/sdk/builders/TxBuilderImpl.ts — calculateReferenceScriptFee

Dominant language
TypeScript
Stars
22
Forks
31
Avg merge
3d 19m
Merged PRs (30d)
25

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from IntersectMBO/evolution-sdk

All issues in IntersectMBO/evolution-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.