feat(builder): state trie cache warming with channel-based streaming#568
Draft
feat(builder): state trie cache warming with channel-based streaming#568
Conversation
Collaborator
🟡 Heimdall Review Status
|
Contributor
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
64c7022 to
2064044
Compare
Add background state trie cache warming feature that calculates state roots to pre-warm state trie caches before witness generation. This addresses performance issues when state root calculation is disabled. When the builder runs with `disable_state_root: true`, witness generation for the state trie uses cold caches, causing slow performance. By proactively calculating state roots in the background (even though the result isn't used), we warm these caches. The warming process runs asynchronously after each flashblock, and the warm caches remain available for fast witness generation. - **Background warming**: State root calculation runs in background threads after each flashblock publishes, never blocking the main build pipeline - **Smart throttling**: Only one warming task runs at a time using atomic flags; additional attempts are skipped and tracked in metrics - **Non-interruptible**: State root calculation runs to completion once started, but doesn't block new FCU arrivals - **Comprehensive metrics**: Full observability with start/complete/skip/error counters and duration histograms New CLI flag and environment variable: - `--flashblocks.enable-state-trie-warming` (default: false) - `FLASHBLOCKS_ENABLE_STATE_TRIE_WARMING` - **Cold cache state root**: ~500-2000ms (disk I/O intensive) - **Warm cache state root**: ~50-200ms (CPU-bound) - **Net improvement**: 5-10x faster witness generation - **Use case**: Helps avoid missed blocks during high-load periods 1. Added CLI flag to FlashblocksArgs 2. Added config field to FlashblocksConfig 3. Created StateTrieWarmer module with background task spawning 4. Added 5 new metrics for observability 5. Integrated warming after each flashblock publishes 6. Warming uses spawn_blocking for CPU-intensive work This is a DRAFT implementation to illustrate potential performance improvements. It has NOT been tested in production and requires thorough testing and validation before deployment. The primary goal is to demonstrate a possible solution for avoiding missed blocks by pre-warming state trie caches.
…teTrieWarmerTask Replace the batch-oriented StateTrieWarmer with a channel-based StateTrieWarmerTask that receives per-transaction EvmState updates, matching reth's state root task pattern for future swapability. - StateTrieMessage enum with StateUpdate/FinishedStateUpdates variants - StateTrieHook sender wrapper with auto-finish on Drop - StateTrieWarmerTask with continuous warming: debounced 10ms after first tx, re-schedules if txs arrive during computation - evm_state_to_hashed_post_state() helper copied from reth multiproof - Single channel+task per block instead of per-flashblock warming calls - State updates sent after each evm.transact() before commit
2064044 to
53cf1c8
Compare
refcell
pushed a commit
that referenced
this pull request
Feb 18, 2026
Simplifies the deserialization of numeric fields in `OpExecutionPayload` by directly deserializing them as `U64` values instead of going through string deserialization with `alloy_serde::quantity::deserialize`. The following fields are affected: - `block_number` - `gas_limit` - `gas_used` - `timestamp` - `blob_gas_used` - `excess_blob_gas` This change: - Removes unnecessary string allocations during deserialization - Simplifies the code by removing the `IntoDeserializer` dependency - Aligns with similar fixes made in the main alloy repository Related to alloy-rs/alloy#2684 Co-authored-by: Claude <noreply@anthropic.com>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 18, 2026
* feat: add fn for decoded 1559 params (#236)
smol helper
* chore: move eip1559 impls (#237)
move to consensus, make them reusable
* feat: bump alloy (#240)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* fix(consensus): fix arbitrary impl for `OpTxType` (#242)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Bug arbitrary impl
## Solution
Add missing `OpTxType::Eip7702` to `OpTxType::ALL` list
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* fix(consensus): add conversion for `OpTxType::Eip7702` (#244)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Broken decoding for eip7702
## Solution
Adds conversion from u8 to `OpTxType::Eip7702`
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: add is dynamic fee (#245)
* feat: add nonce to RPC transaction (#246)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
ref https://github.com/paradigmxyz/reth/pull/12474
We need a separate `deposit_nonce` to account for deposit transaction
responses which have it while it's not present in inner envelope.
## Solution
Adds `nonce` field to `OptionalFields` helper. It would get deserialized
only if envelope did not consume it and serialized only if present and
inner envelope is a deposit
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat: wrap `TxDeposit` into `Sealed` in `OpTxEnvelope` (#247)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
ref https://t.me/paradigm_reth/36099
Makes envelope more consistend by making all variants hold a hash
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: add deserde test (#248)
* chore: bump alloy 064 (#249)
* feat: add missing OpTxType trait impls (#258)
adds encodeable+decodable+partialeq
* chore(book): Frames to Batches Example (#232)
### Description
Adds an examples for transforming `Frame`s into `Batch`es and the
reverse.
* feat(protocol): Batch Encoding (#259)
### Description
Implements encoding for batch types.
Steps in the direction to batch submission.
* fix(book): Batch over SingleBatch (#260)
### Description
Since #259 adds `Batch` encoding, book examples can decode and encode
directly to and from the `Batch` types instead of the `SingleBatch`
type.
* chore(protocol): Re-organizes Modules and Errors (#261)
### Description
Removes public visibility from modules so crate docs don't show all the
`pub use mod::*` types as re-exported.
Also moves error types from `utils` into a new `errors` module.
* feat(protocol): Brotli Compression behind `std` (#263)
### Description
Adds batch compression to the `ChannelOut`.
* fix: protected bits handling (#270)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Protected bits are only present for legacy transactions and we should
respect transaction type when getting them in `full_txs`
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore(protocol): Remove TryFrom (#268)
### Description
Removes the `TryFrom` span batch for `RawSpanBatch`, inlining the
coercion into a `to_raw_span_batch` method.
Closes #266.
* feat(protocol): ZLIB Compression (#264)
### Description
Adds zlib compression to the `ChannelOut`.
Closes #267
* feat(protocol): Batch Reader (#265)
### Description
Re-introduces the `BatchReader` into `op-alloy-protocol`.
Batch compression already introduces the `brotli` and `miniz-oxzide`
deps.
The compression and decompression abstractions used here should be
improved for both directions: compression + decompression.
* chore(workspace): Use thiserror for Error Types (#269)
### Description
Now that `thiserror` supports `no_std`, we can use `thiserror` for error
types over `derive_more::Display`.
This PR updates the workspace to use `thiserror`.
* feat: add missing txtype tryfroms (#272)
* chore: Remove Error Impls (#273)
### Description
Removes error impls using `thiserror` instead.
* chore(genesis): Remove Re-exports (#276)
### Description
Removes re-exports from `op-alloy-genesis`.
* feat(genesis): Holocene Timestamps on Sepolia (#285)
### Description
Adds Holocene timestamps for OP Sepolia and Base Sepolia hardcoded
rollup configs.
* chore(op-alloy): Docs (#277)
### Description
Small doc touchup pr for `op-alloy` crate.
* chore(protocol): Cleanup Examples (#278)
### Description
Cleans up `op-alloy-protocol` examples using the exported
`decompress_brotli` method.
* chore(consensus): Move OpTxType and add tests (#282)
### Description
Moves `OpTxType` from the `envelope` mod into it's own `tx_type` mod to
make it more digestible.
Also adds tests, including an `OpTxType::ALL` test that requires a
newly-added variant is added to the list.
* chore(protocol): Batch Transaction Mod (#284)
### Description
Moves the `BatchTransaction` into the `batch` mod.
* chore(consensus): OpTxType Conversion (#283)
### Description
Upstreams a small `OpTxType` conversion to `alloy_primitives::U8` from
reth.
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* chore(consensus): Signature Definitions (#281)
### Description
Simplifies signature definitions.
Closes #59.
* chore(consensus): Re-export and Hardfork Cleanup (#274)
### Description
Cleans up re-exports in `op-alloy-consensus`.
Moves towards a world where addresses can be customizable for
`Hardforks`.
Would like to see the `AddressList` come into play here in there future
for extensibility.
Should also update `Hardforks` to provide a more extensible pattern to
add future hardforks.
Might be worth renaming `Hardforks` to "Protocol Upgrades" to be in-line
with the OP Stack [specs](https://specs.optimism.io).
* chore(consensus): Cleanup Hardforks (#288)
### Description
Cleans up hardforks further to split bytecode into a legible directory.
* feat: Introduce op-alloy-registry (#290)
### Description
Migrates `superchain-registry` crate into `op-alloy` so hardcoded
configs and periphery methods in `op-alloy-genesis` can be removed.
Since `op-alloy-registry` is `no_std`, we can use the rollup configs
parsed from the `ethereum-optimism/superchain-registry` directly
instead of defining custom hardcoded registries.
* fix(genesis): Base Fee Params (#292)
### Description
Fixes base fee param loading in the `ChainConfig` -> `RollupConfig`
conversion to actually pull in the `OpBaseFeeParams` defined in the
`optimism` field of the `ChainConfig`.
* chore(genesis): Remove hardcoded configs (#291)
### Description
Removes hardcoded rollup configs and deprecates associated methods.
Since `op-alloy-registry` is `no_std` it should be used instead.
* chore(consensus): Trait Abstracted Hardforks (#289)
### Description
Trait abstracts hardforks to make them more ergonomic to extend, modify,
or introduce a new hardfork.
* chore: add default for txtype (#295)
doesn't hurt, need this because default enforced in reth for testing
* fix(protocol): Remove panic in brotli compress method (#296)
### Description
Removes an unintended panic in the brotli compression method.
* chore(protocol): Move and Extend Brotli Compression (#298)
### Description
Moves brotli compression to the correct `brotli` module.
Extends the brotli compression method to accept the brotli compression
level.
See:
https://github.com/ethereum-optimism/optimism/blob/develop/op-node/rollup/derive/types.go#L50
* chore(protocol): Refactor Block Info Txs (#303)
### Description
Refactors the `block_info.rs` module into a new `info/` module that
makes the `L1BlockInfoTx` more extensible.
Closes #302
* chore(consensus): EIP-2718 Encoding Trait Impls (#300)
### Description
Moves custom EIP-2718 encoding and decoding methods on `TxDeposit` into
trait impls for the alloy eip traits.
* chore(ci): Add missing no_std crates (#310)
### Description
Adds missing crates to the `no_std` checks that support `no_std`.
* chore(registry): Small Cleanup (#307)
### Description
Small PR cleaning up the test utilities in `op-alloy-registry`
* fix(op-alloy): Add Missing Registry Crate (#311)
### Description
Adds the missing `op-alloy-registry` to the `op-alloy` aggregator crate
under the `registry` feature flag.
* chore(workspace): Touchup crate docs with badges (#309)
### Description
Touches up crate documentation with badges.
* chore(workspace): Remove Hand-rolled Display Error Impls (#312)
### Description
When using [`thiserror::Error`][error] with `#[error(..)]` attributes, a
`Display` impl [is generated for the
error](https://github.com/dtolnay/thiserror?tab=readme-ov-file#details).
This PR removes all hand-rolled Display impls for errors, using
`thiserror::Error` with `#[error]` attributes on variants.
[error]: https://docs.rs/thiserror/latest/thiserror/derive.Error.html
* chore(registry): Dogfood Test Rollup Config (#308)
### Description
Dogfoods the hardcoded test rollup config and uses the new
`From<&RollupConfig> for HardForkConfiguration`.
* feat(protocol): Compressors (#299)
### Description
Introduces compressors into `op-alloy-protocol`, cleaning up the brotli
and zlib utility methods as well as the `ChannelOut` type.
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: bump alloy (#314)
Ref:
https://github.com/alloy-rs/alloy/pull/1672#pullrequestreview-2457745263
---------
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* chore(workspace): Remove Deprecated Methods (#313)
### Description
Drafting this up so as to not forget.
Want to delete deprecated methods in the next minor release.
We haven't been strictly following semver keeping breaking api changes
to major, but I figure this is better than breaking through a patch.
* feat: bump alloy (#322)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat: add typed 2718 for txtype (#323)
* feat(engine): FCU Version (#321)
### Description
Introduces an FCU version for downstream engine api use.
* chore(registry): Update SCR (#327)
### Description
Updates the SCR to the latest version.
* Enable alloy-primitives/arbitrary in dev-deps (#329)
Enables
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Running tests individually locally fails.
## Solution
Enable `arbitrary` feature for `alloy-primtives` in dev-deps.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* Propagate arbitrary (#330)
Based on https://github.com/alloy-rs/op-alloy/pull/329
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Incomplete arbitrary feature propagation
## Solution
Enables `alloy-primitives/arbitrary` in local `arbtirary` feature
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: add miner extension trait (#325)
ref
https://github.com/paradigmxyz/reth/issues/13092
and
https://github.com/ethereum-optimism/op-geth/blob/0a46245ccc5c801e7b18c258aceb5327d8ad69ad/eth/api_miner.go#L60-L62
* feat(consensus): tx envelope tx hash (#324)
### Description
Adds a helper method to the `OpTxEnvelope` to return the inner
transaction hash.
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* Add placeholder for isthmus time to genesis (#331)
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Closes https://github.com/alloy-rs/op-alloy/issues/328
## Solution
Adds placeholder field for `isthmus_time` in `op-alloy-genesis`.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore(registry): Bump superchain-registry commit (#336)
### Description
Bumps the `superchain-registry` commit.
* chore: bump alloy (#338)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: reuse methods for receipt rlp (#339)
Reuses methods from alloy receipt for deposit receipt and makes them pub
for reuse in reth
* feat: add serde for OpTxType (#317)
Closes #262
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: upstream decode extradata fn (#340)
add reth function with was duplicated code
https://github.com/paradigmxyz/reth/blob/c816a3b758a39640388cc179abafd924ff9103b9/crates/optimism/chainspec/src/lib.rs#L268-L279
we already have the `decode_eip_1559_params` fn but were missing the
decode from extradata slice.
this renames the previous `decode_holocene_extra_data` function to
encode_ because this actually encodes
* feat: add OpPooledTransaction (#341)
## Motivation
We need a type that represents a pooled transaction, this cannot include
deposit transactions
## Solution
Implemented `OpPooledTransaction`, which is like `OpTxEnvelope` but
without the deposit variant.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* chore: reorder impl fns (#342)
use same order as trait
* docs: fix docs (#343)
* [Bug] miner_setMaxDASize should return bool type (#346)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
op batcher prints error
`ERROR[12-17|18:17:23.568] Result of SetMaxDASize was false, retrying.`
command for op-bathcer
```shell
op-batcher \
--l2-eth-rpc=http://localhost:8545 \
--rollup-rpc=http://localhost:9545 \
--poll-interval=1s \
--sub-safety-margin=6 \
--num-confirmations=1 \
--safe-abort-nonce-too-low-count=3 \
--resubmission-timeout=30s \
--rpc.addr=0.0.0.0 \
--rpc.port=8548 \
--rpc.enable-admin \
--max-channel-duration=25 \
--l1-eth-rpc=$L1_RPC_URL \
--private-key=$GS_BATCHER_PRIVATE_KEY
```
golang implementation of optimism's op-geth [returns
bool](https://github.com/ethereum-optimism/op-geth/blob/optimism/eth/api_miner.go#L62)
type for `miner_setMaxDASize` call. Therefore, expected response might
be like following:
```json
{
"jsonrpc": "2.0",
"id": 0,
"result": true
}
```
On the other hand, current trait [returns
`()`](https://github.com/alloy-rs/op-alloy/blob/main/crates/rpc-jsonrpsee/src/traits.rs#L146),
represents null for json.
```rust
pub trait MinerApiExt {
/// Sets the maximum data availability size of any tx allowed in a block, and the total max l1
/// data size of the block. 0 means no maximum.
#[method(name = "setMaxDASize")]
async fn set_max_da_size(&self, max_tx_size: U64, max_block_size: U64) -> RpcResult<()>; // should return bool
}
```
```json
{
"jsonrpc": "2.0",
"id": 0,
"result": null
}
```
ref: #325, #345
## Solution
alter `()` to `bool` for return type
```rust
async fn set_max_da_size(&self, max_tx_size: U64, max_block_size: U64) -> RpcResult<bool>;
```
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [x] Breaking changes
* feat: impl From<TxEip7702> for OpTypedTransaction (#348)
## Motivation
This would be nice to have since it's a variant
## Solution
`impl From<TxEip7702> for OpTypedTransaction`
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* [Feature] Use Upstream Forkchoice Version (#347)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
close #326
* chore: make clippy happy (#349)
* chore: bump alloy 0.9 (#350)
* chore(rpc): `no_std` support `op-alloy-rpc-jsonrpsee` (#356)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Closes https://github.com/alloy-rs/op-alloy/issues/355
## Solution
Adds `no_std` support `op-alloy-rpc-jsonrpsee`, and removes exclusion
from CI wasm check
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat(protocol): Interop Types (#352)
### Description
Adds interop message types to `op-alloy-protocol` following the
[ExecutingMessage
spec](https://github.com/ethereum-optimism/specs/blob/main/specs/interop/predeploys.md#executingmessage-event)
and the associated [op-geth
code](https://github.com/ethereum-optimism/op-geth/blob/optimism/core/types/interoptypes/interop.go).
* feat(protocol): Compressors with Mocked Brotli Streaming (#335)
### Description
Introduces various compressors for batch submission.
This replaces #305 for now since the brotli compressor writer isn't
playing nice.
Streaming compression is instead mocked by using the earlier
`compress_brotli` method with a wrapper that implements the
`CompressorWriter` trait.
* feat(interop): Define `ExecutingMessage` wrapper (#361)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Closes https://github.com/alloy-rs/op-alloy/issues/360
## Solution
Defines `ExecutingMessage` wrapper for `ExecutingMessageAbi`.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* Define supervisor API (#359)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Closes https://github.com/alloy-rs/op-alloy/issues/358
## Solution
Implements supervisor interop API
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
Co-authored-by: refcell <abigger87@gmail.com>
* chore(protocol): migrate `op-alloy-protocol`->`op-rs/maili-protocol` (#364)
Migrates `op-alloy-protocol`->`op-rs/maili-protocol`. Re-exports
`maili-protocol::*`.
* chore(provider): Migrate `op-alloy-provider`->`op-rs/maili-provider` (#365)
Migrates `op-alloy-provider` to `op-rs/maili-provider`. Re-exports
`maili-provider::*`.
* chore(registry): Migrate `op-alloy-registry`->`op-rs/maili-registry` (#366)
Migrates `op-alloy-registry` to `op-rs/maili-registry`. Re-exports
`maili_registry::*`.
* chore(rpc-types-engine): Migrate `op_alloy_rpc_types_engine::superchain`->`op-rs/maili-rpc-types-engine` (#367)
Migrates `op_alloy_rpc_types_engine::superchain` to
`op-rs/maili-rpc-types-engine`. Re-exports `maili::rpc_types_engine::*`.
---------
Co-authored-by: refcell <abigger87@gmail.com>
* chore(provider): Remove Provider Crate (#373)
### Description
The provider crate only contains op specific types that don't extend or
relate to ethereum types.
This PR removes `op-alloy-provider` since `maili-provider` can be used
in place.
* chore(registry): Remove the Registry Crate (#372)
### Description
The registry crate is a binding around the `superchain-registry` repo.
It isn't related to ethereum types and just bloats `op-alloy`. This PR
deletes the registry crate since `maili-registry` provides the same
functionality.
* chore(protocol): Remove Protocol Crate (#371)
### Description
Removes the optimism-specific protocol crate becoming very bloated with
interop types, batching primitives like compressors and decompressors,
and derivation-specific data structures.
* chore: Remove rpc-jsonrpsee Crate (#376)
### Description
Replaces #370
Removes the `op-alloy-rpc-jsonrpsee` crate since `maili` provides this
functionality in `maili-rpc-jsonrpsee`.
* chore(genesis): Add `interop_time` to `RollupConfig` + `HardForkConfiguration` (#382)
## Overview
Adds a new optional `interop_time` field to `RollupConfig` +
`HardForkConfiguration`.
* chore(docs): Remove `op-alloy-protocol` from docs (#380)
- Removes `op-alloy-protocol` from docs. Ref
https://github.com/alloy-rs/op-alloy/pull/371.
- Updates issue template to reflect removed crates
https://github.com/alloy-rs/op-alloy/pull/372,
https://github.com/alloy-rs/op-alloy/pull/376
* chore(rpc): Migrate rpc types to maili (#378)
Migrates types in `op-alloy-rpc-types` to `maili-rpc`
* chore(consensus): Migrate deposit source to `maili-common` (#377)
Migrates deposit source types to `maili-common`
---------
Co-authored-by: refcell <abigger87@gmail.com>
* chore(provider): Revert #365 remove `OpEngineApi` (#379)
Reverts migrating `OpEngineApi` that originates from l1. Adds OP-unique
`EngineExtApi` as super trait.
Blocked by release of https://github.com/op-rs/maili/pull/48
* chore(genesis): Migrate `op-alloy-genesis`->`maili-genesis` (#381)
Migrates `op-alloy-genesis` to `maili-genesis`
* chore(consensus): Migrate deposit tx behaviour to `maili` (#383)
Implements `maili-common` traits `DepsoitTransaction` and
`DepositTxEnvelope` for `DepositTx` and `OpTxEnvelope` respectively
* chore(deps): Bump `maili` to 0.1.5 (#385)
* fix: op-alloy-provider (#390)
### Description
Adds `op-alloy-provider` back to the `op-alloy` crate.
* feat(consensus): add is_deposit to OpTxEnvelope (#396)
## Motivation
This is a useful helper method for when you have a concrete
`OpTxEnvelope` and want to know whether or not it's a deposit
transaction.
## Solution
Adds `fn is_deposit`
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: add serde-bincode-compat for re-export features (#397)
## Motivation
Until reth completely moves off of `op-alloy-consensus`, and onto
`maili-consensus`, we'll want to enable this transitive dependency
feature from the `op-alloy-consensus` dep.
## Solution
Add `serde-bincode-compat` feature to `op-alloy-consensus` and propagate
to `maili-consensus`
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: revert maili deps (#399)
Closes https://github.com/alloy-rs/op-alloy/issues/398
this reverts a bunch of stuff and removes all maili dependencies.
this is definitely incomplete but is the first step towards restoring
op-alloy as a maili independent repo.
the dep graph looks now as follows:
alloy -> op-alloy -> maili
maili can have all types limited to protocol impls (although debatable
if this is actually beneficial, imo this just slows down development
atm).
next steps are invert deps on maili side and clean things up there.
this repo would benefit from the flz stuff, so I suggest we move this
crate in here and only keep the brotli stuff in maili
* feat: add flz (#400)
adds standalone flz repo
this could eventually be converted into a standalone crate, if revm is
willing to import that and remove code dup
* feat(ci): Add feature propagation checks (#402)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Closes #332.
## Solution
Add feature propagation checks to CI.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: rm execution requests from v4 payload fn (#401)
closes #395
* chore: bump alloy 0.11 (#403)
## Description
Bump alloy to the next version.
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* chore: rm bad non_exhaustive (#404)
these are sleeping timebombs because these require the user to add an
unreachable arm
* feat(consensus): Isthmus Network Upgrade Txs (#405)
### Description
Drafts up the network upgrade transactions for the Isthmus hardfork.
- [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935#deployment) ->
block hash contract
- ~~[EIP-7002](https://eips.ethereum.org/EIPS/eip-7002#deployment) ->
withdrawals request contract~~
- ~~[EIP-7251](https://eips.ethereum.org/EIPS/eip-7251#deployment) ->
consolidation requests contract~~
* fix(consensus): L1BlockInfo datas (#408)
### Description
Fixes the l1 block info datas.
* fix(consensus): Ecotone Upgrade Txs (#412)
### Description
Fixes the ecotone upgrade txs per the [optimism
specs](https://specs.optimism.io).
* feat(isthmus): define `IsthmusPayloadFields` (#410)
Closes https://github.com/alloy-rs/op-alloy/issues/407
* feat: add OpExecutionPayloadV4 (#414)
add opstack specific V4 payload type
* Define `OpExecutionPayload` (#416)
Closes https://github.com/alloy-rs/op-alloy/issues/415
* Add operator fee to rpc l1 block (#420)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
We need to show operator fee new params in RPC receipts.
Close #419
Ref https://github.com/paradigmxyz/reth/pull/14243
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat(isthmus): define `OpExecutionData` (#418)
Closes https://github.com/alloy-rs/op-alloy/issues/417
- Defines `OpExecutionData` which wraps `OpExecutionPayload` and
`OpExecutionPayloadSidecar`
- Debugs `OpExecutionPayload`
- Removes `OpExecutionPayloadV4`, since the l2 withdrawals root goes in
sidecar, it doesn't add an extra field to the header
* feat: add is-deposit helper (#422)
* fix: std leakage (#432)
### Description
Fixes leakage of std in tests
* feat: remove IsthmusPayloadFields (#431)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Ref #430
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
Removed `IsthmusPayloadFields` and its related fuctions
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [x] Breaking changes
---------
Co-authored-by: refcell <abigger87@gmail.com>
* feat: add additional compat impls (#427)
~~blocked by https://github.com/alloy-rs/alloy/pull/2042~~
turns out we dont need this
adds some conversion helpers for txdepoist
* chore: make test compile (#434)
dont enable in test
* feat(l2-withdrawals): Impl conversion to block for `OpExecutionPayloadV4` (#435)
Ref https://github.com/alloy-rs/op-alloy/issues/421
* feat: add tryfrom envelope conversions (#433)
adds some additional conversion helpers
* feat: impl OpExecutionData (#429)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Ref #421
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
Implemented some functions for `OpExecutionData` similar to
`ExecutionData` from alloy
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [x] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
* chore: additional envelope conversion (#437)
* custom deserialize impl for OpExecutionPayload (#436)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
#425
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
Create custom `deserialise` impl for `OpExecutionPayload`
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: add fn for signature hash (#438)
this returns an option because deposits are not signed.
* feat: add bincode compat support for depositreceipts (#440)
closes #424
ensures this type can be used when doing bincode style serde where
flatten or skipped fields are not supported
this is so annoying ...
* feat(l2-withdrawals): impl conversion payload + sidecar into block (#441)
Closes https://github.com/alloy-rs/op-alloy/issues/439
- Adds `OpPayloadError` as extension of `PayloadError` with op variants
* feat: add signed conversion (#443)
ref https://github.com/alloy-rs/alloy/pull/2070
* feat(l2-withdrawals): Add `OpPayloadError` variants for blob transactions and l1 withdrawals (#442)
Pre-req for l2-withdrawals is that the payload validation diverges from
l1 payload validation. Adds stateless payload checks to
`OpExecutionPayload::try_into_block`
* feat(l2-withdrawals): Add methods for prague payload fields to `OpExecutionPayloadSidecar` (#445)
Adds methods for accessing Prague fields to `OpExecutionPayloadSidecar`
* Add interop time to genesis (#447)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Closes https://github.com/alloy-rs/op-alloy/issues/446
For https://github.com/paradigmxyz/reth/pull/14582
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore(consensus): Remove Hardforks (#448)
### Description
Removes the `hardforks` module from `op-alloy-consensus`.
This is now available in `kona` as a standalone crate called
[`kona-hardforks`](https://crates.io/crates/kona-hardforks).
* feat: added helpers for opExecutionData (#451)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Ref #450
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
Added:
- `parent_beacon_block_root`
- `withdrawals`
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [x] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* chore: fix imports (#452)
my bad
* test: fix flaky bincode compat rountrip test (#453)
this can be flaky if the arbitrary status is Postate which does not
exist for OP
* feat: impl AnyRpcTransaction for OpTxEnvelope (#454)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Ref #449
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
Implement TryFrom<AnyRpcTransaction> for OpTxEnvelope
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [x] Added Tests
- [x] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat(l2-withdrawals-root): Add conversions for `OpExecutionData` (#455)
- Adds missing variant `OpExecutionPayload::V1`, needed to support
conversion from `ExecutionPayloadInputV2`
- Fixes buggy `as_mut` methods for `OpExecutionPayload`
- Adds conversion from `newPayload` args to `OpExecutionData`
* Bump msrv to 1.82 (#459)
Bumps MSRV to 1.82
* Add conversions from block to payload (#460)
Adds conversion from block to `OpExecutionPayload` and `OpExecutionData`
* Remove redundant method for v4 payload (#461)
No need for method `OpExecutionPayloadV4::withdrawals` and the types it
imports, since the inner payload is in a publicly accessible field
anyways. This list of withdrawals should always be empty.
* feat: add signabletx impl for typedtx (#462)
this is quite useful and we don't expect this to be used for deposits
* fix(engine): Empty requests hash (#463)
Bugfix
Bug: empty root hash used instead of empty requests hash
* chore(consensus): AsRef<OpTxEnvelope> (#464)
### Description
Implements `AsRef<OpTxEnvelope>` over itself so a generic tx type that
implements `AsRef<OpTxEnvelope>` can be specified.
Basically, we need a way to convert the
[`op_alloy_rpc_types::Transaction`](https://docs.rs/op-alloy-rpc-types/latest/op_alloy_rpc_types/struct.Transaction.html#impl-AsRef%3COpTxEnvelope%3E-for-Transaction)
type into an `OpTxEnvelope`. Since it implements `AsRef<OpTxEnvelope>`,
we can just implement `AsRef` over `OpTxEnvelope` itself so we can
restrict a generic
`T: AsRef<OpTxEnvelope>` and use either `OpTxEnvelope` or
`op_alloy_rpc_types::Transaction`.
#### Provenance
See: https://github.com/op-rs/kona/pull/1176
* chore(deps): alloy 0.12 (#466)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Bump alloy to `0.12`
Closes #316
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
- Bump alloy deps (using patch until 0.12 release)
- Bump alloy-core
- Impl RlpEcdsaEncodableTx for OpTypedTransaction
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: remove associated constant from RlpEcdsaEncodableTx (#469)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
same as https://github.com/alloy-rs/alloy/pull/2172
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: derive hash for envelope (#470)
* feat(rpc-types-engine): Support V4 network payload (#471)
## Overview
Adds support for the V4 CL network payload, introduced with Isthmus.
* Bump msrv to 1.85 (#457)
Bumps MSRV to 1.85
* fix(l2-withdrawals-root): `OpExecutionPayloadEnvelopeV4` missing v4 payload (#472)
Bug: `OpExecutionPayloadEnvelopeV4` contains v3 not op v4 payload
Fix: change to op v4 payload
* Bump edition (#458)
Bumps edition to 2024
---------
Co-authored-by: refcell <abigger87@gmail.com>
* chore: Update Dependencies (#474)
### Description
Updates dependencies.
* chore: Remove deposit context source (#475)
## Overview
Removes the deposit context source, which is no longer necessary as a
part of the interop upgrade.
* feat(op-alloy-rpc-types-engine): add `superchain` mod (#476)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Part of https://github.com/paradigmxyz/reth/issues/15243.
## Solution
Export
https://github.com/op-rs/kona/blob/main/crates/node/rpc/src/superchain.rs#L24
in `op-alloy-rpc-types-engine` crate.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat: move safety level (#477)
ref https://github.com/paradigmxyz/reth/pull/15105
fyi @SozinM
* fix(rpc-types-engine): Fix `PayloadHash` for V3 + V4 topic (#482)
## Overview
Fixes the payload hash for the V3 + V4 topic.
spec:
https://specs.optimism.io/protocol/rollup-node-p2p.html#block-signatures
* feat: add hash ref function (#483)
hash fn is a bit of a mess rn, we have hash, hash_ref and tx_hash.
this follows the convention that hash should return a ref.
before next breaking release we should make this more consistent
* chore: remove op-alloy-flz crate and dep (#484)
## Motivation
Closes #480
the `op-alloy-flz` crate has been extracted to
https://github.com/alloy-rs/flz
## Solution
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat(rpc-types-engine): SSZ Payload Encoding (#485)
### Description
Implements ssz payload encoding for gossiping
`OpNetworkPayloadEnvelope`s via consensus p2p.
* chore: implement serde_bincode_compat for envelope (#486)
- This PR also helps close out
https://github.com/paradigmxyz/reth/issues/15377
- Related implementation: https://github.com/alloy-rs/alloy/pull/2263
- Running test via `cargo test --features "serde serde-bincode-compat
arbitrary k256" test_op_tx_envelope_bincode_roundtrip_arbitrary` shows
successful test. Please lmk if it's robust enough or if there's some
pointers to make this implementation more extensive 🤙
- Note that you'll need `alloy-consensus = { workspace = true, features
= ["serde", "serde-bincode-compat" ] }` and `[features]
default = ["std", "serde", "serde-bincode-compat", "arbitrary"]` in the
`Cargo.toml`
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* chore: clippy happy (#487)
* chore: rm borrow attr (#490)
ref https://github.com/paradigmxyz/reth/pull/15629
* chore(deps): bincode 2.0 (#491)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Ref https://github.com/alloy-rs/alloy/issues/2295
Update bincode to 2.0
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
- Bumps bincode
- Addresses breaking changes in tests
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat: add missing conversions (#492)
missing conversions towards
https://github.com/paradigmxyz/reth/issues/15627
* chore: alloy 1.0 (#493)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Update to alloy 1.0
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
- [x] bump alloy-core deps
- [ ] alloy
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: add input mut (#478)
blocked by https://github.com/alloy-rs/core/pull/921
same as https://github.com/alloy-rs/alloy/pull/2244
for https://github.com/paradigmxyz/reth/issues/15245
* feat: added OpTxEnvelope::try_into_recovered (#496)
fixes #495
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: added recover helpers for OpPayloadAttributes (#489)
fixes #488
---------
Co-authored-by: Emilia Hane <emiliaha95@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: add OpTxEnvelope::new_unhashed (#499)
ref https://github.com/alloy-rs/alloy/pull/2322
this unifies api and makes this setup easier
* chore: add is_deposit to optxtype (#500)
* chore: add new_unchecked (#504)
mirrors alloy's fn
* feat(consensus): Add interop block replacement deposit source (#505)
## Overview
Adds the interop block replacement deposit source, as specified in
[interop
derivation](https://specs.optimism.io/interop/derivation.html#optimistic-block-source-hash).
* fix(engine): Use OpExecutionPayloadV4 (#509)
### Description
Fixes the engine api to use the `OpExecutionPayloadV4` type with the
withdrawals root. Without this, V4 engine api methods post-isthmus will
error since the `withdrawalsRoot` field *must* not be nil.
* chore: add istyped support (#510)
towards https://github.com/paradigmxyz/reth/issues/16026
cc @18aaddy
* feat(engine): Superchain Signal (#512)
### Description
Adds support for the
[`engine_signalSuperchainV1`](https://specs.optimism.io/protocol/exec-engine.html#engine_signalsuperchainv1)
to the `OpEngineApi` trait.
Uses the `SuperchainSignal` and `ProtocolVersion` types defined in
`op_alloy_rpc_types_engine`.
* fix: ensure all bytes consumed (#515)
* feat: add SingerRecoverable impl (#516)
* fix(rpc-types-engine): Error Implementation (#519)
### Description
Implement error on the `ProtocolVersionError` type.
* chore(super-consensus): Migrate `InvalidInboxEntry` from reth (#518)
Closes https://github.com/alloy-rs/op-alloy/issues/517
* chore: bump alloy 1.0.0 (#521)
alloy 1.0
* chore: rm native recover fn (#522)
* fix(rpc-types-engine): Rename op payload sidecar field (#497)
Fixes naming, replacing `canyon` with `ecotone` for referring to cancun
fields
* chore: relax conversion (#523)
* feat(`network`): impl RecommendedFillers for Optimism (#524)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
ref https://github.com/alloy-rs/alloy/pull/2479
ref https://github.com/alloy-rs/alloy/issues/2478
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
Impl `RecommendedFillers` so that a provider with the correct fillers
can be built for the Optimism network.
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat: made TxDeposit's mint field non-optional (#514)
fixes #513
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: add meta helpers (#527)
these will allow us to offload this impl entirely
https://github.com/paradigmxyz/reth/blob/4df1425fcf860572331c682cf868d0a94129536f/crates/optimism/rpc/src/eth/transaction.rs#L93-L97
ref https://github.com/paradigmxyz/reth/issues/16451
* feat: added Transaction conversion from consensus for rpc (#529)
closes #528
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: add Extended conversions for OpPooledTransaction, OpTxEnvelope (#530)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Ref https://github.com/paradigmxyz/reth/issues/16411
`Extended` type is moved from Reth to Alloy.
So it also needs to move `TryFrom`, `From` trait conversions to op-alloy
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: add receipt helpers (#531)
mirror https://github.com/alloy-rs/alloy/pull/2533
* Change `InvalidInboxEntry` repr `i64`->`i32` for `jsonrpsee` error compat (#532)
Changes repr of `InvalidInboxEntry` to `i32` for better conversion to
`jsonrpsee::ErrorObjectOwned` error code
* feat(interop): Rename `InvalidInboxEntry`->`SuperchainDAError` (#535)
Renames `InvalidInboxEntry` to `SuperchainDAError`.
Some of these error variants occur also on updating superchain state.
The name `InvalidInboxEntry` is to specialised for
`supervisor_checkAccessList`.
Adds feature `jsonrpsee` to `op-alloy-rpc-types` and feature gated
conversion to `jsonrpsee::ErrorObjectOwned`.
* chore: add smol conversion helper (#536)
smol helper for converting rpc op tx info via envelope type
* feat(rpc-types-engine): OpExecutionPayload Wrapper (#539)
### Description
A thin wrapper around `OpExecutionPayload` that includes the parent
beacon block root that provides a rust-equivalent to
[`ExecutionPayloadEnvelope`](https://github.com/ethereum-optimism/optimism/blob/7c812674f9e2068949a152f44fde13fcb93b2c45/op-service/eth/types.go#L233).
This is required for a serialized rpc type in the op admin api to post
unsafe payloads.
* chore(consensus): Rename `SafetyLevel` variants `Unsafe`->`LocalUnsafe` and `Safe`->`CrossSafe` (#545)
Updates `SafetyLevel` variant names to match Go impl
Ref https://github.com/ethereum-optimism/specs/issues/717
* feat(rpc-types-engine): SSZ Encoding (#544)
### Description
In order to construct a signature to add to an
`OpNetworkPayloadEnvelope`, the op payload has to be serialized as ssz.
The serialized ssz bytes are then signed over using a local signer.
Along with constructing the payload hash, the signature is used to
construct the `OpNetworkPayloadEnvelope`.
Once the `OpNetworkPayloadEnvelope` is constructed with the signature
over the ssz encoded payload bytes,
the `OpNetworkPayloadEnvelope` is encoded and sent over the wire through
op p2p gossip.
* feat(consensus): Add `OpTransaction` trait (#548)
Closes #543
## Motivation
To accept extended transactions composed of `OpTransaction`s
## Solution
Implement the trait for `OpTxEnvelope` and `Extended`
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat(consensus): Add `as_deposit` into `OpTransaction` trait (#549)
Follow-up on #548
## Motivation
`OpTransaction` trait can tell if its deposit, but that is not very
useful if I also need to extract it.
## Solution
Add `as_deposit` function into the trait for the extraction of
`TxDeposit`.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat(rpc): Replace wrapped `OpTxEnvelope` with a generic in the `Transaction` RPC response (#542)
## Motivation
Extending the transaction RPC response requires to rewrite this entire
type.
## Solution
Replace the `OpTxEnvelope` with a generic parameter constrained to
`alloy_consensus::Transaction` and `SignerRecoverable`.
Allows reusing `Transaction` RPC response object with custom
transactions.
Simplifies the creation of custom nodes.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat(rpc): Convert into RPC transaction from generic `OpTransaction` (#550)
Follow-up on #549
## Motivation
The RPC transaction object has a dedicated conversion function that
accepts `OpTxEnvelope` struct. But it cannot be used with a transaction
that is not `OpTxEnvelope` but implements `OpTransaction`.
## Solution
Since `OpTransaction` provides all the needed functionality for the
conversion, replace the `OpTxEnvelope` type with a generic type.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* fix: move `Transaction::from_transaction` (#552)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* chore: bump alloy (#551)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Bumps alloy to 1.0.10 and integrates new `TransactionEnvelope` derive
macro
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* Fix: Correct typos in comments (#554)
### **Description:**
This pull request addresses minor typographical errors in the codebase
comments.
- Corrected `occured` to `occurred` in
`crates/rpc-types-engine/src/envelope.rs`.
- Updated a comment for clarity in
`crates/rpc-types-engine/src/superchain.rs`.
* docs: fix typo in payload comment (#555)
### **Description:**
```markdown
A small typo was corrected in a comment within the `OpExecutionPayload` implementation. This improves the clarity of the documentation.
- **File:** `crates/rpc-types-engine/src/payload/mod.rs`
- **Change:** "preformed" -> "performed"
```
* fix!: use `TransactionRequest` in `Network` impl (#525)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
Ref https://github.com/alloy-rs/alloy/issues/2478
`OpTransactionRequest` is a wrapper around `TransactionRequest`.
It doesn't implement `TransactionBuilder4844` (It shouldn't). But this
makes it incompatible with `ProviderBuilder` default constructor `new`
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
- Remove OpTransactionRequest
- Move related `From` conversions
- Use TransactionRequest in network impl
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
---------
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* feat: derive `TransactionEnvelope` for `OpPooledTransaction` (#556)
<!--
Thank you for your Pull Request. Please provide a description above and
review
the requirements below.
Bug fixes and new features should include tests.
Contributors guide:
https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
The contributors guide includes instructions for running rustfmt and
building the
documentation.
-->
<!-- ** Please select "Allow edits from maintainers" in the PR Options
** -->
## Motivation
<!--
Explain the context and why you're making that change. What is the
problem
you're trying to solve? In some cases there is not a problem and this
can be
thought of as being the motivation for your change.
-->
## Solution
<!--
Summarize the solution and provide any necessary context needed to
understand
the code change.
-->
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat(rpc): Add `OpTransactionRequest` and associate it with `TransactionRequest` of `Optimism` (#557)
## Motivation
The change #525 introduced ambiguity of
`alloy_network::TransactionBuilder` implementation for
`TransactionRequest`, being implemented twice once for `Ethereum` and
once for `Optimism`. This then requires fully qualified syntax to
differentiate.
## Solution
Bring back `OpTransactionRequest`
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* deps: Upgrade `alloy` version `1.0.12` => `1.0.14` (#560)
## Motivation
Latest `alloy` release `1.0.14` has breaking changes.
## Solution
Update all implementations to comply with the latest release.
## PR Checklist
- [ ] Added Tests
- [ ] Added Documentation
- [ ] Breaking changes
* feat: override recover_signer_unchecked_with_buf (#561)
override https://github.com/alloy-rs/alloy/pull/2626
* chore: bump alloy (#562)
* Fix typo in test function name (#566)
Renamed the test function
test_serde_rountrip_op_execution_payload_envelope to
test_serde_roundtrip_op_execution_payload_envelope to correct a spelling
mistake in "roundtrip". This ensures consistency and improves code
readability.
* feat: add try_into_block_with methods to OpExecutionPayload (#563)
Adds custom transaction mapping functionality to OpExecutionPayload
types, following the same pattern as
https://github.com/alloy-rs/alloy/pull/2495.
## Changes
- Add `try_into_block_with` method to `OpExecutionPayloadV4` that
accepts a custom transaction mapper
- Add `try_into_block_with` method to `OpExecutionPayload` enum for all
payload versions
- Add `try_into_block_with_sidecar_with` method to `OpExecutionPayload`
for sidecar conversions with custom mapping
- Update existing `try_into_block` methods to use the new `_with`
variants internally
This enables more flexible transaction decoding when converting
execution payloads to blocks, allowing callers to provide their own
transaction decoding logic while maintaining the same validation checks.
---------
Co-authored-by: Claude <noreply@anthropic.com>
* chore: add receipt helpers (#567)
a few conversion helpers
* fix: simplify OpExecutionPayload numeric field deserialization (#568)
Simplifies the deserialization of numeric fields in `OpExecutionPayload`
by directly deserializing them as `U64` values instead of going through
string deserialization with `alloy_serde::quantity::deserialize`.
The following fields are affected:
- `block_number`
- `gas_limit`
- `gas_used`
- `timestamp`
- `blob_gas_used`
- `excess_blob_gas`
This change:
- Removes unnecessary string allocations during deserialization
- Simplifies the code by removing the `IntoDeserializer` dependency
- Aligns with similar fixes made in the main alloy repository
Related to https://github.com/alloy-rs/alloy/pull/2684
Co-authored-by: Claude <noreply@anthropic.com>
* chore: add transaction getters (#571)
* fix(rpc-types-engine): Fix `OpExecutionPayloadEnvelope::payload_hash` (#572)
## Overview
Fixes the `OpExecutionPayloadEnvelope::payload_hash` function to be
in-line with the
[spec](https://specs.optimism.io/protocol/rollup-node-p2p.html#block-signatures).
* feat: add map logs helpers (#574)…
refcell
pushed a commit
that referenced
this pull request
Feb 18, 2026
Simplifies the deserialization of numeric fields in `OpExecutionPayload` by directly deserializing them as `U64` values instead of going through string deserialization with `alloy_serde::quantity::deserialize`. The following fields are affected: - `block_number` - `gas_limit` - `gas_used` - `timestamp` - `blob_gas_used` - `excess_blob_gas` This change: - Removes unnecessary string allocations during deserialization - Simplifies the code by removing the `IntoDeserializer` dependency - Aligns with similar fixes made in the main alloy repository Related to alloy-rs/alloy#2684 Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Add background state trie cache warming that continuously warms caches during block building by streaming per-transaction state updates over a channel — matching reth's state root task pattern for future swapability.
Problem Statement
When the builder runs with
disable_state_root: true, witness generation for the state trie uses cold caches, causing slow performance. This can contribute to missed blocks during high-load periods.Solution
Stream per-transaction
EvmStatediffs to a backgroundStateTrieWarmerTaskthat incrementally accumulatesHashedPostStateand continuously computes state roots to warm OS/DB caches. The channel-based design mirrors reth's parallel state root system (MultiProofMessage/StateHookSender) so the warming task can be swapped for the real state root task later without changing execution code.Architecture
Key types (mirrors reth's state root task interface)
StateTrieMessage—StateUpdate(EvmState)|FinishedStateUpdates(mirrorsMultiProofMessage)StateTrieHook— sender wrapper with auto-finish onDrop(mirrorsStateHookSender)StateTrieWarmerTask— background task onspawn_blockingwith continuous warming algorithmevm_state_to_hashed_post_state()— converts per-tx EVM state to hashed form (copied from rethmultiproof.rs)Continuous warming algorithm
recv()for firstStateUpdate, accumulate intoHashedPostStaterecv_timeout(10ms)to drain more updatesstate_root_with_updates(accumulated.clone())to warm cachestry_recv()non-blocking drain of messages queued during computationFinishedStateUpdatesat any step → final warming if needed, then exitLifecycle
evm.transact()(beforecommit)FinishedStateUpdates→ task runs final warming → exitsConfiguration
--flashblocks.enable-state-trie-warming # (default: false) FLASHBLOCKS_ENABLE_STATE_TRIE_WARMING=trueMetrics
base_builder_state_trie_warming_started_count— warming computations startedbase_builder_state_trie_warming_completed_count— warming computations completedbase_builder_state_trie_warming_duration— duration histogrambase_builder_state_trie_warming_error_count— error countTest Plan
StateTrieHook(noop, drop semantics)StateTrieWarmerTask(completion, channel close, no-update exit, accumulation)FLASHBLOCKS_ENABLE_STATE_TRIE_WARMING=trueFiles Changed
bin/builder/src/cli.rs— CLI flagcrates/builder/core/src/flashblocks/state_trie_warmer.rs—StateTrieMessage,StateTrieHook,StateTrieWarmerTask,evm_state_to_hashed_post_state(), testscrates/builder/core/src/flashblocks/context.rs—state_hookparameter,send_state_update()calls after eachevm.transact()crates/builder/core/src/flashblocks/payload.rs— channel+task creation, hook threading, removed per-flashblockstart_warmingcallscrates/builder/core/src/flashblocks/config.rs—enable_state_trie_warmingconfig fieldcrates/builder/core/src/flashblocks/mod.rs— module exportscrates/builder/core/src/metrics.rs— warming metrics