ChainSafe / ChainSafe/canton-middleware

feat(relayer): port PROMPT to wayfinder adapter, remove legacy pipeline

Open
#372 0 comments 0 reactions 0 assignees View on GitHub
CIP-0086: Phase 2 Deliverable: D3 Status: On Ice Type: Feature
Dominant language
Go
Stars
1
Forks
1
Avg merge
40m
Merged PRs (30d)
1

Description

# Goal

Port PROMPT bridging from the legacy relayer pipeline (processor + source/destination + reconcile loop) to a `wayfinder` adapter under the `TokenBridge` interface introduced in #356, then delete the legacy pipeline. Deferred from #356 to keep the USDCx track unblocked (see epic #361).

# Work items

- [ ] `pkg/relayer/bridges/wayfinder/` — `bridge.go` (Key, Sources, Step), `source_eth.go` + `source_canton.go` (moved from `engine/source.go`), `convert.go` (per-token decimals replacing `const decimalPlaces = 18`)
- [ ] `Step`, deposit: idempotency check -> `CreatePendingDeposit` -> `ProcessDepositAndMint` -> completed (single step, as today)
- [ ] `Step`, withdrawal: `"" -> eth_submitted -> completed`; folding `CompleteWithdrawal` into a stage fixes the existing gap where the retry path skips the post-submit hook
- [ ] Resolve token from the deposit event's `token` field via config (finally using `CantonBridge.sol`'s existing `ethereumToCantonToken` mappings)
- [ ] Delete `engine/processor.go`, `engine/destination.go`, `engine/source.go` and the reconcile loop; PROMPT config moves fully into the per-token `Tokens` map
- [ ] Migrate/regenerate mocks; existing PROMPT unit + e2e tests pass unchanged

# Acceptance

- PROMPT deposits and withdrawals behave identically on devstack (existing e2e green)
- `pkg/relayer/engine` has no imports of `pkg/cantonsdk/bridge` or `pkg/ethereum` contract bindings — all mechanism-specific code lives under `bridges/`
- Adding a second wayfinder-style token is config-only
- In-flight transfers created by the legacy pipeline complete correctly after the cutover (rows already keyed `bridge_key=wayfinder` by #356's migration)

# Depends on

- #356 (foundation)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the TokenBridge interface from #356, then compare the existing PROMPT files in pkg/relayer/engine with the wayfinder files listed in this issue. Run the existing PROMPT unit and e2e tests to understand current behavior. Done means the devstack tests stay green, engine has no mechanism-specific imports, and a second wayfinder-style token is config-only.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, blockchain
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.