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

Release depositor bot #268

Merged
merged 10 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LIDO_LOCATOR=0x1eDf09b5023DC86737b59dE68a8130De878984f5
# Görli: 0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b
DEPOSIT_CONTRACT=0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b

# rabbit / kafka / rabbit,kafka
# rabbit / onchain_transport
MESSAGE_TRANSPORTS=rabbit

# rabbit secrets
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ jobs:
MELLOW_CONTRACT_ADDRESS: "0x182Cb3A76B0EFaCb25255F9594B5807460882fa4"
ANVIL_PATH: ""

- name: Integration tests with pytest, chiado testnet
run: |
poetry run pytest tests -m integration_chiado
env:
WEB3_RPC_ENDPOINTS: "https://gnosis-chiado-rpc.publicnode.com"
ONCHAIN_TRANSPORT_RPC_ENDPOINTS: "https://gnosis-chiado-rpc.publicnode.com"
ONCHAIN_TRANSPORT_ADDRESS: "0x42E1DEfC18388E3AA1fCADa851499A11405cf37f"
DEPOSIT_CONTRACT: "0x4242424242424242424242424242424242424242"
LIDO_LOCATOR: "0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8"
MELLOW_CONTRACT_ADDRESS: "0x182Cb3A76B0EFaCb25255F9594B5807460882fa4"
ANVIL_PATH: ""

- name: Integration tests with pytest, mainnet fork
if: success() || failure()
run: |
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.4
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends -qq \
gcc=4:12.2.0-3 \
libffi-dev=3.4.4-1 \
g++=4:12.2.0-3 \
curl=7.88.1-10+deb12u6 \
curl=7.88.1-10+deb12u7 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
33 changes: 15 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

## Description

Depositor and pauser bots are parts of [Deposit Security Module](https://github.com/lidofinance/lido-improvement-proposals/blob/develop/LIPS/lip-5.md#mitigations-for-deposit-front-running-vulnerability).
Depositor and pauser bots are parts
of [Deposit Security Module](https://github.com/lidofinance/lido-improvement-proposals/blob/develop/LIPS/lip-5.md#mitigations-for-deposit-front-running-vulnerability).

**The Depositor Bot** obtains signed deposit messages from Council Daemons.
Once a sufficient number of messages is collected to constitute a quorum, the bot proceeds to initiate a deposit into the designated staking module.
**The Depositor Bot** obtains signed deposit messages from Council Daemons.
Once a sufficient number of messages is collected to constitute a quorum, the bot proceeds to initiate a deposit into the designated staking
module.
This deposit is executed using the depositBufferedEther function within the "DepositSecurityModule" smart contract.

Direct deposit is a mechanism that allows depositors to use side vault facilities for deposits. This process transfers ETH from the vault and facilitates the deposit to specified in side vault staking module, preventing funds from being stuck in the withdrawal queue.
Direct deposit is a mechanism that allows depositors to use side vault facilities for deposits. This process transfers ETH from the vault
and facilitates the deposit to specified in side vault staking module, preventing funds from being stuck in the withdrawal queue.

**The Pauser Bot** obtains pause message from Council Daemon and enacts pause deposits on protocol. Pause can occurs when Lido detects stealing.
**The Pauser Bot** obtains pause message from Council Daemon and enacts pause deposits on protocol. Pause can occurs when Lido detects
stealing.

**The Unvetting Bot** obtains unvet message from Council Daemon and enacts unvet on the specified node operator.
Unvetting is the proces of decreasing approved depositable signing keys.
Expand All @@ -19,13 +23,13 @@ Unvetting is the proces of decreasing approved depositable signing keys.

- [Running Daemon](#running-daemon)
- [Variables](#variables)
- [Required variables](#required-variables)
- [Additional variables](#additional-variables)
- [Required variables](#required-variables)
- [Additional variables](#additional-variables)
- [Metrics and logs](#metrics-and-logs)
- [Development](#development)
- [Install](#install)
- [Tests](#tests)
- [Release flow](#release-flow)
- [Install](#install)
- [Tests](#tests)
- [Release flow](#release-flow)
- [Annotations to code](#annotations-to-code)

## Running Daemon
Expand Down Expand Up @@ -54,17 +58,10 @@ Unvetting is the proces of decreasing approved depositable signing keys.
| DEPOSIT_CONTRACT | 0x00000000219ab540356cBB839Cbe05303d7705Fa | Ethereum deposit contract address |
| DEPOSIT_MODULES_WHITELIST | 1 | List of staking module's ids in which the depositor bot will make deposits |
| --- | --- | --- |
| MESSAGE_TRANSPORTS | - | Transports used in bot. One of/or both: rabbit/kafka |
| MESSAGE_TRANSPORTS | - | Transports used in bot. One of/or both: rabbit/onchain_transport |
| RABBIT_MQ_URL | - | RabbitMQ url |
| RABBIT_MQ_USERNAME | - | RabbitMQ username for virtualhost |
| RABBIT_MQ_PASSWORD | - | RabbitMQ password for virtualhost |
| --- | --- _kafka is not used at the moment_ --- | --- |
| KAFKA_BROKER_ADDRESS_1 | - | Kafka servers url and port |
| KAFKA_USERNAME | - | Kafka username |
| KAFKA_PASSWORD | - | Password for kafka |
| KAFKA_NETWORK | - | Network type (mainnet or goerli) |
| KAFKA_TOPIC | - | Kafka topic name (for msg receiving) |
| KAFKA_GROUP_PREFIX | - | Just for staging (staging-) |

### Additional variables

Expand Down
45 changes: 45 additions & 0 deletions interfaces/DataBusContract.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[
{
"anonymous": true,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "eventId",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "Message",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_eventId",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "sendMessage",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
Loading
Loading