Phoenix price points are keyed on the wall clock, so a replay is stored twice
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- postgresql, typescript
調査の方向性
src/ingest/venues/phoenix.tsの426〜470行付近を読み、src/ingest/venues/soroswap.tsの392行付近にあるIDのパターンと比較し、src/db.tsのupsertPricePointsを確認してください。src/__tests__/phoenixIngester.test.tsとsrc/__tests__/pricePointIdentity.test.tsのテストを追加または更新し、同一のプール読み取りで安定したIDが生成されること、リザーブが変わると異なるIDが生成されること、バッチを再実行しても行が追加されないことを検証してください。該当するVitestテストを実行してください。IDに時刻や乱数の値を使わず、列挙されたIDと再実行のすべてのケースに合格すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Background
Issue #237 set a rule for rows that have no trade id: the row's identity must
come from the state that was read, never from the clock. The Soroswap adapter
states it in a comment: "Must never be Date.now()/random." The Horizon AMM
keys its snapshot on (pool, last_modified_ledger).
derivePhoenixPricePoints in src/ingest/venues/phoenix.ts (line 467) breaks
the rule:
eventId: `phoenix-${raw.poolAddress}-${Date.now()}`,
Every call makes a new id. A retried batch, or a second instance reading the
same pool, inserts the same observation again. The function is also documented
as "Pure", and it is not.
What to build
- Derive the id from the pool state: the pool address and the two reserves,
as Soroswap does (soroswap-${pool}-${reserveA}-${reserveB}). - Make sure the id does not depend on which way round the pool stores the
pair. The function swapsaandbfor a reversed pool; build the id from
the raw reserves before the swap, or from a fixed order. - Check what this does to an unchanged pool: identical reserves now produce
the same id, so the second write is skipped as a duplicate. Say in the PR
whether that is the wanted behaviour and what it means for freshness.
Where to look
src/ingest/venues/phoenix.tslines 426–470src/ingest/venues/soroswap.tsline 392 for the patternsrc/db.tsupsertPricePointsfor howeventIdbecomes the row idsrc/__tests__/phoenixIngester.test.ts,src/__tests__/pricePointIdentity.test.ts
Done when
- Two calls with the same pool read return the same
eventId - Two calls with different reserves return different ids
- No
Date.now()or random value is used to build the id - A test proves a replayed batch does not create a second row
Drips Wave · Complexity: Easy · 100 points
Repo: Divinity-Labs/Lens. Install with npm ci, typecheck with
npx tsc --noEmit, test with npm test. Tests are vitest, not jest
(running jest reports zero tests and proves nothing).
You cannot reach the production deployment. Everything must be proven with
local tests and fixtures. Do not write a test that needs the live network.
No floating point in new price or amount maths. Prices are stored as
Decimal(36, 18) and amounts as Decimal(36, 7). Do sums in SQL numeric, in
bigint, or on decimal strings. If you must touch existing float code, do not
add more of it.
The price convention is fixed: a stored price means units of assetB per
one unit of assetA, in the order the pair is configured. Every adapter must
follow it.
Generated files are checked byte for byte by CI (the OpenAPI spec, the
README sections, the GraphQL schema file, the TypeScript client schema, and the
Prisma migration baseline). If you change a route, the GraphQL schema or
prisma/schema.prisma, regenerate the generated files and commit them. The
commands are in the scripts section of package.json (openapi:gen,
readme:gen, graphql:schema:gen, client:gen) and in CONTRIBUTING.md. A
schema change also needs a migration and a regenerated baseline: see
docs/database-migrations.md. The database is migrated with
prisma migrate deploy, never db push.
Never shorten or invent a contract id or issuer address. Copy it in full
from the repo. If a venue's id is not in the repo, read it from the venue's
official docs and cite the source in the PR.
No personal data and no secrets in code, fixtures, logs or the PR. A
fixture recorded from a public API must not contain an API key.
Do not weaken a test to make it pass. If an existing test encodes the bug
you are fixing, change the test and say so in the PR.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
- 主要言語
- TypeScript
- スター
- 4
- フォーク
- 71
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Divinity-Labs/Lens のほかの issue
-
area:database difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Divinity-Labs/Lens#688 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
`/price/:assetA/:assetB/history` turns a bad `limit` into a 500 and an unknown pair into an empty 200対応中かも @I-frenzy が今日担当しました。 オープンarea:api difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Divinity-Labs/Lens#664 ·
メンテナーはふだん 3 日以内に返信
-
area:reliability difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Divinity-Labs/Lens#663 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
`/status?network=mainnet` is rate limited although `/status` is exempt対応中かも @Joyful12-tech が 1 日前に担当しました。 オープンarea:reliability difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Divinity-Labs/Lens#662 ·
メンテナーはふだん 3 日以内に返信
-
Webhook retries have no jitter, so failures synchronise対応中かも @Richard-tobi が 35 日前に担当しました。 オープンarea:reliability difficulty:easy help wanted points:100 Stellar Wave
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Divinity-Labs/Lens#341 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
Divinity-Labs/Lens の issue をすべて見る
似ている issue
-
[功能请求] 设置选项语言调整オープン功能请求
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
antithesishq/bombadil#473 ·
メンテナーはふだん 2 日以内に返信
-
The structured output reference promises null results for refusals that carry validation detailsオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
mattermost/mattermost-mobile#10358 ·
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
LucasSantana-Dev/Lucky#3257 ·
メンテナーはふだん 1 日以内に返信