Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c314bc2
chore(flashblocks-rpc): clean up and refactor dirs
sieniven Mar 9, 2026
beed97b
style(flashblocks): fix import ordering in cache module
sieniven Mar 9, 2026
8c4ca82
feat(flashblocks-rpc): add state cache with pending and confirm caches
sieniven Mar 9, 2026
8bb7fc0
chore(flashblocks-rpc): remove types module and clean up re-exports
sieniven Mar 9, 2026
9be3a74
feat(flashblocks): add pending sequence and canonical block handlers …
sieniven Mar 9, 2026
9a25e60
feat(builder): revamp flashblocks caching layer
sieniven Mar 10, 2026
2cb1ea3
fix(flashblocks-rpc): fix range bounds trait impl operations
sieniven Mar 10, 2026
59164fd
chore(flashblocks-rpc): refactor state mod
sieniven Mar 11, 2026
dd25891
feat(flashblocks-rpc): add transaction index to confirm cache
sieniven Mar 11, 2026
d805b73
feat(flashblocks-rpc): add cache overlay for sealed_headers_while
sieniven Mar 11, 2026
2634962
fix(flashblocks-rpc): refactor range to add optional predicate
sieniven Mar 11, 2026
e25008c
chore(flashblocks-rpc): refactor cache, add tx index to pending sequence
sieniven Mar 11, 2026
e94f969
refactor(flashblocks-rpc): move provider impls to eth api override in…
sieniven Mar 11, 2026
1dd2c75
style(rpc): clean up import ordering and formatting
sieniven Mar 11, 2026
10fd30c
feat(flashblocks-rpc): clean up handle logic and channels
sieniven Mar 11, 2026
c9a18d8
feat(flashblock-rpc): fix flashblocks eth extensions and helpers, cle…
sieniven Mar 12, 2026
043e312
refactor(node): unify flashblocks state init into single if-let block
sieniven Mar 12, 2026
5ab3b80
refactor(flashblocks): store ExecutedBlock in confirm cache for state…
sieniven Mar 12, 2026
b62076a
feat(flashblocks-rpc): add memory overlay state provider for flashblo…
sieniven Mar 13, 2026
b122e33
feat(flashblocks-rpc): support eth_sendRawTransactionSync
sieniven Mar 13, 2026
dafa740
feat(flashblocks-rpc): support eth_call and eth_estimateGas
sieniven Mar 13, 2026
30ae3a1
fix(flashblocks-rpc): simplify eth_call and eth_estimateGas trait calls
sieniven Mar 13, 2026
b41d65b
feat(flashblocks-rpc): support raw flashblocks payload cache
sieniven Mar 13, 2026
d47ef3b
Merge branch 'main' of github.com:okx/xlayer-reth into niven/cleanup-…
sieniven Mar 13, 2026
6666f70
Fix merge errors
sieniven Mar 13, 2026
634be38
fix(flashblocks-rpc): use spawn_critical_task for service handles
sieniven Mar 13, 2026
391da2c
test(flashblocks-rpc): add unit test coverages for caches
sieniven Mar 13, 2026
c18a37d
chore: fix tests
sieniven Mar 16, 2026
53c30db
feat(flashblocks-rpc): add cached receipts to pending sequence and st…
sieniven Mar 16, 2026
324de32
chore(flashblocks): re-export FlashblockCachedReceipt from crate root
sieniven Mar 16, 2026
707f540
refactor(flashblocks): remove execution cache, inline types into exec…
sieniven Mar 16, 2026
079ecb7
feat: revamp flashblocks execution logic, use sync SR calc first
sieniven Mar 16, 2026
495e3ba
Merge branch 'main' of github.com:okx/xlayer-reth into niven/cleanup-…
sieniven Mar 16, 2026
f2d3752
feat: revamp worker, split into processor and validator
sieniven Mar 16, 2026
94e1d8a
style(flashblocks): reformat validator match expression
sieniven Mar 16, 2026
56c22f5
refactor(rpc): update eth API to use explicit generic parameters
sieniven Mar 17, 2026
2d6d29c
refactor(rpc): rename modules and types for clarity
sieniven Mar 17, 2026
8329664
chore(rpc): remove unused dependencies and clean up
sieniven Mar 17, 2026
bf9f91a
Fix
sieniven Mar 17, 2026
2f9b01e
Revert "style(flashblocks): reformat validator match expression"
sieniven Mar 17, 2026
634594d
Revert "feat: revamp worker, split into processor and validator"
sieniven Mar 17, 2026
56910db
Revert "feat: revamp flashblocks execution logic, use sync SR calc fi…
sieniven Mar 17, 2026
51c9b26
Revert "refactor(flashblocks): remove execution cache, inline types i…
sieniven Mar 17, 2026
190237c
feat(flashblocks-rpc): Revamp worker, add state root strategies into …
sieniven Mar 19, 2026
de771af
Merge branch 'main' of github.com:okx/xlayer-reth into niven/cleanup-…
sieniven Mar 19, 2026
7e4c558
fix(flashblocks): resolve merging receipt index on incremental builds…
sieniven Mar 20, 2026
7da6e81
fix(flashblocks): resolve passing overlay data to generating lazyover…
sieniven Mar 20, 2026
7380011
feat(flashblocks): thread payload events sender to RPC service for en…
sieniven Mar 24, 2026
9e1b537
Fmt
sieniven Mar 24, 2026
35f1509
feat: Add flashblocks rpc handles
sieniven Mar 25, 2026
c344206
refactor(flashblocks): flush execution task queue on state cache reset
sieniven Mar 25, 2026
a74a10c
refactor(flashblocks): simplify flush return flow and fix minor issues
sieniven Mar 25, 2026
b0a8862
feat(flashblocks): track payload_id through execution for incremental…
sieniven Mar 25, 2026
89ee622
refactor(flashblocks): remove unused methods and tighten dead code attrs
sieniven Mar 25, 2026
7c0a691
fix: resolve claude issues
sieniven Mar 25, 2026
455fcaa
fix(flashblocks): fix confirm cache insert ordering and capacity check
sieniven Mar 25, 2026
50e4841
chore: add comments
sieniven Mar 25, 2026
40d60cb
fix(flashblocks): guard uninitialized canon height and use OS thread …
sieniven Mar 25, 2026
878d3f5
fix(flashblocks): reset confirm_height to canon height on flush
sieniven Mar 25, 2026
715fcd2
feat(flashblocks): extend overlay provider with canonical in-memory s…
sieniven Mar 25, 2026
862793a
feat: Add sending flashblocks target index
sieniven Mar 26, 2026
e570398
fix(flashblocks): fix pending_stale flush by promoting complete seque…
sieniven Mar 26, 2026
99d8168
fix(flashblocks): apply cumulative gas offset during suffix execution
sieniven Mar 27, 2026
3775a30
fix(flashblocks): use pending sequence hash for incremental state pro…
sieniven Mar 27, 2026
811eb5d
fix(flashblocks): flatten multi-transition reverts for incremental bu…
sieniven Mar 27, 2026
bb05216
feat(flashblocks): add debug state comparison between flashblocks and…
sieniven Mar 27, 2026
fb5a042
refactor(flashblocks): add get_executed_block_by_number for debug lookup
sieniven Mar 27, 2026
df288e2
Refactor
sieniven Mar 27, 2026
a36bca7
refactor(flashblocks): remove trie data comparison from debug output
sieniven Mar 27, 2026
e42e44f
Better logging
sieniven Mar 27, 2026
bd968ab
Merge branch 'main' of github.com:okx/xlayer-reth into niven/cleanup-…
sieniven Mar 30, 2026
3fa2b4a
Merge branch 'main' of github.com:okx/xlayer-reth into niven/cleanup-…
sieniven Mar 30, 2026
60a1346
fix(flashblocks): restore hashed_state comparison and send empty trie…
sieniven Mar 30, 2026
5e8dd9c
fix(flashblocks): check incoming canon hash to ensure confirm states …
sieniven Mar 30, 2026
bb8aa3a
chore(flashblocks): improve execution validator logging
sieniven Mar 30, 2026
6042ba7
fix(flashblocks): fix state trie updates
sieniven Mar 30, 2026
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
66 changes: 51 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3", default-features = false }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3", default-features = false }
reth-db-models = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3", default-features = false }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3", default-features = false }
reth-engine-tree = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3", default-features = false }
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3", default-features = false }
Expand Down Expand Up @@ -130,6 +132,8 @@ reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3" }
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3", default-features = false }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3" }
reth-trie-parallel = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.3" }

