Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7914369
initial p2p node impl in p2p crate
noot Sep 18, 2025
a082367
update args and add p2p node to flashblocks service
noot Sep 19, 2025
960ecf7
send built flashblocks to p2p layer
noot Sep 22, 2025
c03416d
implement generic message in p2p crate, concrete message in builder
noot Sep 22, 2025
5428121
implement incoming streams handler
noot Sep 24, 2025
847180e
implement PayloadHandler for handling incoming p2p payloads
noot Sep 24, 2025
fa98c77
support multiple stream protocols
noot Sep 24, 2025
590927c
make agent version configurable
noot Sep 24, 2025
192340d
merge w main
noot Sep 24, 2025
7ae5778
fmt
noot Sep 25, 2025
5b77ff1
clippy
noot Sep 25, 2025
3b66510
add known peers flag
noot Sep 25, 2025
380a5c1
update error handling for better logging in payload builder
noot Sep 25, 2025
fdfcc95
basic sync and execution pipeline implementation
noot Oct 5, 2025
f522f4f
merge w main
noot Oct 5, 2025
2ee1855
change p2p hex string to file path; add documentation for p2p crate
noot Oct 6, 2025
b20f773
fix optional flags
noot Oct 6, 2025
1105f6f
merge w base
noot Oct 6, 2025
15b6c03
bump op-revm, debugging sync
noot Oct 9, 2025
181689e
sync working but flashblock hash mismatch
noot Oct 11, 2025
2c30d3e
fix receipt calculation; hashes match when syncing
noot Oct 14, 2025
35715c7
update Message trait to have custom to/from string
noot Oct 14, 2025
1b1f345
cargo update
noot Oct 14, 2025
2b0e5cd
fix copilot issues
noot Oct 14, 2025
696030a
fix copilot issues
noot Oct 14, 2025
9fd7548
fix derive_more
noot Oct 14, 2025
3237890
fix copilot issues
noot Oct 14, 2025
1badb92
regenerate Cargo.lock
noot Oct 14, 2025
1a8fd45
merge w main
noot Oct 14, 2025
f3f47eb
revert dep changes
noot Oct 15, 2025
66f89ed
merge w base
noot Oct 15, 2025
0193f43
lint
noot Oct 15, 2025
378e139
remove unneeded struct
noot Oct 15, 2025
86a3633
execute flashblock cleanup
noot Oct 15, 2025
c8c26e0
add metrics
noot Oct 15, 2025
29e1a85
cleanup
noot Oct 15, 2025
27c4046
wip fix tests
noot Oct 16, 2025
37d46af
fix tests
noot Oct 16, 2025
986c99e
remove comment
noot Oct 16, 2025
6e6d9de
merge: wip
noot Oct 20, 2025
2525f48
Merge branch 'main' of https://github.com/flashbots/op-rbuilder into …
noot Oct 20, 2025
3e9ea53
merge
noot Oct 20, 2025
0d30052
update p2p args
noot Oct 20, 2025
9a9b31d
add max peer arg
noot Oct 21, 2025
9ebf706
lint
noot Oct 21, 2025
8603372
merge w base
noot Oct 22, 2025
5aa7e42
lint
noot Oct 22, 2025
31c527c
merge wip
noot Oct 27, 2025
7bb5c80
temp fix
noot Oct 27, 2025
5313e7d
rename metrics with payload_tx_ to payload_transaction_
noot Oct 27, 2025
22889f1
Merge branch 'noot/p2p' of https://github.com/flashbots/op-rbuilder i…
noot Oct 27, 2025
6c5c442
merge w base
noot Oct 27, 2025
21f5681
merge w main
noot Oct 27, 2025
2fc9fad
address comments
noot Oct 27, 2025
5094625
spawn_blocking for execute_flashblock
noot Oct 27, 2025
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
81 changes: 81 additions & 0 deletions crates/op-rbuilder/src/builders/flashblocks/ctx.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
use crate::{
builders::{BuilderConfig, OpPayloadBuilderCtx, flashblocks::FlashblocksConfig},
gas_limiter::{AddressGasLimiter, args::GasLimiterArgs},
metrics::OpRBuilderMetrics,
traits::ClientBounds,
};
use op_revm::OpSpecId;
use reth_basic_payload_builder::PayloadConfig;
use reth_evm::EvmEnv;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_evm::{OpEvmConfig, OpNextBlockEnvAttributes};
use reth_optimism_payload_builder::{OpPayloadBuilderAttributes, config::OpDAConfig};
use reth_optimism_primitives::OpTransactionSigned;
use std::sync::Arc;
use tokio_util::sync::CancellationToken;

