Skip to content

Union Bridge (RSKIP502) is entirely absent: co.rsk.peg.union has no rustock counterpart #120

Closed

Description

@SDL-A1

Migrated from SergioDemianLerner/rustock#120 (issue by @SDL-A1, 2026-09-25).
Original: SergioDemianLerner/rustock#120

Found while writing docs/rskj-to-rustock-map.md. rskj has a whole peg
subpackage rustock has nothing for.

What is missing

co.rsk.peg.union/ — UnionBridgeSupport, UnionBridgeSupportImpl,
UnionBridgeStorageProvider, UnionBridgeStorageProviderImpl,
UnionBridgeStorageIndexKey, UnionResponseCode, plus union/constants.

And roughly ten Bridge methods in BridgeMethods.java, all gated on
RSKIP502:

  • setUnionBridgeContractAddressForTestnet
  • getUnionBridgeContractAddress
  • getUnionBridgeLockingCap
  • increaseUnionBridgeLockingCap
  • requestUnionBridgeRbtc
  • releaseUnionBridgeRbtc
  • setUnionBridgeTransferPermissions
  • …and the remaining getters

rustock's BRIDGE_METHODS table has none of them. Not "dispatched but
unimplemented" — absent from the table, so a call gets no method at all.

Why it is not urgent

RSKIP502 activates at reed810, and reed810 is testnet-only:
main.conf gives it height -1, and mainnet skips from reed800
(#8,052,200) straight to vetiver900 (#8,804,200). So this is not a mainnet
consensus gap today, and rustock's mainnet replay is unaffected.

Why it is worth filing anyway

It is the largest single rskj subsystem with no rustock counterpart, and
unlike the other testnet-only gaps it was not written down anywhere. #47 and
#48 cover RSKIP144/RSKIP351 and the testnet opcodes; nothing covered this.

It also becomes a mainnet consensus gap the day RSKIP502 activates there,
and "PowPeg and Union Bridge integration" (the ConsensusRule comment) is
not a small thing to port under time pressure.

What to build

  1. crates/execution/src/bridge/union.rs — storage provider, locking cap,
    transfer permissions, the request/release flow.
  2. The method rows in BRIDGE_METHODS, gated on a new has_rskip502.
  3. Reed810 already exists in crates/execution/src/hardfork.rs as a
    testnet-only variant, so the activation plumbing is in place.

bridge_method_table_is_fully_dispatched will catch any row added without an
arm, which is the right failure mode.

Tests

  • Testnet activation: the methods answer after reed810 and are absent
    before.
  • Mainnet: the methods stay absent at every height, since reed810 never
    activates there.
  • Locking cap increase honours the authorizer, as the whitelist and
    fee-per-kb ones do.

Related: #47, #48. Map entry: docs/rskj-to-rustock-map.md, "Genuine gaps".

Activity

  1. SDL-A1 commented on Nov 18, 2026

    @SDL-A1
    CollaboratorAuthor

    Implemented. crates/execution/src/bridge/union.rs is 567 lines with four tests, and all seven methods this issue names are in the dispatch table, gated on RSKIP502:

    setUnionBridgeContractAddressForTestnet
    getUnionBridgeContractAddress
    getUnionBridgeLockingCap
    increaseUnionBridgeLockingCap
    requestUnionBridgeRbtc
    releaseUnionBridgeRbtc
    setUnionBridgeTransferPermissions
    

    The complaint was that BRIDGE_METHODS had none of them — "absent from the table, so a call gets no method at all". That no longer holds.

    The issue also mentions "…and the remaining getters" without naming them. If a specific getter turns out to be missing, it deserves its own issue rather than keeping this one open.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions