Skip to content

Commit 944f3aa

Browse files
authored
Merge pull request #268 from lidofinance/develop
Release depositor bot
2 parents 73016b8 + 7698acb commit 944f3aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2167
-886
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LIDO_LOCATOR=0x1eDf09b5023DC86737b59dE68a8130De878984f5
1515
# Görli: 0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b
1616
DEPOSIT_CONTRACT=0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b
1717

18-
# rabbit / kafka / rabbit,kafka
18+
# rabbit / onchain_transport
1919
MESSAGE_TRANSPORTS=rabbit
2020

2121
# rabbit secrets

.github/workflows/integration-tests.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ jobs:
3939
MELLOW_CONTRACT_ADDRESS: "0x182Cb3A76B0EFaCb25255F9594B5807460882fa4"
4040
ANVIL_PATH: ""
4141

42+
- name: Integration tests with pytest, chiado testnet
43+
run: |
44+
poetry run pytest tests -m integration_chiado
45+
env:
46+
WEB3_RPC_ENDPOINTS: "https://gnosis-chiado-rpc.publicnode.com"
47+
ONCHAIN_TRANSPORT_RPC_ENDPOINTS: "https://gnosis-chiado-rpc.publicnode.com"
48+
ONCHAIN_TRANSPORT_ADDRESS: "0x42E1DEfC18388E3AA1fCADa851499A11405cf37f"
49+
DEPOSIT_CONTRACT: "0x4242424242424242424242424242424242424242"
50+
LIDO_LOCATOR: "0x28FAB2059C713A7F9D8c86Db49f9bb0e96Af1ef8"
51+
MELLOW_CONTRACT_ADDRESS: "0x182Cb3A76B0EFaCb25255F9594B5807460882fa4"
52+
ANVIL_PATH: ""
53+
4254
- name: Integration tests with pytest, mainnet fork
4355
if: success() || failure()
4456
run: |

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.4.4
5+
hooks:
6+
# Run the linter.
7+
- id: ruff
8+
args: [ --fix ]
9+
# Run the formatter.
10+
- id: ruff-format

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends -qq \
44
gcc=4:12.2.0-3 \
55
libffi-dev=3.4.4-1 \
66
g++=4:12.2.0-3 \
7-
curl=7.88.1-10+deb12u6 \
7+
curl=7.88.1-10+deb12u7 \
88
&& apt-get clean \
99
&& rm -rf /var/lib/apt/lists/*
1010

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
## Description
44

5-
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).
5+
Depositor and pauser bots are parts
6+
of [Deposit Security Module](https://github.com/lidofinance/lido-improvement-proposals/blob/develop/LIPS/lip-5.md#mitigations-for-deposit-front-running-vulnerability).
67

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

11-
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.
13+
Direct deposit is a mechanism that allows depositors to use side vault facilities for deposits. This process transfers ETH from the vault
14+
and facilitates the deposit to specified in side vault staking module, preventing funds from being stuck in the withdrawal queue.
1215

13-
**The Pauser Bot** obtains pause message from Council Daemon and enacts pause deposits on protocol. Pause can occurs when Lido detects stealing.
16+
**The Pauser Bot** obtains pause message from Council Daemon and enacts pause deposits on protocol. Pause can occurs when Lido detects
17+
stealing.
1418

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

2024
- [Running Daemon](#running-daemon)
2125
- [Variables](#variables)
22-
- [Required variables](#required-variables)
23-
- [Additional variables](#additional-variables)
26+
- [Required variables](#required-variables)
27+
- [Additional variables](#additional-variables)
2428
- [Metrics and logs](#metrics-and-logs)
2529
- [Development](#development)
26-
- [Install](#install)
27-
- [Tests](#tests)
28-
- [Release flow](#release-flow)
30+
- [Install](#install)
31+
- [Tests](#tests)
32+
- [Release flow](#release-flow)
2933
- [Annotations to code](#annotations-to-code)
3034

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

6966
### Additional variables
7067

interfaces/DataBusContract.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[
2+
{
3+
"anonymous": true,
4+
"inputs": [
5+
{
6+
"indexed": true,
7+
"internalType": "bytes32",
8+
"name": "eventId",
9+
"type": "bytes32"
10+
},
11+
{
12+
"indexed": true,
13+
"internalType": "address",
14+
"name": "sender",
15+
"type": "address"
16+
},
17+
{
18+
"indexed": false,
19+
"internalType": "bytes",
20+
"name": "data",
21+
"type": "bytes"
22+
}
23+
],
24+
"name": "Message",
25+
"type": "event"
26+
},
27+
{
28+
"inputs": [
29+
{
30+
"internalType": "bytes32",
31+
"name": "_eventId",
32+
"type": "bytes32"
33+
},
34+
{
35+
"internalType": "bytes",
36+
"name": "_data",
37+
"type": "bytes"
38+
}
39+
],
40+
"name": "sendMessage",
41+
"outputs": [],
42+
"stateMutability": "nonpayable",
43+
"type": "function"
44+
}
45+
]

0 commit comments

Comments
 (0)