#[derive(Debug, Clone)]
pub(super) struct OpPayloadSyncerCtx {
/// The type that knows how to perform system calls and configure the evm.
evm_config: OpEvmConfig,
/// The DA config for the payload builder
da_config: OpDAConfig,
/// The chainspec
chain_spec: Arc<OpChainSpec>,
/// Max gas that can be used by a transaction.
max_gas_per_txn: Option<u64>,
/// The metrics for the builder
metrics: Arc<OpRBuilderMetrics>,
}

impl OpPayloadSyncerCtx {
pub(super) fn new<Client>(
client: &Client,
builder_config: BuilderConfig<FlashblocksConfig>,
evm_config: OpEvmConfig,
metrics: Arc<OpRBuilderMetrics>,
) -> eyre::Result<Self>
where
Client: ClientBounds,
{
let chain_spec = client.chain_spec();
Ok(Self {
evm_config,
da_config: builder_config.da_config.clone(),
chain_spec,
max_gas_per_txn: builder_config.max_gas_per_txn,
metrics,
})
}

pub(super) fn evm_config(&self) -> &OpEvmConfig {
&self.evm_config
}

pub(super) fn max_gas_per_txn(&self) -> Option<u64> {
self.max_gas_per_txn
}

pub(super) fn into_op_payload_builder_ctx(
self,
payload_config: PayloadConfig<OpPayloadBuilderAttributes<OpTransactionSigned>>,
evm_env: EvmEnv<OpSpecId>,
block_env_attributes: OpNextBlockEnvAttributes,
cancel: CancellationToken,
) -> OpPayloadBuilderCtx {
OpPayloadBuilderCtx {
evm_config: self.evm_config,
da_config: self.da_config,
chain_spec: self.chain_spec,
config: payload_config,
evm_env,
block_env_attributes,
cancel,
builder_signer: None,
metrics: self.metrics,
extra_ctx: (),
max_gas_per_txn: self.max_gas_per_txn,
address_gas_limiter: AddressGasLimiter::new(GasLimiterArgs::default()),
}
}
}
1 change: 1 addition & 0 deletions crates/op-rbuilder/src/builders/flashblocks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use service::FlashblocksServiceBuilder;
mod best_txs;
mod builder_tx;
mod config;
mod ctx;
mod p2p;
mod payload;
mod payload_handler;
Expand Down
4 changes: 2 additions & 2 deletions crates/op-rbuilder/src/builders/flashblocks/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ impl<Pool, Client, BuilderTx> OpPayloadBuilder<Pool, Client, BuilderTx> {
config: BuilderConfig<FlashblocksConfig>,
builder_tx: BuilderTx,
payload_tx: mpsc::Sender<OpBuiltPayload>,
metrics: Arc<OpRBuilderMetrics>,
) -> eyre::Result<Self> {
let metrics = Arc::new(OpRBuilderMetrics::default());
let ws_pub = WebSocketPublisher::new(config.specific.ws_addr, Arc::clone(&metrics))?.into();
let address_gas_limiter = AddressGasLimiter::new(config.gas_limiter_config.clone());
Ok(Self {
Expand Down Expand Up @@ -710,7 +710,7 @@ where

match build_result {
Err(err) => {
ctx.metrics.invalid_blocks_count.increment(1);
ctx.metrics.invalid_built_blocks_count.increment(1);
Err(err).wrap_err("failed to build payload")
}
Ok((new_payload, mut fb_payload)) => {
Expand Down
Loading
Loading