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

Improve docs #239

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

Improve docs #239

wants to merge 10 commits into from

Conversation

ZanCorDX
Copy link
Contributor

@ZanCorDX ZanCorDX commented Nov 5, 2024

📝 Summary

High-level doc about LiveBuilder.

💡 Motivation and Context

  • It was really hard to understand the whole system from scratch.
  • I'm so nice that I love making docs for the comunity.
  • I had a fight with my wife and I needed an excuse to stay a few more hours at the office.

✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

Copy link

github-actions bot commented Nov 5, 2024

Benchmark results for cc35a81

Report: https://flashbots-rbuilder-ci-stats.s3.us-east-2.amazonaws.com/benchmark/cc35a81-70579d1/report/index.html

Date (UTC) 2024-11-20T17:09:04+00:00
Commit cc35a81b090ef9df54c3f55f12d887f705c659f2
Base SHA 70579d128cda94081f1335e3cd3499ff94a7899a

Significant changes

None

Copy link
Contributor

@jakubhruby7 jakubhruby7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good doc! Left a few minor comments. Let's make sure we link to the code when we refer a specific struct/trait etc.

@@ -0,0 +1,179 @@
# rbuilder Classes and Dataflow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change this to something like LiveBuilder Dataflow and change the file name too.


## Core Components

To create a `LiveBuilder`, you need the following core components:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a LiveBuilder instance, ...

- Receives block-building opportunities
- Each received `MevBoostSlotData` triggers a new block-building task via `BlockBuildingPool`
- Sources slots from `LiveBuilder::blocks_source`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add a section Dataflow Diagram as this diagram refers to two previous sections


To create a `LiveBuilder`, you need the following core components:

1. `blocks_source`: The source of slots to build. Implements the [`SlotSource`](../crates/rbuilder/src/live_builder/mod.rs) trait. This abstraction enables rbuilder to handle block building in various contexts:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's link block_source

- L1: Consensus client generating slots with potential forks
- L2: Sequencer generating slots

2. `builders`: A vector of objects implementing the [`BlockBuildingAlgorithm`](../crates/rbuilder/src/building/builders/mod.rs) trait. Each builder:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's link builders

- Continuously generates new blocks
- Optimizes to maximize the true block value

3. `sink_factory`: A factory for the destination of built blocks. Implements [`UnfinishedBlockBuildingSinkFactory`](../crates/rbuilder/src/building/builders/mod.rs). This abstraction supports different contexts:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's link sink_factory


The main entrypoint `LiveBuilder::run()` initializes several long-lived components:

- **RPC Module**:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we link to the RPC Module here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants