Skip to content

refactor: introduce c2m-bridge pallet#1386

Merged
LGLO merged 4 commits into
mainfrom
c-to-m-pallet
Apr 23, 2026
Merged

refactor: introduce c2m-bridge pallet#1386
LGLO merged 4 commits into
mainfrom
c-to-m-pallet

Conversation

@LGLO

@LGLO LGLO commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Overview

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

@LGLO LGLO force-pushed the c-to-m-pallet branch 2 times, most recently from fbf793c to d45f821 Compare April 22, 2026 13:44
@LGLO

LGLO commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

/bot rebuild-metadata

@github-actions

Copy link
Copy Markdown
Contributor

✅ Metadata rebuild complete! Changes have been committed.

@LGLO LGLO marked this pull request as ready for review April 22, 2026 14:16
@LGLO LGLO requested a review from a team as a code owner April 22, 2026 14:16
Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>
Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>
Comment thread pallets/c2m-bridge/src/mock.rs
Comment thread pallets/c2m-bridge/src/mock.rs Outdated
Comment thread pallets/c2m-bridge/src/lib.rs Outdated
Comment thread pallets/c2m-bridge/src/tests.rs
Comment thread pallets/c2m-bridge/src/tests.rs Outdated
Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>
Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>
@LGLO LGLO enabled auto-merge April 23, 2026 08:36
@LGLO LGLO added this pull request to the merge queue Apr 23, 2026
Merged via the queue into main with commit f1ac124 Apr 23, 2026
36 checks passed
@LGLO LGLO deleted the c-to-m-pallet branch April 23, 2026 09:54
@LGLO LGLO linked an issue May 13, 2026 that may be closed by this pull request
cosmir17 added a commit to midnightntwrk/midnight-indexer that referenced this pull request Jun 8, 2026
….0.0-alpha.1

The c2m-bridge pallet (PR midnightntwrk/midnight-node#1386 et al.) lands
in node 2.0.0-alpha.1 metadata, so the scaffold that was previously
blocked on missing metadata can be activated. The pallet ships inert;
events only fire after governance enables it (set MainChainScripts +
data checkpoint), so this just establishes the decoding path.

Changes:

- `runtimes.rs::BlockDetails`: uncomment `bridge_pallet_events` field.
- `runtimes/v2_0_0.rs`: declare local `bridge_pallet_events` accumulator,
  add full `Event::C2MBridge(_)` match arm decoding all 5 variants
  (UserTransfer, ReserveTransfer, InvalidTransfer, UnapprovedTransfer,
  SubminimalFlushTransfer), and return them via BlockDetails.
  - `recipient.0.0` resolves as `Vec<u8>` directly (drop the earlier
    `.into_inner()` — BoundedVec wrapper not present in the regenerated
    metadata).
- `runtimes/v1_0_0.rs`, `runtimes/v0_22_0.rs`: return
  `bridge_pallet_events: vec![]`. The pallet does not exist in node 1.0
  or 0.22 metadata; the v1_0_0 scaffold (commented out, with a TODO) is
  removed and replaced with a one-line pointer to v2_0_0.
- `subxt_node.rs`: destructure `bridge_pallet_events` from BlockDetails
  and wire it through to the `Block` construction, replacing the
  `Default::default()` placeholder. Add a `DecodeBridgeRecipient`
  variant on `SubxtNodeError` so `BridgeRecipient::new(...)` failures
  propagate via `?` instead of being shoe-horned into the
  `DecodeEvent(Box<EventsError>)` variant.
- Migration: rename `indexer-common/migrations/sqlite/004_bridge_events.sql`
  to `005_bridge_events.sql` to resolve the collision with main's
  `004_block_tree_end_indexes.sql` (PR #1197).
  Postgres bridge migration stays at `004_bridge_events.sql` (no
  collision there).

Build clean on `cargo check --workspace --features cloud` and
`--features standalone`, clippy clean with `-D warnings` on both
features (env vars sourced from `.envrc`), schema regen no-op (the
bridge GraphQL surface was already in place from earlier bridge
commits on this branch).

Remaining unfinished work (not in this commit, separate plumbing
chain):

- `ClaimKind::CardanoBridge` -> `BridgeClaim` storage path
  (`indexer-common/src/domain/ledger/ledger_state.rs` ClaimRewards arms
  for v8 and v9, `ApplyRegularTransactionOutcome.bridge_claim` plumbing,
  `chain-indexer/src/domain/transaction.rs::RegularTransaction.bridge_claim`,
  `chain-indexer/src/infra/storage.rs::save_regular_transaction` calling
  the already-present `save_bridge_claim`). All TODOs marked
  `TODO(bridge):` in the affected files.
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.

[C-to-M Bridge] Make separate Pallet for the bridge

2 participants