# ==============================================================================
# Reth Optimism Dependencies (from local optimism/rust op-reth)
Expand Down Expand Up @@ -167,6 +171,7 @@ alloy-chains = { version = "0.2.30", default-features = false }
alloy-contract = { version = "~1.6" }
alloy-consensus = { version = "~1.6", default-features = false }
alloy-eips = { version = "~1.6", default-features = false }
alloy-eip7928 = { version = "0.3.0", default-features = false }
alloy-evm = { version = "~0.27", default-features = false }
alloy-genesis = { version = "~1.6", default-features = false }
alloy-json-rpc = { version = "~1.6" }
Expand Down Expand Up @@ -223,6 +228,7 @@ jsonrpsee-core = { version = "0.26.0" }

# misc
clap = { version = "4.4.3" }
crossbeam-channel = "0.5.13"
derive_more = { version = "2", default-features = false, features = ["full"] }
dashmap = "6.1"
either = { version = "1.15.0", default-features = false }
Expand All @@ -243,7 +249,7 @@ tracing = { version = "0.1.41" }
shellexpand = "3.1"
url = "2.5"
brotli = "8.0"
ringbuffer = "0.15"
ringbuffer = "=0.16.0"

# p2p
libp2p = { version = "0.56", features = ["identify", "ping", "noise", "tcp", "autonat", "mdns", "tokio", "cbor", "macros", "yamux", "dns"] }
Expand Down
7 changes: 7 additions & 0 deletions bin/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ xlayer-trace-monitor.workspace = true

