Native scripts nested past about 660 levels break getUtxos
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Start with NativeScripts.ts:335-359 and NativeScripts.ts:368,423,432,441 to trace recursive validation and decoding; compare the cold and warmed depth measurements in the issue. Then inspect the listed provider call sites and error handlers in BlockfrostEffect.ts, Koios.ts, KoiosEffect.ts, Maestro.ts, and KupmiosEffects.ts. Done means ledger sized scripts decode in linear time and provider read failures surface as ProviderError; the issue names no test file.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
NativeScripts.fromCBORHex("820181".repeat(670) + "820400"), an all script nested 670 levels deep in 2,013 bytes, throws RangeError: Maximum call stack size exceeded on a first call in a fresh process. At 660 levels it decodes. Once the code is warm, 1,200 levels decode and 2,500 fail. Decoding time grows with the square of the depth: 0.2 s at 100 levels, 0.9 s at 200, 2.7 s at 400 and 6.3 s at 600, all wall clock. The limits are the same before and after #677.
With fetch stubbed to return a UTxO whose reference script is such a script nested 2,000 levels, getUtxos fails on Blockfrost, Koios, Maestro and Kupmios. In each case the exit holds the RangeError as a defect, an untyped failure, not a ProviderError, so catchAll handlers never see it.
NativeScripts.FromCDDL (NativeScripts.ts:368) type-checks its input against the recursive CDDLSchema union (NativeScripts.ts:335-359) and its output against NativeScript. It decodes each nested script with a fresh ParseResult.decode(FromCDDL) (NativeScripts.ts:423, 432, 441), which type-checks that subtree again. Each level adds call frames to one recursion and repeats the checks for everything below it. The providers call the decoder inside Effect.map or Effect.gen bodies, where a thrown error becomes a defect that Effect.catchAll does not catch:
- Blockfrost:
BlockfrostEffect.ts:190-195, past the handlers atBlockfrostEffect.ts:306andBlockfrostEffect.ts:345 - Koios:
Koios.ts:215, called fromKoios.ts:257, pastKoiosEffect.ts:94 - Maestro:
Maestro.ts:307, called fromMaestroEffect.ts:104 - Kupmios:
KupmiosEffects.ts:131-139, pastKupmiosEffects.ts:156
The ledger decodes native scripts with no depth limit (cardano-ledger d0e20888, Allegra/Scripts.hs:226-236; Conway uses the same Timelock type, Conway/Scripts.hs:74). A nested all costs 3 bytes, so one 16,384-byte transaction can create a reference script about 5,400 levels deep. Anyone can put such a script in a UTxO at any address, and getUtxos() then fails for the whole address. #662 describes the same failure for inline datums.
NativeScripts.fromCBORHex should decode any native script the ledger accepts in time linear in its size, and a provider that cannot read a UTxO should fail with a ProviderError.
- Ngôn ngữ chính
- TypeScript
- Star
- 22
- Fork
- 33
- Merge trung bình
- 21 giờ 38 phút
- Pull request đã merge (30 ngày)
- 55
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của IntersectMBO/evolution-sdk
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
IntersectMBO/evolution-sdk#696 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
IntersectMBO/evolution-sdk#694 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
IntersectMBO/evolution-sdk#559 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
IntersectMBO/evolution-sdk#557 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
txBuilder: committee cert redeemers are never resolved to a certificate indexCó thể đã có người làm @emmanuel-musau đã nhận 14 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
IntersectMBO/evolution-sdk#518 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của IntersectMBO/evolution-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
complexity:simple priority:P3 ready-to-build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
junruxiong/IncarnaMind#2919 ·
-
Runner API: GET /api/jobs/<id> returns branch: null; the branch only appears under input.branchĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
radiancelux/prgenie#204 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
cqframework/vscode-cql#198 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
WalletConnect/walletconnect-monorepo#7392 · 1 bình luận ·