Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add relayer fee configuration to relayer #571

Merged
merged 8 commits into from
Aug 9, 2023

Conversation

salman01zp
Copy link
Contributor

@salman01zp salman01zp commented Aug 9, 2023

Summary of changes

  • Add Relayer fee configuration
  • Update test
  • Update config files
  • Update readme

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

  • Tested
  • Documented

@salman01zp salman01zp changed the title Add withdraw fee configuration to relayer Add relayer fee configuration to relayer Aug 9, 2023
@salman01zp salman01zp marked this pull request as ready for review August 9, 2023 10:20
Copy link
Collaborator

@shekohex shekohex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far.

crates/relayer-config/src/evm/mod.rs Outdated Show resolved Hide resolved
crates/tx-relay/src/evm/fees.rs Outdated Show resolved Hide resolved
crates/tx-relay/src/evm/fees.rs Outdated Show resolved Hide resolved
config/README.md Outdated Show resolved Hide resolved
shekohex
shekohex previously approved these changes Aug 9, 2023
Copy link
Collaborator

@shekohex shekohex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, last thing is to update the relayer version to v0.5.10-dev so we can release a new version

@shekohex
Copy link
Collaborator

shekohex commented Aug 9, 2023

@salman01zp any idea why the CI is failing?

@salman01zp
Copy link
Contributor Author

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

@shekohex shekohex merged commit 6b70213 into develop Aug 9, 2023
7 of 8 checks passed
@shekohex shekohex deleted the salman/withdraw-fee-config branch August 9, 2023 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Make Private Transaction Relayer Fees configurable
2 participants