bug: maxRefScriptSizePerTx limit is 200,000 bytes instead of 204,800
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
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IntersectMBO/evolution-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
IntersectMBO/evolution-sdk#579 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
IntersectMBO/evolution-sdk#559 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
IntersectMBO/evolution-sdk#557 ·
Maintainers usually reply within 1 day
-
dependencies good first issue
Difficulty 1/5 Under an hour Newbie friendliness 93/100
IntersectMBO/evolution-sdk#541 ·
Maintainers usually reply within 1 day
-
bug external-review
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
IntersectMBO/evolution-sdk#530 ·
Maintainers usually reply within 1 day
All issues in IntersectMBO/evolution-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
automated issue report
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 92/100
github/copilot-sdk#2804 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
drizzle-team/drizzle-orm#6418 ·
Maintainers usually reply within 4 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
diegosouzapw/OmniRoute#15307 · 1 comment ·
Maintainers usually reply within 2 days