# reth
reth.workspace = true
reth-chain-state.workspace = true
reth-optimism-node.workspace = true
reth-optimism-primitives.workspace = true
reth-optimism-cli.workspace = true
reth-node-api.workspace = true
reth-node-builder.workspace = true
Expand All @@ -46,7 +48,9 @@ reth-optimism-forks.workspace = true
reth-optimism-txpool.workspace = true
reth-transaction-pool.workspace = true
reth-cli-util.workspace = true
reth-provider.workspace = true
reth-rpc-server-types.workspace = true
reth-tasks = { workspace = true, features = ["rayon"] }

# alloy
alloy-primitives.workspace = true
Expand All @@ -57,6 +61,9 @@ op-alloy-network.workspace = true
# revm
revm.workspace = true

# async
tokio.workspace = true

# misc
clap.workspace = true
tracing.workspace = true
Expand Down
72 changes: 54 additions & 18 deletions bin/node/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ pub struct XLayerArgs {
#[command(flatten)]
pub builder: BuilderArgs,

/// Flashblocks RPC configuration
#[command(flatten)]
pub flashblocks_rpc: FlashblocksRpcArgs,

/// Enable legacy rpc routing
#[command(flatten)]
pub legacy: LegacyRpcArgs,
Expand All @@ -132,22 +136,6 @@ pub struct XLayerArgs {
#[command(flatten)]
pub intercept: XLayerInterceptArgs,

/// Enable custom flashblocks subscription
#[arg(
long = "xlayer.flashblocks-subscription",
help = "Enable custom flashblocks subscription (disabled by default)",
default_value = "false"
)]
pub enable_flashblocks_subscription: bool,

/// Set the number of subscribed addresses in flashblocks subscription
#[arg(
long = "xlayer.flashblocks-subscription-max-addresses",
help = "Set the number of subscribed addresses in flashblocks subscription",
default_value = "1000"
)]
pub flashblocks_subscription_max_addresses: usize,

#[arg(
long = "xlayer.sequencer-mode",
help = "Enable sequencer mode for the node (default: false, i.e., RPC mode). This flag can be used by various business logic components to determine node behavior.",
Expand Down Expand Up @@ -247,6 +235,48 @@ impl LegacyRpcArgs {
}
}

#[derive(Debug, Clone, Args, PartialEq, Eq, Default)]
pub struct FlashblocksRpcArgs {
/// Enable flashblocks RPC
#[arg(
long = "xlayer.flashblocks-url",
help = "URL of the flashblocks RPC endpoint (disabled by default)"
)]
pub flashblock_url: Option<Url>,

/// Enable custom flashblocks subscription
#[arg(
long = "xlayer.flashblocks-subscription",
help = "Enable custom flashblocks subscription (disabled by default)",
default_value = "false"
)]
pub enable_flashblocks_subscription: bool,

/// Set the number of subscribed addresses in flashblocks subscription
#[arg(
long = "xlayer.flashblocks-subscription-max-addresses",
help = "Set the number of subscribed addresses in flashblocks subscription",
default_value = "1000"
)]
pub flashblocks_subscription_max_addresses: usize,

/// Enable flashblocks RPC state comparison debug mode
#[arg(
long = "xlayer.flashblocks-debug-state-comparison",
help = "Enable flashblocks RPC state comparison debug mode",
default_value = "false"
)]
pub flashblocks_debug_state_comparison: bool,

/// Disable flashblocks RPC pre-warming engine state
#[arg(
long = "xlayer.flashblocks-disable-pre-warming",
help = "Disable flashblocks RPC pre-warming engine state",
default_value = "false"
)]
pub flashblocks_disable_pre_warming: bool,
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down Expand Up @@ -391,13 +421,19 @@ mod tests {
"--xlayer.flashblocks-subscription",
"--xlayer.flashblocks-subscription-max-addresses",
"2000",
"--xlayer.flashblocks-url",
"ws://localhost:1111",
])
.args;

assert!(args.enable_flashblocks_subscription);
assert!(args.legacy.legacy_rpc_url.is_some());
assert_eq!(args.legacy.legacy_rpc_timeout, Duration::from_secs(45));
assert_eq!(args.flashblocks_subscription_max_addresses, 2000);
assert!(args.flashblocks_rpc.enable_flashblocks_subscription);
assert_eq!(args.flashblocks_rpc.flashblocks_subscription_max_addresses, 2000);
assert_eq!(
args.flashblocks_rpc.flashblock_url,
Some(Url::parse("ws://localhost:1111").unwrap())
);
assert!(args.validate().is_ok());
}

Expand Down
Loading