TxOut: map-form outputs without a script ref are re-encoded as arrays, changing the transaction id
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
- #633 @Kshot3000 による — マージされずにクローズ
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- blockchain
調査の方向性
Start in packages/evolution/src/TxOut.ts, reading the decode and encode paths around the format node and canUseShelleyFormat. Use the listed transaction cases as regression coverage, including addVKeyWitnessesHex and toCBORHexWithFormat. Done means map-form outputs round-trip byte-identically while array-form and freshly built transactions remain unchanged.
索引モデルが issue の本文から書いたものです。
説明
Summary
An output written in the post-Alonzo map form, with no script ref, comes back from Transaction.fromCBORHex then Transaction.toCBORHex in the legacy array form. Nothing else was changed. The body bytes change, so the transaction id changes and every witness already collected no longer verifies. Transaction.addVKeyWitnessesHex and Transaction.toCBORHexWithFormat do the same.
| Received | Written back |
|---|---|
a2 00 [addr] 01 [coin] |
82 [addr] [coin] |
bf 00 [addr] 01 [coin] ff |
82 [addr] [coin] |
a3 00 [addr] 01 [coin] 02 8200 5820 [hash] |
83 [addr] [coin] 5820 [hash] |
Outputs with an inline datum or a script ref keep the map form, and array-form outputs keep the array form.
The ledger accepts both forms for these outputs and hashes the bytes as received:
- cardano-ledger
Babbage/TxOut.hsL549-551:decodeBabbageTxOutsends definite and indefinite maps todecodeTxOut, which requires only keys 0 and 1 (L658-661). Everything else goes to the array decoder. Conway/TxOut.hsL37:type TxOut ConwayEra = BabbageTxOut ConwayEra.Core.hsL651: the transaction id ishashAnnotatedover the original body bytes.
The ledger's own encoder writes these outputs as arrays (Babbage/TxOut.hs L505-506), and so does CML's builder, so the map form comes only from other tools that choose it.
Affected
packages/evolution/src/TxOut.ts
- encode (L242-252):
canUseShelleyFormatpicks the array form whenever there is no script ref and the datum is absent or a hash - decode (L274 onward) reads both forms into the same value and does not record which one it read
The captured format node says map while the encoder produces an array, so the format is dropped for that output, the same shape mismatch as #574.
Fix
Let the captured format decide the form. When the format node for an output is a map, encode the map form with that node. With no captured format, keep today's choice, so freshly built transactions do not change. An edit that adds a datum or script ref still moves to the map form, as today.
Regression test
Oracle is the node; CML agrees on every case below.
- given: a transaction with tagged inputs and one output in each form in the table above
- before fix: the output is written as an array and the body hash changes
- after fix: byte-identical, and
addVKeyWitnessesHexleaves the body bytes unchanged - control: array-form outputs and map-form outputs with an inline datum are unchanged; a builder-made transaction is unchanged
Devnet, raw submission through Ogmios, output a2 00 [addr] 01 [coin]:
- original bytes signed over their own body: accepted
- same transaction after
addVKeyWitnessesHex: rejected, 3100 invalid signatures
Must FAIL on main today and PASS after the fix.
Reference
Same class as #574 and #576: the decoder accepts two forms, and the encoder writes one without consulting the captured format.
- 主要言語
- 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 日以内に返信