Skip to content

Fix preprod blockers: indexer v3 URLs, ledger parser for chain readers, circuit assets#57

Closed
Copilot wants to merge 6 commits intomainfrom
copilot/get-to-preprod
Closed

Fix preprod blockers: indexer v3 URLs, ledger parser for chain readers, circuit assets#57
Copilot wants to merge 6 commits intomainfrom
copilot/get-to-preprod

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

  • Explore deploy_preprod.ts and all its dependencies (api.ts, config.ts, common-types.ts)
  • Identify critical runtime blocker: wallet.balanceTransaction() doesn't exist in WalletFacade v3
  • Identify secondary issues: WalletFacade constructor is private in v3, dust.walletBalance() renamed to balance(), finalizeTransaction needs finalizeRecipe for recipes
  • Fix initWalletWithSeed(): replace new WalletFacade(...) with WalletFacade.init() factory
  • Fix createWalletAndMidnightProvider(): replace balanceTransaction() with balanceUnprovenTransaction() using v3 API signature
  • Fix registerNightForDust(): walletBalance()balance(), finalizeTransaction()finalizeRecipe()
  • Fix logFinalizedTxData() to handle v3 FinalizedTxData shape (no .public/.private wrapper)
  • Add ledger v6/v8 cross-version type casts
  • Add console/globalThis to ESLint globals
  • Prefix unused params with _ convention
  • Run lint and type-check — 0 errors in api.ts and deploy_preprod.ts
  • Run frontend-realdeal tests — 39/39 pass
  • Run parallel validation — 0 review comments, 0 CodeQL alerts

Copilot AI and others added 3 commits April 11, 2026 03:54
Agent-Logs-Url: https://github.com/SpyCrypto/AutoDiscovery/sessions/45d911c9-f3a6-4c0c-82b1-d626cb3540ad

Co-authored-by: SpyCrypto <226600115+SpyCrypto@users.noreply.github.com>
…s, circuit assets

- Fix default indexer URL from /api/v1/ to /api/v3/ in contracts/index.ts
- Fix frontend-demoland .env.realdeal: network=preprod, indexer v3, add VITE_INDEXER_WS
- Update demoland discovery-core-reader.ts from mocked stubs to real ledger parser
- Update frontend-realdeal getOnChainStepStatus and isAttestationOnChain to use ledger parser
- Add public/contracts/ to .gitignore (generated circuit assets)
- Run copy-contracts to copy circuit assets to public/

Agent-Logs-Url: https://github.com/SpyCrypto/AutoDiscovery/sessions/45d911c9-f3a6-4c0c-82b1-d626cb3540ad

Co-authored-by: SpyCrypto <226600115+SpyCrypto@users.noreply.github.com>
…t methods

- Replace `new WalletFacade(...)` with `WalletFacade.init()` (v3 factory pattern)
- Replace `wallet.balanceTransaction()` with `wallet.balanceUnprovenTransaction()` (v3 API)
- Replace `dust.walletBalance()` with `dust.balance()` (v3 DustWalletState API)
- Replace `wallet.finalizeTransaction(recipe)` with `wallet.finalizeRecipe(recipe)` (v3 recipe pattern)
- Fix logFinalizedTxData to handle both FinalizedCallTxData (.public/.private) and FinalizedTxData shapes
- Add ledger v6/v8 cross-version casts for ZswapSecretKeys and transaction types
- Add console/globalThis to ESLint globals for CLI scripts
- Prefix unused params with _ in deploy_preprod.ts buildProviders

Agent-Logs-Url: https://github.com/SpyCrypto/AutoDiscovery/sessions/43822f45-bb4e-4a53-98d3-048d84b7bd0a

Co-authored-by: SpyCrypto <226600115+SpyCrypto@users.noreply.github.com>
Copilot AI requested a review from SpyCrypto April 12, 2026 01:33
@SpyCrypto SpyCrypto marked this pull request as ready for review April 12, 2026 18:46
Copilot AI review requested due to automatic review settings April 12, 2026 18:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses multiple preprod deployment/runtime blockers across the CLI and both frontends by updating indexer endpoints, adapting to Wallet SDK v3 APIs, and improving contract state parsing in browser chain readers.

Changes:

  • Update default preprod indexer URLs to /api/v3/graphql (and add WS where needed) plus refresh deploy instructions in env files.
  • Add/extend ledger-parser-based lookups in the discovery-core chain readers with heuristic fallbacks.
  • Update autodiscovery-cli wallet integration to WalletFacade v3 APIs (init/balance/finalize/dust balance) and align linting/globals/unused param conventions.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
package-lock.json Removes an outdated pino entry from a workspace devDependency block in the lockfile.
frontend-realdeal/src/providers/realdeal/chain/discovery-core-reader.ts Uses ledger parser for step/attestation lookups with heuristic fallback.
frontend-realdeal/src/contracts/index.ts Switches default preprod indexer URL from v1 to v3.
frontend-realdeal/.gitignore Ignores generated contract circuit assets under public/contracts/.
frontend-realdeal/.env.realdeal Updates deploy instructions to the preprod deploy script (with mnemonic).
frontend-demoland-vite-react/src/providers/realdeal/chain/discovery-core-reader.ts Adds dynamic ledger parser import and implements case/step/attestation lookups with fallback.
frontend-demoland-vite-react/.env.realdeal Moves config to preprod + v3 indexer URLs and adds WS endpoint.
autodiscovery-cli/src/deploy_preprod.ts Prefixes unused parameters to satisfy linting conventions.
autodiscovery-cli/src/api.ts Migrates wallet initialization/balancing/finalization/dust balance calls to Wallet SDK v3.
autodiscovery-cli/eslint.config.mjs Adds console and globalThis to ESLint globals.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend-demoland-vite-react/.env.realdeal Outdated
Comment on lines +276 to +280
// Prefer the compiled ledger parser when available
if (_ledgerParser) {
try {
const parsed = _ledgerParser(rawState) as {
completionAttestationHashes: {
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as above: _ledgerParser(rawState) is being invoked with rawState as a string, but DiscoveryCore.ledger expects StateValue | ChargedState (autodiscovery-contract/src/managed/discovery-core/contract/index.d.ts:90). Convert the GraphQL data field into bytes and wrap as StateValue before calling the parser so the attestation check can use the typed map instead of always falling back.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

SpyCrypto and others added 2 commits April 15, 2026 17:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Spy <mespycrypto@gmail.com>
…overy-core-reader.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Spy <mespycrypto@gmail.com>
@SpyCrypto
Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

1 similar comment
@SpyCrypto
Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

@SpyCrypto SpyCrypto closed this Apr 18, 2026
Copilot stopped work on behalf of SpyCrypto due to an error April 18, 2026 05:14
Copilot AI requested a review from SpyCrypto April 18, 2026 05:14
@SpyCrypto
Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants