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

aws lambda - relayer observer #1483

Closed
wants to merge 8 commits into from

Conversation

eugypalu
Copy link
Contributor

@eugypalu eugypalu commented Oct 9, 2024

Resolves #1527

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the new behavior?

This Lambda automates the process of maintaining relayer balances, ensuring they always have sufficient funds to operate

  1. Balance monitoring: Periodically checks the ETH balance of the main relayer account and individual relayers.

  2. Automatic funding: If a relayer's balance falls below a predefined threshold, the Lambda attempts to fund it automatically with a fixed amount of ETH.

  3. Slack notifications: Sends alerts to Slack channel #relayers-observer when:

    • The main relayer account balance is low and requires replenishment.
    • An error occurs while attempting to fund a relayer.
  4. Uses AWS Secrets Manager to securely retrieve the private keys necessary for transactions.

  5. Manual replenishment of the main account: avoid automating the withdraw call to the coinbase address to replenish the main relayer account. This decision was taken to prevent the need for an automatic call by the contract owner within the Lambda, thus maintaining greater control over significant fund replenishment operations.


This change is Reviewable

@Eikix
Copy link
Member

Eikix commented Oct 9, 2024

Can you add AWS CDK Python probably it is the best idea

Comment on lines 1 to 5
# trunk-ignore-all(trivy/DS002)
# trunk-ignore-all(trivy/DS026)
# trunk-ignore-all(checkov/CKV_DOCKER_2)
# trunk-ignore-all(checkov/CKV_DOCKER_3)
# trunk-ignore-all(hadolint/DL3033)
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to exclude them all?

Copy link
Contributor Author

@eugypalu eugypalu Oct 17, 2024

Choose a reason for hiding this comment

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

in my opinion should be excluded, these are the the lint issues:


- Ensure that HEALTHCHECK instructions have been added to container images
- Ensure that a user for the container has been created
- Specify version with `yum install -y <package>-<version>`
- Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>`
- Specify at least 1 USER command in Dockerfile with non-root user as argument

@Eikix
Copy link
Member

Eikix commented Oct 28, 2024

What is the status of this @eugypalu

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.

relayers-observer lambda function
4 participants