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 9 commits into
base: develop
Choose a base branch
from
Open

Improve docs #239

wants to merge 9 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 346812d

Report: https://flashbots-rbuilder-ci-stats.s3.us-east-2.amazonaws.com/benchmark/346812d-5d152e8/report/index.html

Date (UTC) 2024-11-05T20:52:46+00:00
Commit 346812d37bfed637ae84a1f031e4ca42de3e1467
Base SHA 5d152e8edc3c2027263c40b7661323a468a5f01b

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.

2 participants