Rough design for a trustless tipping mechanism for BEEFY relayers:
Data Types on BH:
Tips
: Mapping between an outbound message nonce and the beefy relayer tip.ExportMessage
:When the forwarded XCM is received on BH, set Tips[Message.Nonce] = TipAmount
. Export the message for delivery to Polkadot
When an inbound message is processed by the Gateway contract on the Ethereum, the InboundMessageDispatched
event includes the address of the BEEFY relayer that provided the BEEFY state used to prove the message.
rewards
pallet.The frontend should calculate a suitable tip based on current bridge traffic, and with awareness that there is a free BEEFY consensus update every 4 hours (the mandatory beefy commitment at the start of each session)
Currently BEEFY relayers are incentivized outside of the protocol using treasury funding. This has certain benefits, including much lower overall user fees. On the other hand, it does not promote decentralization.
With this design, which introduces protocol-level incentivization, there is obviously a race for competing BEEFY relayers to submit updates and receive tips. This a larger problem that either needs to tackled as part of this solution, or separately.
One approach, at least for mandatory BEEFY commitments, is to introduce a registration and slashing mechanism. This would involve round-robin relayer selection, relayers putting up a deposit, and being slashed for not submitting mandatory BEEFY commitments in time.
This approach could be extended to non-mandatory commitments. The selected relayer for a session will forfeit the tips described above if they don't follow their duties.