Repository navigation
fix(tips): make Product finalized-event readback compatible with DevNet - #238
Merged
Merged
Conversation
knzeng-e
marked this pull request as ready for review
October 4, 2026 02:28
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Product-host tips can recover a finalized contribution by its exact intent ID on the current DevNet RPC. The Product executable is version 0.1.36 so hosts can invalidate the stale 0.1.35 bundle.
Issue and context
Refs #229. Local scope:
docs/backlog/native-gifts-tips.md.PR #237 separated Product's native extrinsic hash from an EVM transaction hash, but its finalized-event read-back used
viem.getLogswith only the indexedidargument. Viem emits trailing null topic placeholders for the other indexed event fields. The public Product DevNet EVM RPC rejects that filter with-32602 FilterTopic, so a submitted tip stays uncertain even when the user asks to check status. Product Desktop also continued loading the old executable because the manifest version had not advanced.Architecture and key concepts
The contribution intent ID remains the reconciliation key. Product reports native extrinsic finalization; Dotify independently asks the public EVM read model for a finalized
ContributionReceived(id)and its same-blockContributionShare(id)events. Only those events can produce a verified, dated receipt. An uncertain journal entry is never resubmitted automatically.How it works
event selector,id) with generated contract ABI tooling.eth_getLogsdirectly with exactly those topics through the finalized block. This avoids the RPC-incompatible null placeholders while retaining indexed filtering.Design decisions and tradeoffs
The filter still uses
viem.encodeEventTopicsand the generated ABI; it does not hard-code event signatures or scan unrelated logs. Direct JSON-RPC is localized to this read path because the higher-level helper creates an invalid filter for this endpoint. The query starts at block zero; a deployment-block checkpoint could reduce historical scan cost later, once the runtime registry records it reliably.Security, failure, and operations
9c2a476was published todotify-test01.dotat CIDbafybeiczbltdtr2rttbmvpeme7q45lxf5pmhyvy3o2ogl6jq74o4bxmo2u. Bulletin root, DotNS contenthash and executable manifest finalized. Product Desktop loaded that exact SHA and appVersion after reload; a fresh user-authorized tip still requires manual validation.Review guide
Suggested order
web/src/features/donations/contributions.ts: inspect concrete topic construction, finalized-block bound, same-block share read and fail-closed decoding.web/src/features/donations/contributions.reader.test.ts: verify exact RPC filter shape and no fabricated receipt.web/polkadot-app-deploy.config.tsanddocs/operations/deployment-configuration.md: verify cache version and operational instructions.Verify carefully
9c2a476and appVersion 0.1.36 after reload?Validation
npm run test:unitnpm run buildVITE_DOTIFY_RUNTIME_ADAPTER=product-cdm VITE_DOTIFY_DEBUG_PANEL=true npm run build:product-devnet:frozennpx eslint . --ignore-pattern '.data/**'npm run linttraverses a local.data/archive and fails on minified historical bundles, unrelated to this change.eth_getLogsaccepts[selector,id]; all four historical intent IDs have zeroContributionReceivedevents through finalized block 14,017,679.You > Production readinessshows exact SHA9c2a476b0e4973a93643a2e6006a6476b57e563eand[0, 1, 36]; the existing Product account reconnects without a new payment.742c979Known limitations and follow-ups
Metadata checklist
Dotify sprints)