Skip to content

fix: use Conway maxRefScriptSizePerTx limit 204,800 bytes (200 KiB)#185

Open
danbaruka wants to merge 1 commit intoIntersectMBO:mainfrom
danbaruka:fix/maxRefScriptSizePerTx-204800
Open

fix: use Conway maxRefScriptSizePerTx limit 204,800 bytes (200 KiB)#185
danbaruka wants to merge 1 commit intoIntersectMBO:mainfrom
danbaruka:fix/maxRefScriptSizePerTx-204800

Conversation

@danbaruka
Copy link
Member

Summary

calculateReferenceScriptFee in TxBuilderImpl.ts was rejecting transactions whose total reference script size exceeded 200,000 bytes. The Conway-era hard cap is 204,800 bytes (200 × 1024 = 200 KiB). Transactions with total reference script size between 200,001 and 204,800 bytes were incorrectly rejected by the SDK but accepted by the node.

Closes #178

Root cause

The check used a literal 200_000 instead of the ledger constant 200 * 1024:

  • Before: if (totalScriptSize > 200_000)
  • After: if (totalScriptSize > 204_800)

Source: Conway ledger ppMaxRefScriptSizePerTxG = 200 * 1024 (ConwayEraPParams, ADR-009). This becomes a protocol parameter in Dijkstra era (ppMaxRefScriptSizePerTxL).

Changes

  • packages/evolution/src/sdk/builders/TxBuilderImpl.ts (calculateReferenceScriptFee):
    • Limit changed from 200_000 to 204_800.
    • Comment updated to document 200 × 1024 = 204,800 bytes (200 KiB), Conway hardcap, and Dijkstra protocol parameter.
    • Error message updated to say "204,800 bytes".

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.

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

1 participant