Skip to content

feat: in-progress update of offramprelayers #282

@filo87

Description

@filo87

[Feature] Track progress of Offramp Relayer Updates

Description

We need to track the status and progress of Offramp Relayer configurations as they are initiated on the Hub and finalized on the Spoke's OnOfframpManager.

On-Chain Specifications

The process involves sending a trusted contract update from the Hub to the specific Spoke manager contract, enabling or disabling an address as an authorized relayer for offramp operations.

1. Hub Domain (Initiation)

  • Contract: Hub.sol
  • Function: updateContract(PoolId poolId, ShareClassId scId, uint16 centrifugeId, bytes32 target, bytes calldata payload, uint128 extraGasLimit, address refund)
  • Event Emitted: UpdateContract(uint16 indexed centrifugeId, PoolId indexed poolId, ShareClassId scId, bytes32 target, bytes payload)
  • Order: This is the initiating event. Once emitted, it triggers a cross-chain message to the Spoke.
  • Payload Details: For relayer updates, the payload encodes an IOnOfframpManager.TrustedCall.Relayer operation. It takes the form abi.encode(uint8(1), bytes32 relayerAddress, bool isEnabled).

2. Spoke Domain (Finalization)

  • Contract: OnOfframpManager.sol
  • Function: trustedCall(PoolId poolId, ShareClassId scId, bytes memory payload)
  • Event Emitted: UpdateRelayer(address indexed relayer, bool isEnabled)
  • Order: This is the finalizing event. It occurs when the cross-chain message is processed and updates the allowed relayers on the Spoke.

Data Type Notes

  • The relayerAddress is encoded as a bytes32 inside the Hub payload and is resolved to a standard address before being emitted on the Spoke side.
  • The UpdateContract event logs the OnOfframpManager contract address as a bytes32 target.

Indexer Requirements (cfg-api-v3)

  • Listen to Hub.UpdateContract. Decode or inspect the payload to detect if it corresponds to TrustedCall.Relayer (enum value 1).
  • Listen to OnOfframpManager.UpdateRelayer.
  • Track the lifecycle of the relayer configuration from initiation on the Hub to finalization on the Spoke.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions