tangle-network / relayer

🕸️ The Webb Relayer Network
https://webb-tools.github.io/relayer/
Apache License 2.0
22 stars 13 forks source link

Add relayer fee configuration to relayer #571

Closed salman01zp closed 1 year ago

salman01zp commented 1 year ago

Summary of changes

Added Relayer fee configuration, which can be used by each chain to configure relayer_profit_percent and max_refund_amount of the relayer

/// Transaction relayer fee configuration.
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all(serialize = "camelCase", deserialize = "kebab-case"))]
pub struct RelayerFeeConfig {
    /// Relayer profit percent per transaction fee for relaying
    pub relayer_profit_percent: f64,
    /// Maximum refund amount per transaction relaying
    pub max_refund_amount: f64,
}

impl Default for RelayerFeeConfig {
    fn default() -> Self {
        Self {
            relayer_profit_percent: 5.,
            max_refund_amount: 5.,
        }
    }
}

Reference issue to close (if applicable)


Code Checklist

shekohex commented 1 year ago

@salman01zp any idea why the CI is failing?

salman01zp commented 1 year ago

hmm, some issue with the tangle node. https://github.com/webb-tools/relayer/actions/runs/5798481431/job/15719574758#step:10:66