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 Documentation for Tangle AVS #51

Merged
merged 9 commits into from
Oct 24, 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
1 change: 0 additions & 1 deletion ask-cookbook.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
declare module "@cookbookdev/docsbot/react" {
export { default } from "@cookbookdev/docsbot/dist/react/index.d.ts";
}

3 changes: 2 additions & 1 deletion pages/operators/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"introduction": "Get Started",
"node-basics": "Node Basics",
"validator": "Running a Validator",
"monitoring": "Node Monitoring"
"monitoring": "Node Monitoring",
"tangle-avs": "Tangle AVS"
}
75 changes: 40 additions & 35 deletions pages/operators/node-basics/systemd.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,53 +162,58 @@ rustup target add wasm32-unknown-unknown --toolchain nightly

**Account Keys**

```sh filename="Acco" copy
./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Sr25519 \
--suri <"12-MNEMONIC-PHARSE"> \
--key-type acco
```
```sh filename="Acco" copy

./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Sr25519 \
--suri <"12-MNEMONIC-PHRASE"> \
--key-type acco
```

**Babe Keys**

```sh filename="Babe" copy
./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Sr25519 \
--suri <"12-MNEMONIC-PHARSE"> \
--key-type babe
```
```sh filename="Babe" copy

./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Sr25519 \
--suri <"12-MNEMONIC-PHRASE"> \
--key-type babe
```

**Im-online Keys** - **these keys are optional**

```sh filename="Imonline" copy
./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Sr25519 \
--suri <"12-MNEMONIC-PHARSE"> \
--key-type imon
```
```sh filename="Imonline" copy

./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Sr25519 \
--suri <"12-MNEMONIC-PHRASE"> \
--key-type imon
```

**Role Keys**

```sh filename="Role" copy
./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Ecdsa \
--suri <"12-MNEMONIC-PHARSE"> \
--key-type role
```
```sh filename="Role" copy

./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Ecdsa \
--suri <"12-MNEMONIC-PHRASE"> \
--key-type role
```

**Grandpa Keys**

```sh filename="Grandpa" copy
./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Ed25519 \
--suri <"12-MNEMONIC-PHARSE"> \
--key-type gran
```
```sh filename="Grandpa" copy

./target/release/tangle key insert --base-path <BASE_PATH> \
--chain tangle-mainnet \
--scheme Ed25519 \
--suri <"12-MNEMONIC-PHRASE"> \
--key-type gran
```

**Node key**

Expand Down
4 changes: 4 additions & 0 deletions pages/operators/tangle-avs/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"quickstart": "Quickstart",
"cross-chain": "Cross-Chain Restaking"
}
47 changes: 47 additions & 0 deletions pages/operators/tangle-avs/cross-chain.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Cross-Chain Restaking
description: Cross-Chain Restaking
---

# Overview

Tangle AVS offers cross-chain restaking between Tangle and EigenLayer. Our system ensures that cross-chain actions,
specifically slashing, occur reliably, regardless of the network on which they originate or occur.

## Trust Model

The trust model for Tangle's cross-chain operations with EigenLayer is designed to be robust and transparent:

1. **Validator Responsibilities**: Operators running the Tangle AVS are subject to the slashing conditions of the
Tangle main chain, including consensus failures and offline absences. Misbehavior on either network can result in consequences
on both chains an operator is participating in.

2. **Cross-Chain Messaging**: We utilize a Hyperlane bridge to relay slashing events and rewards between both networks.

## How it Works

### Registration Flow

![Registration Flow](../../../public/images/diagram-tangle-avs-register.png)

### De-registration Flow

![De-registration Flow](../../../public/images/diagram-tangle-avs-deregister.png)

### Key Points in the AVS Flows:

- **Registration**: Upon Registering to EigenLayer and the AVS, the registration event is communicated to Tangle's
Network via a bridge. Following this cross-chain message, the node receives a reward in Tangle Tokens. Once receiving
this rewards, the AVS will join the validator set and register as an Operator. The Validator now begins validating on Tangle.

- **De-registration**: A node can de-register from both networks, by sending a deregister event to the AVS. This event
is forwarded to Tangle across the bridge to ensure the de-registration occurs on both networks.

- **Slashing**: When a validator misbehaves on EigenLayer, Tangle enforces the slashing event. Nodes listening for slashing events on Tangle forward that slashing to EigenLayer in exchange for a reward.
Similarly, slashing events that originate on Tangle can be forwarded to non-Tangle networks to be handled accordingly.
This centralized slashing mechanism ensures consistency and accountability.

## Where to Ask Questions

- Join our Discord to ask questions or join in on the discussions: [Tangle Discord](https://discord.com/invite/cv8EfJu3Tn)
- Telegram more your style? We're there too: [Tangle Telegram](https://t.me/tanglenet)
51 changes: 51 additions & 0 deletions pages/operators/tangle-avs/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Quickstart
description: Setting up Tangle AVS
---

import Callout from "../../../components/Callout";

# Tangle AVS: Quickstart Guide

The following is a guide outlining the steps to set up and utilize **Tangle AVS** (Actively Validated Services),
allowing you to run a Tangle Validator on **EigenLayer**'s network. If you do not have a Tangle node set up yet,
please review the **How to run a Tangle node** setup guide [here](../node-basics/quickstart.mdx).

This guide will help you get started with deploying the AVS and enabling cross-chain functionalities across multiple
blockchain protocols, specifically Tangle and EigenLayer. Further explanation on the cross-chain mechanisms offered by
Tangle AVS can be found in the [Cross-Chain](cross-chain.mdx) section.

For information on hardware requirements, see the [Hardware](../../operators/node-basics/hardware.mdx) section.

<Callout type="info">
Ensure that you have everything necessary for running a Tangle node and have access to the necessary network
configurations for EigenLayer or any other network you plan to connect to.
</Callout>

## Setup

The AVS is designed to automatically handle as much of the setup process as possible, so that you can focus on running your
Tangle node. Some specific configurations are in the midst of being implemented, and they will be added in a future update.

### Usage

1. Clone the repository:

```sh filename="git clone" copy
git clone https://github.com/tangle-network/avs.git tangle-avs
cd tangle-avs
```

2. Build:

```sh filename="cargo build" copy
cargo build --release
```

### Running Tests

This AVS is under active development, thus being unstable. In the meantime, the tests can be run locally to see the capabilities of the Tangle AVS. The following command runs a test that automatically generates and runs everything needed.

```sh filename="cargo test" copy
RUST_LOG=gadget=trace cargo test test_full_tangle_avs -- --nocapture
```
Binary file added public/images/diagram-tangle-avs-deregister.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/diagram-tangle-avs-register.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading