Cluster selectors
The Marlin Relay network selects 5 clusters to propagate messages every 15 minutes. Cluster selection is done on-chain and users can invoke the contract to select clusters in exchange for rewards. This process can be automated by running a server or using tools like OpenZeppelin Defender.
📄️ Using a script
Clusters can be selected using a NodeJS script running in a server that periodically invokes the selection function in the contract. Example repository for such a script is available here.
📄️ Using OpenZeppelin Defender
1. To start off, you’ll need to create an account on https://defender.openzeppelin.com/
Reward
Invoking cluster selection for an epoch is essential to ensure there is churn in clusters selected for propagation in the network. Tickets when submitted by receivers will result in only the selected clusters being rewarded ensuring there is an in-built incentive for clusters who aren't selected in an epoch to invoke cluster selection.
To bootstrap this process, a refund for gas fees for cluster selection is given to msg.sender
of the tx that selects clusters for an epoch in ETH
. Network actors are free to topup this fund so cluster selection happens at every epoch.
Calculation
Transaction cost on Arbitrum has 2 components
- L2 execution and storage cost
- L1 calldata cost
L2 execution and storage cost is the gas used to execute the selectClusters
method in the contract. Based on simulations, an estimated gas cost (which won't be reached in most cases) is used to cover the L2 gas cost as well as give a small reward.
L1 calldata cost is calculated based on ArbGasInfo precompile. Base gas fee for L2 tx and calldata (only method sig which is 4 bytes) are considered as part of this cost.
Sum of the above costs is considered towards calculation of rewards.