CBOR: tags with 4- and 8-byte headers fail to decode, and two smaller preservation gaps
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #635 @Kshot3000 による — マージされずにクローズ
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start in packages/evolution/src/CBOR.ts at decodeTagAt and encodeMapSync, then review the preservation specification at .specs/cbor-encoding-preservation.md. Update the documentation comment in docs/content/docs/encoding/cbor.mdx and add the listed regression cases for tag 258 and the bfff witness set. Done means the tests fail on main, pass after the changes, and both inputs round-trip byte for byte.
索引モデルが issue の本文から書いたものです。
説明
Three small gaps found while testing format preservation, in order of impact.
1. Tags with a 4- or 8-byte header fail to decode
decodeTagAt accepts tag headers only up to 2 bytes, so a transaction that writes tag 258 as da00000102 fails with CBORError: Unsupported tag encoding: 26. The node accepts that transaction, and CML round-trips it byte for byte. The spec says tag header width is preserved (.specs/cbor-encoding-preservation.md L180-183) and lists "non-minimal tag width" as supported (L329), which holds only for 1- and 2-byte headers.
Affected: packages/evolution/src/CBOR.ts decodeTagAt (L2044-2054), which has no branch for additional info 26 or 27.
Fix: decode 4- and 8-byte tag headers and record the width, as integer headers already do.
Devnet, raw submission through Ogmios: inputs written as 00 da00000102 81 [input], signed over their own body, were accepted. Transaction.fromCBORHex on the same bytes throws.
2. An empty indefinite witness set is written back as a0
An unsigned transaction with witness set bfff comes back from fromCBORHex then toCBORHex with a0. The body and the transaction id are unchanged, because the id is taken over the body only (cardano-ledger Core.hs L651), so no signature is affected. addVKeyWitnessesHex keeps the indefinite map. CML round-trips it byte for byte.
Affected: the empty map fast path in encodeMapSync (L1371), the same one #576 fixes for Plutus data. The fix for #576 covers this too; this entry only adds a regression case.
3. The CBOR guide says re-encoding is canonical by default
docs/content/docs/encoding/cbor.mdx L37 comments "Re-encode to hex (canonical by default)". The default, CML_DEFAULT_OPTIONS, keeps map insertion order (sortMapKeys: false), and the same page says so at L135. The comment should say the default keeps the original order.
Regression test
Transaction.fromCBORHexaccepts tag 258 written with a 4-byte header, andtoCBORHexreturns the same bytes84 [body] bfff f5 f6round-trips byte for byte
Must FAIL on main today and PASS after the fix.
- 主要言語
- TypeScript
- スター
- 22
- フォーク
- 34
- 平均マージ
- 16時間 53分
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
IntersectMBO/evolution-sdk のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
IntersectMBO/evolution-sdk#696 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
IntersectMBO/evolution-sdk#694 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
IntersectMBO/evolution-sdk#559 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
IntersectMBO/evolution-sdk#557 ·
メンテナーはふだん 1 日以内に返信
-
RewardAccount: validate header type bits and bech32 prefix再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンenhancement external-review
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
IntersectMBO/evolution-sdk#456 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
IntersectMBO/evolution-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
triage: failed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
oxc-project/tsrs#1277 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ardia-browser/ardia#6798 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
novuhq/novu#13613 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement from-app needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nightly-labs/openbot#23943 ·
メンテナーはふだん 1 日以内に返信