-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from chainbound/docs/fiber-boost
FiberBoost docs
- Loading branch information
Showing
7 changed files
with
129 additions
and
24 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
sidebar_position: 4 | ||
title: FiberBoost | ||
--- | ||
|
||
import Tabs from "@theme/Tabs"; | ||
import TabItem from "@theme/TabItem"; | ||
|
||
FiberBoost is a service that broadcasts ("boosts") blocks through the Fiber Network for faster global propagation, resulting in a reduced probability of missed slots due to [proposer boost & honest reorgs](https://www.paradigm.xyz/2023/04/mev-boost-ethereum-consensus#proposer-boost--honest-reorgs). FiberBoost provides multiple interfaces to boost blocks: | ||
|
||
## gRPC API | ||
The most straightforward and performant way to publish a block to Fiber is through the gRPC API. The `PublishBlock` endpoint is a bi-directional gRPC stream that accepts **SSZ encoded, signed beacon blocks**. The blocks can optionally be compressed with gzip. | ||
|
||
Both [`fiber-go >= v1.8.0`](https://github.com/chainbound/fiber-go/releases/tag/v1.8.0) and [`fiber-rs >= v0.5.1`](https://github.com/chainbound/fiber-rs/releases/tag/v0.5.1) provide an implementation of this method with gzip compression: | ||
|
||
<Tabs> | ||
<TabItem value="go" label="Golang"> | ||
|
||
```go | ||
import ( | ||
"context" | ||
"fmt" | ||
"log" | ||
"time" | ||
|
||
fiber "github.com/chainbound/fiber-go" | ||
) | ||
|
||
|
||
func main() { | ||
// Connection process omitted | ||
... | ||
|
||
// SSZ encoded, signed beacon block | ||
beaconBlock := []byte{...} | ||
|
||
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) | ||
defer cancel() | ||
|
||
// Returns the slot, root, and timestamp of the block, or a potential error | ||
slot, root, timestamp, err := client.SubmitBlock(ctx, beaconBlock) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
fmt.Println("Submitted block", slot, root, timestamp) | ||
} | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="rs" label="Rust"> | ||
|
||
```rust | ||
use bytes::Bytes; | ||
use fiber::{Client, api::BlockSubmissionResponse}; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
// Connection process omitted | ||
// .... | ||
|
||
// SSZ encoded, signed beacon block | ||
let beacon_block = vec![...]; | ||
|
||
let result: BlockSubmissionResponse = client.publish_block(beacon_block).await.unwrap(); | ||
|
||
println!("Submitted block: {} {:#x} {}", block.slot, block.root, block.timestamp); | ||
} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
## MEV-Boost | ||
Chainbound maintains an open-source, modified version of the [MEV-Boost](https://boost.flashbots.net) validator sidecar at [this repository](https://github.com/chainbound/mev-boost). The fork has a very minimal diff with the upstream Flashbots repository and follows the same release schedule. Track the diff [here](https://github.com/chainbound/mev-boost/pull/1). | ||
|
||
### How it works | ||
The following interaction diagram depicts the block proposal process using the modified MEV-Boost: | ||
![](/img/fiber-boost.png) | ||
**The main difference with normal MEV-Boost is that when it receives a `Payload` from the relay, it will reconstruct the full signed beacon block, SSZ encode it and publish it to Fiber.** | ||
|
||
If you're a validator running MEV-Boost, this is the easiest way to start using FiberBoost. | ||
|
||
### Running it | ||
Coming soon! | ||
|
||
## Direct Peering | ||
Just like with [FiberGuard](./fiber-guard), we offer a direct peering connection on the consensus layer for boosting blocks. This will mean that all blocks we receive on said connection will be boosted on our network. | ||
|
||
The requirements and setup procedure are the same as with FiberGuard, you can read them [here](./fiber-guard#requirements). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.