Skip to content

chore(builder): flatten flashblocks builder, remove unnecessary trait interfaces#172

Merged
louisliu2048 merged 9 commits intomainfrom
niven/remove-unnecessary-traits
Mar 5, 2026
Merged

chore(builder): flatten flashblocks builder, remove unnecessary trait interfaces#172
louisliu2048 merged 9 commits intomainfrom
niven/remove-unnecessary-traits

Conversation

@sieniven
Copy link
Contributor

@sieniven sieniven commented Mar 5, 2026

Summary

This PR contains the final cleanup of the xlayer-builder.

  1. Flattens flashblocks and payload module by removing unnecessary traits, and shift the implementation directly into the new builder/src/flashblocks module
  2. Refactor builder configs, remove specific generics and add flashblocks configuration directly into the builder configuration
  3. Remove op prefix struct naming to flashblocks
  4. Shift p2p, wspub and flashblocks sequence cache into utlis mod

sieniven and others added 5 commits March 5, 2026 11:33
Remove the generic `PayloadBuilder` trait and `BuilderConfig<Specific>` generic
type parameter. Flatten `FlashblocksConfig` directly into `BuilderConfig` as a
named `flashblocks` field, eliminating the unnecessary indirection through the
`specific` field. Move `FlashblocksConfig` from the flashblocks submodule to the
parent payload module and remove the now-empty config submodule.

This simplifies the builder architecture by removing trait-based abstractions
that only had a single implementation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restructure the builder crate by collapsing the nested
`payload/flashblocks/` module hierarchy into a top-level `flashblocks/`
module. Move shared utilities (cache, execution, monitor) and builder
components (best_txs, builder_tx, context, generator, handler, service,
timing, wspub) into the flattened structure. Rename context/payload files
for clarity (handler_context, payload_builder).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename internal builder types for clarity and consistency:
- OpPayloadBuilderCtx -> FlashblocksBuilderCtx
- OpPayloadBuilder -> FlashblocksBuilder
- PayloadHandler -> FlashblocksPayloadHandler
- handler_context.rs -> handler_ctx.rs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reorganize import ordering across flashblocks modules to place
crate-local imports before external dependencies. Move p2p and wspub
modules into utils/ submodule. Consolidate module re-exports in mod.rs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sieniven and others added 2 commits March 5, 2026 15:49
Change p2p constants, Message enum, OpBuiltPayload struct, and their
methods from pub to pub(crate) to prevent unintended public exposure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move signer.rs from tx/signer.rs to crate::signer and relocate
tx/mock.rs to flashblocks/utils/mock.rs. Remove the now-empty tx
module. Update all import paths across args, flashblocks, and tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@JimmyShi22 JimmyShi22 left a comment

Choose a reason for hiding this comment

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

All previous comments addressed. The cleanup looks solid — module flattening is clean, trait removal is well-executed, and the new FlashblocksBuilderTx enum consolidation reads much better than the old two-struct approach. LGTM 🚢

Rename flashblocks/payload_builder.rs to flashblocks/builder.rs for
brevity. Update module declaration and import paths in handler, service,
and mod.rs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@louisliu2048 louisliu2048 merged commit 95d0e54 into main Mar 5, 2026
Vui-Chee added a commit that referenced this pull request Mar 9, 2026
* main:
  Feat(chainspec): adding xlayer-devnet chainspec (#167)
  chore(builder): flatten flashblocks builder, remove unnecessary trait interfaces (#172)
  rpc: remove unnecessary trait bounds and dependencies from XlayerRpcExtApiServer impl (#171)
  fix fmt in bin/tools/gen_genesis.rs (#170)
  fix(builder): Resolve bugs on upstream flashblocks timing scheduler (#169)
  Feat(tools): Add a tool to generate a custom genesis file based on a template and existing chain data (#159)
  feat(flashblocks): Add flashblocks sequence persistence logic on RPC and sequence replay flashblock builder (#162)
  chore(builder): remove unused custom-engine-api feature flag in tests (#168)
  fix: p2p test hang due to hang on port (#165)
Vui-Chee added a commit that referenced this pull request Mar 13, 2026
* main: (25 commits)
  fix: bump quinn-proto to 0.11.14 to patch CVE-2026-31812 DoS vuln (#183)
  pre-job authorization (#193)
  fix: trigger review skill failed to ack (#192)
  feat: trigger skill review separately (#191)
  feat: add Claude skills and CLAUDE.md for AI-assisted development (#190)
  rename ext (#185)
  supply workflow for claude (#184)
  feat(builder): incremental trie cache optimization for flashblocks state root (#163)
  chore(flashblocks-rpc): migrate op-reth flashblocks into xlayer-reth (#175)
  Feat(chainspec): adding xlayer-devnet chainspec (#167)
  chore(builder): flatten flashblocks builder, remove unnecessary trait interfaces (#172)
  rpc: remove unnecessary trait bounds and dependencies from XlayerRpcExtApiServer impl (#171)
  fix fmt in bin/tools/gen_genesis.rs (#170)
  fix(builder): Resolve bugs on upstream flashblocks timing scheduler (#169)
  Feat(tools): Add a tool to generate a custom genesis file based on a template and existing chain data (#159)
  feat(flashblocks): Add flashblocks sequence persistence logic on RPC and sequence replay flashblock builder (#162)
  chore(builder): remove unused custom-engine-api feature flag in tests (#168)
  fix: p2p test hang due to hang on port (#165)
  fix: update testcontainers to v0.27.0 to remediate CVE-2025-62518 (#164)
  chore(builder): further clean up builder crate (#161)
  ...
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