Skip to content

Commit 0871fb9

Browse files
authored
v0.9.2 (#1247)
2 parents 6d6b570 + 590f105 commit 0871fb9

File tree

22 files changed

+339
-98
lines changed

22 files changed

+339
-98
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OS := $(shell uname -s)
66
CONFIG_FILE?=config-files/config.yaml
77
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml
88

9-
OPERATOR_VERSION=v0.9.1
9+
OPERATOR_VERSION=v0.9.2
1010

1111
ifeq ($(OS),Linux)
1212
BUILD_ALL_FFI = $(MAKE) build_all_ffi_linux

batcher/aligned/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aligned"
3-
version = "0.9.0"
3+
version = "0.9.2"
44
edition = "2021"
55

66
[dependencies]

docs/2_architecture/components/2_payment_service_contract.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
The Payment Service handles users payments to fund the verification of their proofs.
44

55
To be able to use the batcher, a user must fund its transactions.
6-
For this, there is a simple Batcher Payment System.
6+
For this, there is a simple Payment Service.
77

8-
The Batcher has an associated Batcher Payments smart contract,
8+
The Batcher has an associated `Batcher Payments` smart contract,
99
which is in charge of receiving user's payments,
1010
and it guarantees that it can only spend these funds to send users' proofs to Aligned.
1111

docs/3_guides/0_submitting_proofs.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,32 @@ This will create the ECDSA keystore file in `~/.aligned_keystore/keystore0`
6060

6161
- If you have the EigenLayer CLI installed, the keystore can be generated following [these](https://docs.eigenlayer.xyz/eigenlayer/operator-guides/operator-installation#import-keys) instructions. The key will be stored into `~/.eigenlayer/operator_keys`.
6262

63-
## 2. Fund the batcher
63+
## 2. Send funds to Aligned
6464

65-
To be able to send proofs to Aligned using the Batcher, the user must fund its transactions. For this, there is a simple Batcher Payment System.
65+
To send proofs to Aligned using the Batcher, the user must first deposit some funds in Aligned to pay for the verification of his proofs.
6666

6767
To use it, you can use the `aligned` CLI, as shown with the following example:
6868

6969
```bash
70-
aligned deposit-to-batcher \
70+
aligned deposit-to-batcher \
7171
--rpc_url https://ethereum-holesky-rpc.publicnode.com \
7272
--network holesky \
7373
--keystore_path <keystore_path> \
7474
--amount 0.1ether
7575
```
7676

77-
These commands allow the usage of the following flags:
77+
This command allows the usage of the following flags:
7878

79-
- `--payment_service_addr` to specify the address of the Batcher Payment Service smart contract.
8079
- `--rpc_url` to specify the rpc url to be used.
81-
- `--network` to specify the chain id to be used. Could be holesky or devnet.
80+
- `--network` to specify the netowrk to be used. Can be `devnet`, `holesky-stage` or `holesky`.
8281
- `--keystore_path` the path to the keystore.
8382
- `--amount` the number of ethers to transfer to the Batcher.
84-
- Note: `--amount` flag parameter must be with the shown format. The amount followed by the `ether` keyword to specify how many ethers you wish to deposit to the Batcher.
83+
- Note: `--amount` flag parameter must be with the shown format, `XX.XXether`.
8584

8685
After depositing funds, you can verify the Service has correctly received them by executing the following command:
8786

8887
```bash
89-
aligned get-user-balance \
88+
aligned get-user-balance \
9089
--rpc_url https://ethereum-holesky-rpc.publicnode.com \
9190
--network holesky \
9291
--user_addr <user_addr>
@@ -95,7 +94,7 @@ aligned get-user-balance \
9594
These commands allow the usage of the following flags:
9695

9796
- `--rpc_url` to specify the rpc url to be used.
98-
- `--network` to specify the chain id to be used. Could be holesky or devnet.
97+
- `--network` to specify the netowrk to be used. Can be `devnet`, `holesky-stage` or `holesky`.
9998
- `--user_addr` the address of the user that funded the Batcher.
10099

101100
## 3. Submit your proof to the batcher
@@ -109,9 +108,8 @@ Proof submission is done via the `submit` command of the Aligned CLI. The argume
109108
* `vm_program`: When the proving system involves the execution of a program in a zkVM, this argument is associated with the compiled program or some other identifier of the program.
110109
* `pub_input`: The path to the file with the public input associated with the proof.
111110
* `batcher_url`: The batcher websocket URL.
112-
* `chain` to specify the chain id to be used. Could be holesky or devnet.
111+
* `network` to specify the netowrk to be used. Can be `devnet`, `holesky-stage` or `holesky`.
113112
* `rpc_url`: The RPC Ethereum node URL.
114-
* `payment_service_addr`: The Ethereum address of the Batcher Payments System contract.
115113
* `proof_generator_addr`: An optional parameter that can be used in some applications to avoid front-running.
116114
* `batch_inclusion_data_directory_path`: An optional parameter indicating the directory where to store the batcher response data. If not provided, the folder with the responses will be created in the current directory.
117115

@@ -132,7 +130,7 @@ aligned submit \
132130
--batch_inclusion_data_directory_path [batch_inclusion_data_directory_path] \
133131
--keystore_path <path_to_ecdsa_keystore> \
134132
--network holesky \
135-
--rpc_url https://ethereum-holesky-rpc.publicnode.com
133+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
136134
```
137135

138136
**Example**
@@ -146,7 +144,7 @@ aligned submit \
146144
--batcher_url wss://batcher.alignedlayer.com \
147145
--keystore_path ~/.aligned_keystore/keystore0 \
148146
--network holesky \
149-
--rpc_url https://ethereum-holesky-rpc.publicnode.com
147+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
150148
```
151149

152150
### Risc0 proof
@@ -167,7 +165,7 @@ aligned submit \
167165
--batch_inclusion_data_directory_path [batch_inclusion_data_directory_path] \
168166
--keystore_path <path_to_ecdsa_keystore> \
169167
--network holesky \
170-
--rpc_url https://ethereum-holesky-rpc.publicnode.com
168+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
171169
```
172170

173171
**NOTE**: As said above, Aligned currently supports Risc0 proofs from `risc0-zkvm` version `v1.0.1`. For generating proofs using `cargo risc-zero` please ensure you are using `v1.0.1` or your proof will not be verified.
@@ -193,7 +191,7 @@ aligned submit \
193191
--aligned_verification_data_path ~/.aligned/aligned_verification_data \
194192
--keystore_path ~/.aligned_keystore/keystore0 \
195193
--network holesky \
196-
--rpc_url https://ethereum-holesky-rpc.publicnode.com
194+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
197195
```
198196
199197
### GnarkPlonkBn254, GnarkPlonkBls12_381 and Groth16Bn254
@@ -212,7 +210,7 @@ aligned submit \
212210
--batch_inclusion_data_directory_path [batch_inclusion_data_directory_path] \
213211
--keystore_path <path_to_ecdsa_keystore> \
214212
--network holesky \
215-
--rpc_url https://ethereum-holesky-rpc.publicnode.com
213+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
216214
```
217215
218216
**Examples**:
@@ -227,7 +225,7 @@ aligned submit \
227225
--batcher_url wss://batcher.alignedlayer.com \
228226
--keystore_path ~/.aligned_keystore/keystore0 \
229227
--network holesky \
230-
--rpc_url https://ethereum-holesky-rpc.publicnode.com
228+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
231229
```
232230
233231
```bash
@@ -240,7 +238,7 @@ aligned submit \
240238
--batcher_url wss://batcher.alignedlayer.com \
241239
--keystore_path ~/.aligned_keystore/keystore0 \
242240
--network holesky \
243-
--rpc_url https://ethereum-holesky-rpc.publicnode.com
241+
--rpc_url https://ethereum-holesky-rpc.publicnode.com
244242
```
245243
246244
```bash

docs/3_guides/1.2_SDK_api_reference.md

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Should be used before submitting proofs to the batcher. Wallet chain id needs to
290290
wallet = wallet.with_chain_id(chain_id);
291291
```
292292

293-
### Arguments
293+
#### Arguments
294294

295295
- `eth_rpc_url` - The URL of the Ethereum RPC node.
296296

@@ -303,7 +303,7 @@ wallet = wallet.with_chain_id(chain_id);
303303
- `EthereumProviderError` if there is an error in the connection with the RPC provider.
304304
- `EthereumCallError` if there is an error in the Ethereum call.
305305

306-
## `estimate_fee`
306+
### `estimate_fee`
307307

308308
Estimates the fee the user would have to pay for submitting a proof to Aligned. Depending on the
309309
priority the user wants to have in the batch, the `estimate` parameter can be set.
@@ -315,7 +315,7 @@ pub async fn estimate_fee(
315315
) -> Result<U256, errors::MaxFeeEstimateError>
316316
```
317317

318-
### Arguments
318+
#### Arguments
319319

320320
- `eth_rpc_url` - The URL of the Ethereum RPC node.
321321
- `estimate` - The parameter to set the priority for the proof to be included in the batch. It can be one
@@ -330,7 +330,7 @@ pub async fn estimate_fee(
330330
- `EthereumProviderError` if there is an error in the connection with the RPC provider.
331331
- `EthereumCallError` if there is an error in the Ethereum call.
332332

333-
## `compute_max_fee`
333+
### `compute_max_fee`
334334

335335
Computes `max_fee` for a proof based on the number of proofs in a batch (`num_proofs_per_batch`) and number of proofs (`num_proofs`) in that batch the user would pay for i.e (`num_proofs` / `num_proofs_per_batch`).
336336

@@ -342,7 +342,7 @@ pub async fn compute_max_fee(
342342
) -> Result<U256, errors::MaxFeeEstimateError>
343343
```
344344

345-
### Arguments
345+
#### Arguments
346346

347347
- `eth_rpc_url` - The URL of the Ethereum RPC node.
348348
- `num_proofs` - The number of proofs in a batch the user would pay for.
@@ -357,7 +357,7 @@ pub async fn compute_max_fee(
357357
- `EthereumProviderError` if there is an error in the connection with the RPC provider.
358358
- `EthereumCallError` if there is an error in the Ethereum call.
359359

360-
## `fee_per_proof`
360+
### `fee_per_proof`
361361

362362
Returns the `fee_per_proof` based on the current gas price for a batch compromised of `num_proofs_per_batch` i.e. (1 / `num_proofs_per_batch`).
363363

@@ -368,7 +368,7 @@ pub async fn fee_per_proof(
368368
) -> Result<U256, errors::MaxFeeEstimateError>
369369
```
370370

371-
### Arguments
371+
#### Arguments
372372

373373
- `eth_rpc_url` - The URL of the users Ethereum RPC node.
374374
- `num_proofs_per_batch` - The number of proofs within a batch.
@@ -381,3 +381,55 @@ pub async fn fee_per_proof(
381381

382382
- `EthereumProviderError` if there is an error in the connection with the RPC provider.
383383
- `EthereumCallError` if there is an error in the Ethereum call.
384+
385+
386+
### `deposit_to_aligned`
387+
388+
Funds the batcher payment service in name of the signer
389+
390+
pub async fn deposit_to_aligned(
391+
amount: U256,
392+
signer: SignerMiddleware<Provider<Http>, LocalWallet>,
393+
network: Network,
394+
) -> Result<ethers::types::TransactionReceipt, errors::PaymentError> {
395+
396+
#### Arguments
397+
`amount` - The amount to be paid.
398+
`signer` - The signer middleware of the payer.
399+
`network` - The network on which the payment will be done.
400+
401+
#### Returns
402+
The receipt of the payment transaction.
403+
404+
#### Errors
405+
`SendError` if there is an error sending the transaction.
406+
`SubmitError` if there is an error submitting the transaction.
407+
`PaymentFailed` if the payment failed.
408+
409+
410+
### `get_balance_in_aligned`
411+
412+
Queries a User's balance that was deposited in Aligned
413+
414+
```rust
415+
pub async fn get_balance_in_aligned(
416+
user: Address,
417+
eth_rpc_url: &str,
418+
network: Network,
419+
) -> Result<U256, errors::BalanceError> {
420+
```
421+
422+
#### Arguments
423+
424+
`user` - The address of the user.
425+
`eth_rpc_url` - The URL of the Ethereum RPC node.
426+
`network` - The network on which the balance will be checked.
427+
428+
#### Returns
429+
430+
- `Result<U256, errors::BalanceError>` - The balance of the user in the payment service.
431+
432+
#### Errors
433+
434+
- `EthereumProviderError` if there is an error in the connection with the RPC provider.
435+
- `EthereumCallError` if there is an error in the Ethereum call.

docs/3_guides/1_SDK_how_to.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To use this SDK in your Rust project, add the following to your `Cargo.toml`:
1212

1313
```toml
1414
[dependencies]
15-
aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer", tag="v0.9.1" }
15+
aligned-sdk = { git = "https://github.com/yetanotherco/aligned_layer", tag="v0.9.2" }
1616
```
1717

1818
To find the latest release tag go to [releases](https://github.com/yetanotherco/aligned_layer/releases) and copy the

docs/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
* [Running an operator](operator_guides/0_running_an_operator.md)
4040
* [Operator FAQ](operator_guides/1_operator_FAQ.md)
4141
* [Troubleshooting](operator_guides/2_troubleshooting.md)
42+
* Upgrading Guides
43+
* [Upgrading to v0.9.2](operator_guides/upgrading_guides/v0_9_2.md)
4244

4345
## Useful links
4446

docs/operator_guides/0_running_an_operator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Register as an Aligned operator in testnet
22

33
> **CURRENT VERSION:**
4-
> Aligned Operator [v0.9.1](https://github.com/yetanotherco/aligned_layer/releases/tag/v0.9.1)
4+
> Aligned Operator [v0.9.2](https://github.com/yetanotherco/aligned_layer/releases/tag/v0.9.2)
55
66
> **IMPORTANT:**
77
> You must be [whitelisted](https://docs.google.com/forms/d/e/1FAIpQLSdH9sgfTz4v33lAvwj6BvYJGAeIshQia3FXz36PFfF-WQAWEQ/viewform) to become an Aligned operator.
@@ -26,7 +26,7 @@ Minimum hardware requirements:
2626
To start with, clone the Aligned repository and move inside it
2727

2828
```bash
29-
git clone https://github.com/yetanotherco/aligned_layer.git --branch v0.9.1
29+
git clone https://github.com/yetanotherco/aligned_layer.git --branch v0.9.2
3030
cd aligned_layer
3131
```
3232

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Upgrading to v0.9.2
2+
3+
This guide will walk you through the process of upgrading your Aligned Operator to v0.9.2.
4+
5+
## Changes
6+
7+
### New Features
8+
9+
* fix: operator downtime by @MarcosNicolau in [#1073](https://github.com/yetanotherco/aligned_layer/pull/1073)
10+
* fix: operator commands by @MarcosNicolau in [#1184](https://github.com/yetanotherco/aligned_layer/pull/1184)
11+
* fix: operator resets channel when updating latest block file by @MarcosNicolau in [#1200](https://github.com/yetanotherco/aligned_layer/pull/1200)
12+
13+
## How to upgrade
14+
15+
### Step 1 - Update the configuration for your specific Operator
16+
17+
This version requires update the operator configuration file adding the following fields:
18+
19+
```yaml
20+
## Operator Configurations
21+
operator:
22+
last_processed_batch_filepath: '<path to a file to store the last processed batch>'
23+
```
24+
25+
{% hint style="warning" %}
26+
27+
Make sure the directory where the file is stored exists and the operator has write permissions to it.
28+
29+
We suggest to use absolute paths to avoid ambiguity.
30+
31+
{% endhint %}
32+
33+
### Step 2 - Update the Operator
34+
35+
Inside the Aligned repository, run:
36+
37+
```bash
38+
make update_operator
39+
```
40+
41+
This will recreate the binaries. You can then proceed to restart the operator.
42+
43+
### Step 3 - Check the Operator Version
44+
45+
To see the operator version, run:
46+
47+
```bash
48+
./operator/build/aligned-operator --version
49+
```
50+
51+
This will display the current version of the operator binary.
52+
53+
```
54+
Aligned Layer Node Operator version v0.9.2
55+
```
56+
57+
### Step 4 - Restart the Operator
58+
59+
Restart the operator based on your system config

explorer/.env.dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ DEBUG_ERRORS=true
2020

2121
# Operator version tracker API
2222
TRACKER_API_URL=http://localhost:3030
23+
24+
MAX_BATCH_SIZE=268435456 # 256 MiB

0 commit comments

Comments
 (0)