Declarative CBOR schema via annotations (CborId)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- backend
調査の方向性
CBOR.ts で、提案されている CborId アノテーション型と codec engine の設計を読み始め、次に TransactionBody、TransactionWitnessSet、Transaction の既存の FromCDDL および CDDLSchema 実装を調査します。Tag-258 セット、redeemer の map/array 二重性、ネストされた map、オプションフィールド、エンコーディングの保持を網羅し、後方互換性を維持したまま、該当するすべてのモジュールの変換が完了すれば、完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Replace hand-written FromCDDL transforms with declarative schema annotations that describe CBOR wire format directly on Effect Schema types.
Motivation
Currently each module (TransactionBody, TransactionWitnessSet, Transaction, etc.) has:
- A
CDDLSchema(intermediate CBOR AST type) - A
FromCDDLtransform (hand-written 200-500 line encode/decode) - A
FromCBORBytesthat composesFromByteswithFromCDDL
This creates a two-hop pipeline (Uint8Array → CBOR AST → domain) with a validation boundary that clones objects and strips Symbol metadata (e.g. kEncoding for encoding preservation).
Proposal
A CborId Symbol annotation on Effect Schemas that carries CBOR layout metadata:
const CborId = Symbol.for("evolution/CborId")
const Address = Schema.Uint8ArrayFromSelf.annotations({
[CborId]: { tag: 259 }
})
const Value = Schema.Struct({
coin: Schema.BigIntFromSelf,
multiasset: Schema.optional(MultiAsset),
}).annotations({
[CborId]: { encoding: "array", fieldOrder: ["coin", "multiasset"] }
})
const TransactionOutput = Schema.Struct({
address: Address,
value: Value,
datum: Schema.optional(Datum),
scriptRef: Schema.optional(ScriptRef),
}).annotations({
[CborId]: { encoding: "map", keys: { address: 0n, value: 1n, datum: 2n, scriptRef: 3n } }
})
A generic CBOR codec engine reads [CborId] annotations to:
- Map struct fields to integer-keyed CBOR map entries or positional array slots
- Wrap values in CBOR tags (e.g.
#6.258for sets) - Handle optional fields (omit from map when undefined)
- Thread
kEncodingpreservation metadata automatically
Benefits
- Eliminates
FromCDDL— no hand-written encode/decode per module - Eliminates
CDDLSchema— domain schema IS the codec schema, no intermediate type - Encoding preservation is free — single transform boundary, no clone/Symbol stripping
- Self-documenting — annotations describe the wire format directly
- Less code — TransactionBody goes from ~500 lines of transform to ~25 lines of annotated schema
Scope
- Build
CborIdannotation types and codec engine in CBOR.ts (~200-400 lines) - Convert all modules with FromCDDL transforms to use annotated schemas
- Handle edge cases: Tag-258 sets, redeemer map/array duality, nested maps, etc.
- Maintain backward compatibility with existing domain types
Context
Discovered during CBOR encoding preservation work. The immediate fix (replacing MapFromSelf/Tuple CDDLSchemas with non-cloning Schema.declare) unblocks encoding preservation. This issue tracks the larger architectural improvement.
- 主要言語
- TypeScript
- スター
- 22
- フォーク
- 31
- 平均マージ
- 3日 4時間
- マージ済み PR(30日)
- 27
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
IntersectMBO/evolution-sdk のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
IntersectMBO/evolution-sdk#579 ·
メンテナーはふだん 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 日以内に返信
-
dependencies good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 93/100
IntersectMBO/evolution-sdk#541 ·
メンテナーはふだん 1 日以内に返信
-
bug external-review
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
IntersectMBO/evolution-sdk#530 ·
メンテナーはふだん 1 日以内に返信
IntersectMBO/evolution-sdk の issue をすべて見る
似ている issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
lingdojo/kana-dojo#31666 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
Bug: lockTtlSeconds / lockHeartbeatIntervalSeconds accept non-positive and non-finite values対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
CopilotKit/CopilotKit#7618 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wimpysworld/sidra#287 ·
メンテナーはふだん 1 日以内に返信
-
bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sleeyax/paseo-plugins#112 ·
メンテナーはふだん 2 日以内に返信